mjackson / citrus

Parsing Expressions for Ruby

Home Page:http://mjackson.github.io/citrus

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

multiple parses show "warning: already initialized constant Kget"

zipizap opened this issue · comments

If a program makes multiple citrus parses, then a ruby warning will be shown:

"...gems/citrus-2.4.0/lib/citrus/file.rb:56: warning: already initialized constant Kget"

This should be easy to fix (if constant is already defined, don't redefine it), but when I dived in the source code of file.rb, I've seen in line 56 that the constant definition uses metaprogramming, so I better leave the change for expert hands...

PD: The parser is fantastic :)
PD2: I've tested and seen that citrus is 10x faster in MRI-ruby than in Jruby - maybe it would be usefull to leave some tip in the readme about it

This behavior is intentional. It's designed to prevent you from loading the same grammar twice unnecessarily.

Ok, thanks for the info