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

Wrong priority for shift operators in pretty-printer #1037

Open
1 task done
verytactical opened this issue Nov 13, 2024 · 0 comments · May be fixed by #1018
Open
1 task done

Wrong priority for shift operators in pretty-printer #1037

verytactical opened this issue Nov 13, 2024 · 0 comments · May be fixed by #1018
Labels
bug Something isn't working or isn't right

Comments

@verytactical
Copy link
Contributor

Are you using the latest released (or pre-released, a.k.a. "next") version?

  • I'm using the latest Tact version

Tact source code

contract Test {
    a: Int;

    init() {
        self.a = (1 << 2) + 3;
    }
}

Relevant Tact/build system log output

contract Test {
    a: Int;

    init() {
        self.a = 1 << 2 + 3;
    }
}

What happened?

getPrecedence doesn't have a case for << or '>>', and their priority is inferred to be 11, while by the grammar it should have been 7.5.

After printing the code self.a is set to 32, while previously it was 7.

What did you expect?

Pretty-printer should not change behavior.

Steps to reproduce

No response

How do you run Tact?

No response

Anything else?

No response

@verytactical verytactical added the bug Something isn't working or isn't right label Nov 13, 2024
@verytactical verytactical linked a pull request Nov 13, 2024 that will close this issue
4 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working or isn't right
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant