You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Parsing fails when the top node of the grammar isn't used just on top #90
val bfParser = lesana<List<BfStatement>> {
val command =NodeID<BfStatement>("command")
val commandList = include(list(command))
command to def(re("<+")) { BfStatement.Left(it.v1.length) }
// ...
command to def(re("\\["), commandList, re("\\]")) { (_, cmds, _) ->BfStatement.Loop(cmds) }
ignoreRegexes("[^+\\-<>.,[\\]]")
setTopNode(commandList)
}.getLesana()
When a [...] loop is encountered, the parser returns just the insides of the loop. This is because when it finishes parsing the loop, it sees the top node type at the top of the stack, so it assumes the parsing is finished. No warning is issued to the programmer about this.
We should mitigate this issue or at least throw an error when we detect a configuration like this.
Activity