method call threw Pholyglot__Parser.MenhirBasics.Error.
This is slightly annoying. I have an error in my grammar and need to trace through what’s happening. Any tips…? I can look at the generated parser.ml file for clues, but sometimes it’s not enough.
Full error message (probably irrelevant):
File "lib/test.ml", line 1147, characters 0-665: method call threw Pholyglot__Parser.MenhirBasics.Error.
Raised at file "lib/parser.ml" (inlined), line 8, characters 6-17
Called from file "lib/parser.ml", line 2378, characters 14-21
Called from file "lib/test.ml", line 1158, characters 8-71
Called from file "runtime-lib/runtime.ml", line 502, characters 15-19
Called from file "runtime-lib/runtime.ml", line 343, characters 8-12
Re-raised at file "runtime-lib/runtime.ml", line 346, characters 6-13
Called from file "runtime-lib/runtime.ml", line 359, characters 15-52
Called from file "runtime-lib/runtime.ml", line 446, characters 52-83
Hm, error seems related to keyword “public” and the fact that both class properties and class methods can start with this keyword.
| "class" s=CLASS_NAME "{" p=list(class_property) m=list(method_) "}" { ... }
So class_property
and method_
both start with the “public” keyword, and for some reason that’s confusing for Menhir?
Maybe also related to this:
Warning: 2 states have shift/reduce conflicts.
Warning: 7 shift/reduce conflicts were arbitrarily resolved.
Hm, maybe I need to slam the two rules together, for property and method. Even tho they return very different things (property vs declaration).