ethereum / fe

Emerging smart contract language for the Ethereum blockchain.
https://fe-lang.org
Other
1.61k stars 186 forks source link

v2: modest parser improvements #934

Closed sbillig closed 8 months ago

sbillig commented 1 year ago
sbillig commented 10 months ago

@Y-Nak I'm inclined to merge these few simple changes as-is.

I'm currently experimenting with the trait TryParse idea and converting parse errors to enums, but will do that in a separate PR.

sbillig commented 10 months ago

By "as-is" I don't mean that I won't make requested changes, of course, just that I'll do further parser restructuring separately.

Y-Nak commented 10 months ago

I left two nits. I feel it'd be better to continue the discussion on #972. Please feel free to merge the PR after the nits are resolved.

sbillig commented 9 months ago

@Y-Nak I decided to apply one more change to this PR. Previously, x > > 1 and x + = 1 would be accepted as >> and += operations; I think it's better to require that there be no whitespace in the operator, and I think my implementation is the least-bad option to solve this. (The other obvious option is to add +=, >>, etc as lexer tokens and allow splitting >> tokens into two)