Skip to content

Commit

Permalink
Fixed ternary expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
kizeevov committed Mar 16, 2024
1 parent 54e1395 commit e0ce2cf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@

## [Unreleased]

### Fixed

- Fixed ternary expressions

## [0.3.1] - 2023-12-16

### Added
Expand Down
6 changes: 3 additions & 3 deletions src/main/grammars/SlintParser.bnf
Original file line number Diff line number Diff line change
Expand Up @@ -378,9 +378,9 @@ private ArrayAnonymousStruct ::= '[' AnonymousStructDeclaration? (',' (Anonymous
/////////////////////////////////////////////////////////////////////////////////////////////////////
Expression ::=
AssignmentExpression
| TernaryExpression
| BinaryExpression
| UnaryExpression
| TernaryExpression
| CallBuiltinExpression
| CallExpression
| PropertyExpression
Expand Down Expand Up @@ -431,10 +431,10 @@ UnaryOperators ::=
AssignmentExpression ::= PropertyExpression EQ Expression { pin=3 }
BinaryExpression ::= Expression Operators Expression { pin=3 }
UnaryExpression ::= UnaryOperators Expression { pin=1 }
TernaryExpression ::= Expression '?' Expression ':' Expression { pin=3 }
TernaryExpression ::= Expression '?' Expression ':' Expression { pin=4 }
CallExpression ::= PropertyExpression CallArgumentList { pin=1 }
CallBuiltinExpression ::= BuiltinFunctions
ParenthesizedExpression ::= '(' Expression ')' { pin=1 }
ParenthesizedExpression ::= '(' Expression ')' { pin=3 }
ArrayExpression ::= PropertyExpression '[' Expression ']'
ArrayAnonymousStructExpression ::= ArrayAnonymousStruct
AnonymousStructExpression ::= AnonymousStructDeclaration
Expand Down

0 comments on commit e0ce2cf

Please sign in to comment.