[grammarians] ambiguity with method call?

Ryan Davis ryand-ruby at zenspider.com
Wed Nov 30 02:47:51 EST 2005


On Nov 29, 2005, at 12:59 PM, Terence Parr wrote:

> Howdy,
>
> What does
>
> foo [1]

sudo gem install ParseTree (!!)

% echo "foo [1]" | parse_tree_show -f
...
[:fcall, :foo, [:array, [:array, [:lit, 1]]]]

without any other context to go on, it is assumed it is an fcall, in  
other contexts it could be an lvar, dvar, or a regular call.

You should also do a gem unpack ParseTree and look through the unit  
tests. That might answer quite a few of your questions as well.



More information about the Rubygrammar-grammarians mailing list