Open fish-face opened 3 years ago
@fish-face Thank you for the reporting! I won't fix this, but maybe I can help you.
nimy
is designed as a macro to make the parsing table and define the function parse
for the table.
So, if you define two parse
in one module (with the same token type), these names are conflicted.
But, you can use two (or more) different nimy
parser in one module if you define two (or more) parsers in two (or more) other modules.
https://github.com/loloicci/nimly/blob/master/tests/test_lr_lalr.nim is a good example to use two parsers in one module. (using https://github.com/loloicci/nimly/blob/master/tests/parser_415.nim and https://github.com/loloicci/nimly/blob/master/tests/parser_415_lr.nim)
Does it solve your problem?
If you define a lexer
niml lexer[MyToken]
and then two parsersnimy parserOne[MyToken]
andnimy parserTwo[MyToken]
you get an error due to a redefinition of the functionparse
(parsegen.nim:1001
)