Matthewar / ASV

A Haskell VHDL Simulation Tool
GNU General Public License v3.0
0 stars 0 forks source link

Lexer cannot deal with delimiters (operators, etc.) touching identifiers #31

Closed Matthewar closed 6 years ago

Matthewar commented 6 years ago

When an operator touches anything but whitespace, an error occurs. An example of this is the (3); in the following ghci log:

lexerList "package name is constant name : integer := name (3); end;"
Left Some lexer error occurred
Matthewar commented 6 years ago

Seems to be that the state delim in the lexer is never jumped to, I assume that was supposed to be identifier.

Matthewar commented 6 years ago

Fix works for test case.

lexerList "package name is constant name : integer := name(3); end;"
Right [Keyword Package,Identifier "name",Keyword Is,Keyword Constant,Identifier "name",Operator :,Identifier "integer",Operator :=,Identifier "name",Operator (,Literal (Univ_Int 3),Operator ),Operator ;,Keyword End,Operator ;]
Matthewar commented 6 years ago

Should do further testing before this is confirmed to be fixed (#3)