umut-sahin / dotlr

An LR(1) parser generator and visualizer created for educational purposes.
Apache License 2.0
91 stars 4 forks source link

feat: add token span info, fixes #1 and #13 #15

Closed Specy closed 2 weeks ago

Specy commented 1 month ago

Also one info, tests on my machine are not executing successfully because of the colored strings not being equal to the normal string slices, for example:

assertion `left == right` failed
  left: "conflict at state \u{1b}[32m5\u{1b}[0m on \u{1b}[32m'a'\u{1b}[0m"
 right: "conflict at state 5 on 'a'"

I've changed two tests to make them not use error messages, but i wasn't sure if you wanted them to stay that way so i've left them.

I added token span info in ParsingError, so i guess there will be failing CI tests because of that.

What should i do?

Specy commented 1 month ago

Ok i managed to fix the errors from the CI reports

umut-sahin commented 1 month ago

Sorry, it has been a busy week. I'll review it in this weekend, thanks!

Specy commented 1 month ago

Sure

Specy commented 1 month ago

I forgot to change the local package.json version back to v0.3.0, be careful when publishing, make sure to change it back to v0.3.1

Specy commented 1 month ago

I have not added tests for the typescript lib because i'm getting error with the node environment running with wasm and it's a bit of a mess (love js sometimes) so i've left it for a future PR, but i've added the tokenization span test, only one but it covers many cases of where it could be buggy