Skip to content


Addition example from website doesn't work with 2.2.0 #9

geeksam opened this Issue · 3 comments

2 participants


Saw talk at RubyConf, decided to play around with Citrus a wee bit on the flight home to PDX.

Tried following along with:

Pasted second code sample (the one that adds two semantic blocks) to file, saved it. Launched IRB, required rubygems, required citrus, loaded addition file, parsed expression... then tried m.value and got:

Citrus::NoMatchError: No match named "term" in 1 + 2 + 3 (additive)
    from /Users/sam/rails/pdxrails/deps/lib/ruby/gems/1.8/gems/citrus-2.2.0/lib/citrus.rb:1198:in `method_missing'
    from (eval):3:in `value'
    from (irb):5

This, however, calculates it just fine:

  rule additive
    (number plus term:(additive | number)) {
      def value
        lft, _, rgt = *matches
        lft.value + rgt.value

Thanks for catching this. This is a regression that was introduced in the 2.2 release. It has been fixed in this commit and pushed in version 2.2.2.


Cool; thanks for the quick fix. Will find some more time to play with this soon.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.