flofriday / Moose

🐐 A new fun programming language
MIT License
6 stars 1 forks source link

Error highlighting glitches #17

Closed flofriday closed 1 year ago

flofriday commented 2 years ago

The highlighting has some glitches where it misses a couple of characters (often off-by one or off by two errors)

Example: image

flofriday commented 2 years ago

Update So I depricated the ASTLocator and moved the location into the AST, with which the Parser can set more specific locations for AST nodes that need it

However, the error repoting is still pretty glitchy. This however seems to be a problem in the lexer. For example in the following example the lexer gives the first bracket the location of column: -1 when it should be 1.

[234, 234]

We should also add correct location determination to the testsuite.

flofriday commented 1 year ago

After rewriting the parsers location determination, all glitches seem to be fixed