This repository has been archived on 2020-09-15. You can view files and clone it, but cannot push or open issues or pull requests.
Alek Ratzloff 65b8d3af58 Update associativity of dot binary expressions and suffix expressions
The problem being encountered was, given something like this:

    foo.bar()

we would be getting an AST that looks like this:

    - binexpr:
        lhs: foo
        op: dot
        rhs:
            funcall:
                expr: bar
                params: []

which is the same as parsing like this:

    foo . (bar())

Which isn't what we want - it's like saying "get variable foo, and then
call function bar(), and whatever is returned by bar() should be used to
get an attribute from foo" and so forth. Instead, we want "get the
attribute bar from foo, and then call it as a function," which parses
like this:

    (foo . bar) ()

Dot expressions are now left-associative, and they also slurp function
call and index expression suffixes so that a dot expression before a
function call will be resolved before being called as a function.

Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
2020-05-27 15:07:14 -04:00
2020-04-27 12:42:17 -04:00
Description
It certainly isn't Python!
481 KiB
Languages
Rust 100%