mjijackson/citrus — Issue #32: single item in rule body results in infinite loop. 
Author: sriram-srinivasan
Created: 2011-10-17 23:29:42+00:00
State: open

The following code runs into an infinite loop when `value` is called and runs out of stack.

```
grammar X
rule item
num {
num.value
}
end

rule num
/[0-9]+/ {to_i * 1000}
end
end
x = X.parse("100")
x.value
```

It is likely that item.value and num.value are somehow conflated and that it calls itself.

The following does not have a problem.

grammar X
rule item
(n1:num ',' n2:num) {
n1.value + n2.value
}
end

rule num
/[0-9]+/ {to_i}
end
end

x=X.parse("100,200")
x.value # no problem.