-
Notifications
You must be signed in to change notification settings - Fork 757
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Parser] Allow any number of foldedinsts in foldedinsts
#5965
Conversation
Current dependencies on/for this PR:
This comment was auto-generated by Graphite. |
Diff is smaller without whitespace. |
Codecov Report
@@ Coverage Diff @@
## main #5965 +/- ##
==========================================
- Coverage 43.00% 43.00% -0.01%
==========================================
Files 492 492
Lines 74875 74879 +4
Branches 11656 11658 +2
==========================================
+ Hits 32200 32201 +1
- Misses 39450 39452 +2
- Partials 3225 3226 +1
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yikes, the wasm text format is... tricky.
I understand where this particular complexity comes from, but I had not realized it was possible until now.
return false; | ||
} | ||
bool ret = takeKeyword(expected); | ||
lexer = original; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How efficient is this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very. It's essentially just resetting an index into the source buffer to its previous value.
See also WebAssembly/spec#1682 |
fdf17e2
to
be155c7
Compare
a679fee
to
fe1a81a
Compare
be155c7
to
65ee4c5
Compare
Somewhat counterintuitively, the text syntax for a folded `if` allows any number of folded instructions in the condition position, not just one. Update the corresponding `foldedinsts` parsing function to parse arbitrary sequences of folded instructions and add a test.
65ee4c5
to
f10684c
Compare
I found a much simpler way to implement this. PTAL! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
…y#5965) Somewhat counterintuitively, the text syntax for a folded `if` allows any number of folded instructions in the condition position, not just one. Update the corresponding `foldedinsts` parsing function to parse arbitrary sequences of folded instructions and add a test.
Somewhat counterintuitively, the text syntax for a folded
if
allows any numberof folded instructions in the condition position, not just one. Update the
corresponding
foldedinsts
parsing function to parse arbitrary sequences offolded instructions and add a test.