escalier-lang / escalier

A compile-to-JavaScript language with tight TypeScript integration.
https://escalier-lang.github.io/escalier/
MIT License
21 stars 1 forks source link

Change how keywords are handled #705

Open kevinbarabash opened 11 months ago

kevinbarabash commented 11 months ago

Instead of parsing things as keywords without knowing whether the token needed is a keyword or not, let's instead have a parse_keyword(keyword: &str) method that calls as a parse_ident() method and then checks if the return identifier matches the expected keyword.

kevinbarabash commented 11 months ago

This turned out to be harder than it looked. I'll probably have to create a small toy parser to see if I can figure out the right pattern before implementing it for real.