noir-lang / noir

Noir is a domain specific language for zero knowledge proofs
https://noir-lang.org
Apache License 2.0
854 stars 185 forks source link

Make variables mutable #52

Closed kevaundray closed 3 years ago

kevaundray commented 3 years ago

This entails

kevaundray commented 3 years ago

The previous way to do it is here: https://github.com/noir-lang/noir/commit/03e640285228d4654e7e8b1c8d3e48502724cabd

However, this method means we need to have both an AssignExpression and an AssignStatement. What we could do it, to check for an identifier in the parse_statement method. We would need to peek ahead at the next token to see if it is an assign operator, because we could also have an identifier/expression which starts with an identifier