Skip to content
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

Version where there is "<dash> <only number> <dash>" section cannot be parsed #1692

Closed
andrzejressel opened this issue Jul 20, 2024 · 1 comment · Fixed by #1697
Closed

Comments

@andrzejressel
Copy link

andrzejressel commented Jul 20, 2024

Code:

fn main() {
    let mut resolve = wit_parser::Resolve::default();
    resolve.push_str(".", "package documentation:example@1.0.0-11-a;").unwrap();
}

Expected: No error
Actual:

thread 'main' panicked at src/main.rs:3:72:
called `Result::unwrap()` on an `Err` value: expected ';', found `-`
     --> .:1:39
      |
    1 | package documentation:example@1.0.0-11-a;
      |                                       ^

Adding letters before "11" fixes the issue - except then there are dots: package documentation:example@1.0.0-a1.1-a; still fails.

EDIT: Another broken package: package documentation:example@1.0.0-11ab;

There seems to be issue with mixing numbers with letters

alexcrichton added a commit to alexcrichton/wasm-tools that referenced this issue Jul 22, 2024
Specifically fix parsing intermediate `-` characters in pre-release
versions and build metadata. Additionally fix alphabetic characters
following numeric characters.

Closes bytecodealliance#1692
alexcrichton added a commit to alexcrichton/wasm-tools that referenced this issue Jul 22, 2024
Specifically fix parsing intermediate `-` characters in pre-release
versions and build metadata. Additionally fix alphabetic characters
following numeric characters.

Closes bytecodealliance#1692
@alexcrichton
Copy link
Member

Thanks for the report!

github-merge-queue bot pushed a commit that referenced this issue Jul 22, 2024
* Fix parsing some semver strings in WIT

Specifically fix parsing intermediate `-` characters in pre-release
versions and build metadata. Additionally fix alphabetic characters
following numeric characters.

Closes #1692

* Fix build warnings
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 a pull request may close this issue.

2 participants