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).
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).