Lox interpreter - beginner's attempt

Some people tried to implement lox interpreter based on the book Crafting Interpreters.

This is my attempt. I had lots of aaargh! moment to reach this point.

https://gitlab.com/bigos/simple_interpreter/-/blob/main/lib/scanner.ml

Please offer critique, especially because my solution differs from others. Also I am not sure I do the right thing with the comments on top of the files used to copy and paste into the topleve. Is there a beetter ways to do it?

2 Likes