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

PPrint instance for Cwrite incorrect #568

Open
mieszko opened this issue Jul 2, 2023 · 0 comments
Open

PPrint instance for Cwrite incorrect #568

mieszko opened this issue Jul 2, 2023 · 0 comments

Comments

@mieszko
Copy link
Collaborator

mieszko commented Jul 2, 2023

the PPrint instance for the CSyntax cons Cwrite does not respect operator precedence or fixity used to parse the := production. this causes a compile -> -dparsed -> compile sequence to fail on the second compilation.

Example 1

(foo $ r) := bar

pretty-prints as

foo $ r := bar

which parses as foo $ (r := bar) given the current relative precedence of $ and :=.

Example 2

r := (foo $ bar)

pretty-prints as

r := foo $ bar

which parses as (r := foo) $ bar.

mieszko pushed a commit to mieszko/bsc that referenced this issue Jul 3, 2023
Tests parsing and pretty-printing of $ and := in the same expression. See discussion B-Lang-org#567 and issue B-Lang-org#568 for context.
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