Skip to content

NULLABLE regexes don't work as expected #94

Description

@j-jzk
        val lsn = lesana<String> {
            val top = NodeID<String>()
            top to def(re("a"), re(""), re("b")) { (a, _, b) -> a + b }
            setTopNode(top)
        }.getLesana()

        lsn.parse(iter("ab"))  // this fails with a SyntaxError

This is because the parser doesn't expect the middle regex to be NULLABLE, so it doesn't pass the re("b") to the lexer in the set of expected regexes. We should either issue a warning, disallow nullable regexes altogether, or pass the next regex to the lexer if the current one is NULLABLE (probably the best solution, but the most difficult one).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions