mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 07:22:45 +00:00 
			
		
		
		
	 b74df136fe
			
		
	
	
		b74df136fe
		
	
	
	
	
		
			
			Due to the way expression parser is written, we need to resolve the ambiguity between member access operators and dots used for punctuation during lexing. The lexer uses a (totally bulletproof) heuristic to do that: whenever '.' is followed by ' ' or '\n', it is considered a dot and member access otherwise. While it works fine for prettified test cases, non-prettified files often lack enter after a trailing dot character. Since MemberAccess will always be invalid at that position, explicitly treat trailing dot as a part of punctuation.
		
			
				
	
	
		
			8 lines
		
	
	
	
		
			131 B
		
	
	
	
		
			Text
		
	
	
	
	
	
			
		
		
	
	
			8 lines
		
	
	
	
		
			131 B
		
	
	
	
		
			Text
		
	
	
	
	
	
| ===== AST after reference-resolving =====
 | |
| Foo(a):
 | |
| TreeList
 | |
|   ReturnNode
 | |
|     BinaryOperation MemberAccess
 | |
|       Var a
 | |
|       Slot b
 | |
| 
 |