RomanYankovsky / DelphiAST

Abstract syntax tree builder for Delphi
Mozilla Public License 2.0
271 stars 116 forks source link

Lexer failes parsing generic types with default value without spacecing inbetween #314

Open kvrabec opened 2 years ago

kvrabec commented 2 years ago

This bug appeared in function declaration code, while assigning default value to a generic type without spacing between closing angle bracket and equality sign

For example, the following code: function doSomething(const var1 : integer; const myGenericType : GenericType<integer>=nil);

causes exception with the following error message: Failed to make AST for unit '<unitName>'. Problems on line : '31', column : 142' 'Greater' expected found '>='

The problem is currently solved by adding the space inbetween, but former code is a valid Delphi code 😃