Open mvertes opened 1 week ago
Attention: Patch coverage is 83.78378%
with 6 lines
in your changes missing coverage. Please review.
Project coverage is 54.61%. Comparing base (
6ec4bb8
) to head (83b7751
). Report is 2 commits behind head on master.
Files | Patch % | Lines |
---|---|---|
gnovm/pkg/gnolang/machine.go | 0.00% | 4 Missing :warning: |
gnovm/pkg/gnolang/preprocess.go | 66.66% | 1 Missing and 1 partial :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
please merge and fix conflicts :pray:
cc @deelawn for a second review
The column number was not stored in the GnoVM location. A
Nonce
field was used to distinguished 2 block nodes on the same line. This was applied only to block nodes, not expressions or statements.As a result, the node location was the same for all expressions and statements located at the same source line. This change ensures the uniqueness of location for all nodes, in addition to providing an accurate position in source code.
We replace
Nonce
byColumn
, computed by the Go tokenizer (the same as line numbers). Column is always included in all AST nodes, and the location string has a uniform format.With this change it is now possible for the debugger to step in infinite loops on one line like:
for { i++; println(i) }
This change is also necessary for a correct accounting for code coverage, and also may be gas accounting.
Note: as
Nonce
is renamed toColumn
in protocol definitions (type and index unchanged), it may qualify as a BREAKING CHANGE, but I'm not completely sure of that.Contributors' checklist...
- [*] Added new tests, or not needed, or not feasible - [*] Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory - [*] Updated the official documentation or not needed - [*] No breaking changes were made, or a `BREAKING CHANGE: xxx` message was included in the description - [ ] Added references to related issues and PRs - [*] Provided any useful hints for running manual tests - [ ] Added new benchmarks to [generated graphs](https://gnoland.github.io/benchmarks), if any. More info [here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md).