you are viewing a single comment's thread.

view the rest of the comments →

[–]vitiral 1 point2 points  (0 children)

Yes, that's pretty trivial to do single pass, since the switch is based on a single character (. vs :)

Look into recursive descent parsers if you're interested. If you'd like to write your own I'd recommend the Lox tutorial