davidhq / SublimeEthereum

Ethereum Solidity, Vyper, Yul and StarkNet Cairo language syntaxes
MIT License
116 stars 43 forks source link

Syntax highlighting breaks for certain types of for loops #35

Closed mrice32 closed 5 years ago

mrice32 commented 5 years ago

For for loops that contain an = in the third statement, syntax parsing seems to break going forward. The following for loop would break, for example:

for (uint i = 0; i < n; i = i + 2) {
...
}

I've provided a screenshot as well.

image

davidhq commented 5 years ago

Thank you very much for this report. Fixed in 1.1.10. Please write back if you find any other issue.

mrice32 commented 5 years ago

Thank you!

Atlasoin commented 5 years ago

Still have the problem of loop. It doesn't work when the code is like

for (i=1; i < n; i ++)

but it works when the code is like:

for (i = i; i < n; i++)

Is that as expected? I just feel really weird... My Ethereum package version: v1.1.20, Sublime Text: v3.2.1 Screenshots attached: Screenshot from 2019-05-24 10-55-18 Screenshot from 2019-05-24 10-55-32

Thanks!

davidhq commented 5 years ago

Thank you very much for this.

I did two things in v1.1.21 :

I hope this fix didn't break something else, I checked on example contracts and the highlighter code itself is of enough quality that this should not be the case but still - would be grateful for checks by others... as always, report if you still find something, will be fixed....

Atlasoin commented 5 years ago

Thanks so much!