extend languag grammar with new syntax

hi guys,

i am now working on a project where we use the TigerJython Syntax which is just an extension of the Python Syntax with some additional functionality. (a new type of loop with keywords etc described in detail on the bottom).

As of right now i just forked and modified the python parser (added new rules as dialect) to my project. Is there a more elegant way to do that? Like loading the python parser and adding parsing rules on that? Or should I create a pull request, to add the dialect to the lezer python parser?

Added language features.
Basically we have some additional functionality such as the repeat loop which is equivalent to a while(true) loop when called without argument, or if you add an argument it’s equivalent to for _ in range(arg).

That is definitely a reasonable way to do this. LR parser generation is very much a whole-program compilation process, and the parse tables it outputs cannot really be extended at run-time in any practical way.