inspirer / textmapper

Lexer and Parser generator
http://textmapper.org
MIT License
107 stars 23 forks source link

Update js.tm #59

Closed Ahhhhmed closed 1 year ago

Ahhhhmed commented 1 year ago

Did a similar change to https://github.com/inspirer/textmapper/pull/50 with the current version and resolved the relevant comment form it.

Error that I'm not sure how to resolve:

--- FAIL: TestGenerate (0.38s)
    --- FAIL: TestGenerate/../../tm-parsers/js/js.tm (0.24s)
        gen_test.go:44: GenerateFile() failed with ../../tm-parsers/js/js.tm:631:23: Lookaheads must use mutually exclusive conditions and enumerate disambiguating
            nonterminals in the same order, found:
                (?= !StartOfParametrizedCall)
                (?= StartOfParametrizedCall)
                (?= StartOfParametrizedCallNoArgList)
        gen_test.go:44: GenerateFile() failed with ../../tm-parsers/js/js.tm:654:5: Lookaheads must use mutually exclusive conditions and enumerate disambiguating
            nonterminals in the same order, found:
                (?= !StartOfParametrizedCall)
                (?= StartOfParametrizedCall)
                (?= StartOfParametrizedCallNoArgList)
        gen_test.go:44: GenerateFile() failed with ../../tm-parsers/js/js.tm:654:5: Lookaheads must use mutually exclusive conditions and enumerate disambiguating
            nonterminals in the same order, found:
                (?= StartOfParametrizedCall)
                (?= StartOfParametrizedCallNoArgList)
        gen_test.go:44: GenerateFile() failed with ../../tm-parsers/js/js.tm:655:5: Lookaheads must use mutually exclusive conditions and enumerate disambiguating
            nonterminals in the same order, found:
                (?= !StartOfParametrizedCall)
                (?= StartOfParametrizedCall)
                (?= StartOfParametrizedCallNoArgList)
        gen_test.go:44: GenerateFile() failed with ../../tm-parsers/js/js.tm:655:5: Lookaheads must use mutually exclusive conditions and enumerate disambiguating
            nonterminals in the same order, found:
                (?= StartOfParametrizedCall)
                (?= StartOfParametrizedCallNoArgList)
inspirer commented 1 year ago

Yeah, the java version does not correctly detect those cases. I fixed the grammar in a couple places and it compiles fine now.

Thank you for the changes!