katsaii / catspeak-lang

A cross-platform modding language for GameMaker games.
https://www.katsaii.com/catspeak-lang/
MIT License
92 stars 6 forks source link

Customise the lexer, parser, and code generator of a `CatspeakEnvironment` #108

Closed katsaii closed 9 months ago

katsaii commented 11 months ago

What is your feature request?

More control over how Catspeak is consumed at a top-level through the convenience of CatspeakEnvironment.

Please describe in detail how you expect this new feature to behave.

Custom methods or public fields on CatspeakEnvironment to change the lexer, parser, and environment. Might look something like:

Catspeak.lexer = GMLLexer;
Catspeak.parser = GMLParser;

Then calling Catspeak.parseString will tokenise the string using GMLLexer and then pass those tokens on to GMLParser to consume.