tokay-lang / tokay

Tokay is a programming language designed for ad-hoc parsing, inspired by awk.
https://tokay.dev
MIT License
236 stars 7 forks source link

Implement builtin `Keyword<P>` #121

Closed phorward closed 8 months ago

phorward commented 9 months ago

This origins from #105 to replace tokay.toks 'kw' _standalone_ by Keyword<'kw'>, which is also useful for other use-cases and languages.

phorward commented 9 months ago

Implementation draft!

# Parse keywords, which may not be the prefix of another identifier.
Keyword : @<P> {
    P Not<Alphabetic>
}

Keyword<'if'> print("Real If!")
print("Skipping" Char)
phorward commented 8 months ago

fixed by #125