8000 In a declaration, parenthesis are mandatory around a comma operator by eldritchconundrum · Pull Request #363 · laurentlb/shader-minifier · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

In a declaration, parenthesis are mandatory around a comma operator #363

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

Merged
merged 3 commits into from
Apr 29, 2024

Conversation

eldritchconundrum
Copy link
Collaborator

No description provided.

src/printer.fs Outdated
@@ -194,6 +194,8 @@ type PrinterImpl(withLocations) =
let init =
match decl.init with
| None -> ""
// comma operators must be wrapped by parentheses, only in a decl.
| Some (FunCall (Op ",", _) as i) -> out "=(%s)" (exprToS indent i)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd expect you can remove the special case.

untested:

let prec = precedence.[","]
exprToSLevel indent (prec + 1) i

@eldritchconundrum eldritchconundrum merged commit 06d10c7 into master Apr 29, 2024
@eldritchconundrum eldritchconundrum deleted the fix-comma-op-in-decl branch April 29, 2024 22:21
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 this pull request may close these issues.

2 participants
0