Skip to content

Remove old syntax from table and elem in parser #3753

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

Merged
merged 3 commits into from
Mar 31, 2021

Conversation

martianboy
Copy link
Contributor

We've been keeping old syntax in the text format parser although they've
been removed from the parser and hardly any test case relies on them.
This PR will remove old syntax support for tables and element segments
and simplify the corresponding parser functions. A few test files were
affected by this that are updated.

@martianboy
Copy link
Contributor Author

@tlively @aheejin @kripken Reviews appreciated here, too. (Alpine build step seems to be stuck.)


if (s[i]->isStr()) {
char c = s[i]->c_str()[0];
if ('0' <= c && c <= '9') {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can use wasm::isInteger to check for numbers here and below.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if I understand the point here, wasm::isInteger seems to check that a double is actually an integer and also not infinite.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I misremembered the function name. I meant String::isNumber :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh nice! Thanks. Fixed now. By the way, do we parse hex numbers in general? Is there a utility for detecting and parsing hex the way it's defined and used in the spec? e.g. 0x1000_0000

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, not that I know of.

We've been keeping old syntax in the text format parser although they've
been removed from the parser and hardly any test case relies on them.
This PR will remove old syntax support for tables and element segments
and simplify the corresponding parser functions. A few test files were
affected by this that are updated.
@tlively tlively merged commit d9f0d8f into WebAssembly:main Mar 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants