Skip to content

Commit

Permalink
fix selection order of prefix/postfix AST fields
Browse files Browse the repository at this point in the history
Added tests to the existing suite.
  • Loading branch information
OmarTawfik committed Feb 23, 2024
1 parent ad98d1c commit f5f1e40
Show file tree
Hide file tree
Showing 12 changed files with 583 additions and 93 deletions.
5 changes: 5 additions & 0 deletions .changeset/lemon-knives-fry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nomicfoundation/slang": patch
---

fix selection order of prefix/postfix AST fields
4 changes: 2 additions & 2 deletions crates/codegen/parser/generator/src/ast_model.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,10 +221,10 @@ impl AstModel {

match operator.model {
model::OperatorModel::Prefix => {
fields.insert(0, operand("operand"));
fields.push(operand("operand"));
}
model::OperatorModel::Postfix => {
fields.push(operand("operand"));
fields.insert(0, operand("operand"));
}
model::OperatorModel::BinaryLeftAssociative
| model::OperatorModel::BinaryRightAssociative => {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f5f1e40

Please sign in to comment.