asoffer / Icarus

An experimental general-purpose programming language
Apache License 2.0
9 stars 2 forks source link

`ast::Assignment` should not inherit from `ast::Expression` #19

Closed asoffer closed 3 years ago

asoffer commented 3 years ago

Assignments are not expressions in Icarus, however they are treated as expressions while parsing to facilitate named function parameters. For instance, while parsing f(x = 3), the sub-expression x = 3 will be an assignment which we extract before it gets placed into the ast::Call. It's probably best to use a new tag for assignments and update the parse rules so this doesn't have to technically be an expression.