- 
                Notifications
    You must be signed in to change notification settings 
- Fork 819
[wasm-split] End module names with : in manifests #8003
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
base: main
Are you sure you want to change the base?
Conversation
Suggested by by @sbc100 (emscripten-core/emscripten#25577 (comment)). Currently this supports both module names with a `:` and without it for backwards compatibility and also to pass the CI.
This makes better distinction of module names and function lists. Suggested by by @sbc100 (emscripten-core#25577 (comment)). This has to land after WebAssembly/binaryen#8003.
|  | ||
| IString substr(size_t pos, size_t len = std::string_view::npos) const { | ||
| return IString(str.substr(pos, len)); | ||
| } | 
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.
Has binararyen really gone this long without a substr() or endswith() operations on strings?
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.
Apparently 🤷🏻
| Name name = WasmBinaryReader::escape(line); | ||
| if (newSection) { | ||
| if (name.endsWith(":")) { | ||
| name = name.substr(0, name.size() - 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.
You could be clever and allow (0, -1) here like in high level languages?
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.
In basic_string_view::substr, the second argument is a count, the number of characters, so I think making the meaning of IString::substr different will be confusing. If we want that behavior we can add a separate function like slice(size_t start, size_end) or something. But we only have a single use here now, so I'm not sure if that's necessary at this point?
This makes better distinction of module names and function lists. Suggested by by @sbc100 (emscripten-core/emscripten#25577 (comment)).
Currently this supports both module names with a
:and without it for backwards compatibility and also to pass the CI.