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

parse_expr not stopping on => #3099

Open
1 task
badumbatish opened this issue Jul 25, 2024 · 0 comments
Open
1 task

parse_expr not stopping on => #3099

badumbatish opened this issue Jul 25, 2024 · 0 comments

Comments

@badumbatish
Copy link
Contributor

Summary

From Jun 5th,

badumbatish:

does parsing expression in parser.parse_expr() act the same as parsing outside? I called parse_expr (with no arguments) with current token of the first num1 and it kept on parsing until the right parenthesis of asm!

    unsafe {
        asm!(
            "add {0}, {0}",
            inout(reg) num1 => num1,
            in(reg) num2,
        );
    }

Reproducer

I tried this code:

    unsafe {
        asm!(
            "add {0}, {0}",
            inout(reg) num1 => num1,
            in(reg) num2,
        );
    }

Does the code make use of any (1.49) nightly feature ?

  • Nightly

Godbolt link

No response

Actual behavior

Currently the inline assembly uses 2 identifier token checks, one for num1 before the =>, one for num1 after the =>

Expected behavior

I expected to be able to use parse_expr for both identifier, meaning I would want to call parse_expr(), then check for => , then call parse_expr() again without parse_expr eating up all token from the token stream

GCC Version

#3098

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

No branches or pull requests

1 participant