bootstrapworld / pyret-blocks

Block Language for the Pyret Programming Language
Apache License 2.0
3 stars 1 forks source link

Chained methods display as one single method #14

Open kaisucode opened 3 years ago

kaisucode commented 3 years ago

Code such as foo.get(x).get(y) is incorrectly represented as a single method in the editor.

Screen Shot 2021-02-07 at 2 23 28 PM

The parser treats the foo.get(x).get portion as a single method call, and only y is registered as a parameter in this situation.

schanzer commented 3 years ago

It's doing the right thing, but with the wrong parse tree. This is an error in the parse-translator itself, since calling editor.getAst() shows that CMB is being handed an AST with one function application, whose func is foo.get(x).get.

(Related, but not the cause of the bug: I see that method calls are being treated as functionApps, and I'm not sure that's the right way to do it.)