Open varkor opened 7 years ago
I'm not sure what the best solution here is. We could either simply disable the cache when tracing is enabled (simple, but slows things down a lot), or we could query matches to see if they contain any traces (potentially expensive) when we fetch them from the cache and add another method for triggering the trace.
Usually the
trace()
function will provide helpful messages when rules are matched. However, if a rule is matched from the cache (https://github.com/CompilerTeaching/Pegmatite/blob/ba2350f5d72aeed84f6f7cb715f9317323643574/parser.cc#L1226), then no message will be displayed, which can be confusing when trying to debug a grammar.