dlang-community / Pegged

A Parsing Expression Grammar (PEG) module, using the D programming language.
534 stars 66 forks source link

Clear blockers before parsing #194

Closed Domain closed 8 years ago

Domain commented 8 years ago

Those blockers (blockMemo_xxx_atPos) are static vars. They should be cleared before each parsing.

veelo commented 8 years ago

You are right. I was about to look into this. Clearing can now easily be done in forgetMemo(), see https://github.com/PhilippeSigaud/Pegged/blob/master/pegged/grammar.d#L306. I'll prepare a PR next weekend, unless you beat me to it.

But maybe these shouldn't be static vars. Anyway I would have expected these arrays to be empty after a successful parse, and I think they aren't. I need to take a closer look.