Hello guys! I new in Elixir and NimbleParsec library, I am trying to reconize a bracket pattern like this Statement ::= "{" ( Statement )* "}" use the following code
Now this will be infinitely recursive which is probably not what you want. But I assume this is only part of whatever grammar you are parsing. it also does not account for whitespace. I usually end up with ignore(optional(whitespace())) in a few places in a grammar.
Yeah I also thought about this recursive loop, this is the minijava grammar, I’m using your modified version it match ok when I have a string like this {} but when I test the string {{}} I got an error saying there is no end of file, it is weird because we have the last } that should follow an end of string
iex(29)> Jotamenos.Parser.Statement.parser("{{}}")
{:error, "expected byte equal to ?}, followed by end of string", "{}}", %{}, {1, 0}, 1}
``