Improving operators and suffix
This commit is contained in:
+29
-32
@@ -343,7 +343,7 @@ block = {
|
||||
}
|
||||
|
||||
statement = _{
|
||||
((expr | basic_stmt_left_recurse) ~ semicolon)
|
||||
(expr ~ semicolon)
|
||||
}
|
||||
|
||||
// ------------------------------------------------------
|
||||
@@ -357,12 +357,6 @@ basic_stmt = {
|
||||
| var_decl_statement
|
||||
}
|
||||
|
||||
basic_stmt_left_recurse = {
|
||||
increment_statement
|
||||
| decrement_statement
|
||||
| assign_statement
|
||||
}
|
||||
|
||||
return_stmt = {
|
||||
"return" ~ expr?
|
||||
}
|
||||
@@ -379,31 +373,6 @@ var_decl_statement = {
|
||||
var_decl ~ ("=" ~ expr)?
|
||||
}
|
||||
|
||||
increment_statement = {
|
||||
expr ~ "++"
|
||||
}
|
||||
|
||||
decrement_statement = {
|
||||
expr ~ "--"
|
||||
}
|
||||
|
||||
compound_assign = {
|
||||
"="
|
||||
| "+="
|
||||
| "-="
|
||||
| "/="
|
||||
| "%="
|
||||
| "&="
|
||||
| "|="
|
||||
| "^="
|
||||
| "<<="
|
||||
| ">>="
|
||||
}
|
||||
|
||||
assign_statement = {
|
||||
expr ~ compound_assign ~ expr ~ semicolon
|
||||
}
|
||||
|
||||
// ------------------------------------------------------
|
||||
// CONDITIONALS
|
||||
// ------------------------------------------------------
|
||||
@@ -536,6 +505,31 @@ try_px = {
|
||||
"?"
|
||||
}
|
||||
|
||||
increment = {
|
||||
"++"
|
||||
}
|
||||
|
||||
decrement = {
|
||||
"--"
|
||||
}
|
||||
|
||||
compound_assign = {
|
||||
"="
|
||||
| "+="
|
||||
| "-="
|
||||
| "/="
|
||||
| "%="
|
||||
| "&="
|
||||
| "|="
|
||||
| "^="
|
||||
| "<<="
|
||||
| ">>="
|
||||
}
|
||||
|
||||
assign = {
|
||||
compound_assign ~ expr
|
||||
}
|
||||
|
||||
postfix = {
|
||||
field_px
|
||||
| call_px
|
||||
@@ -544,6 +538,9 @@ postfix = {
|
||||
| index_px
|
||||
| as_px
|
||||
| try_px
|
||||
| increment
|
||||
| decrement
|
||||
| assign
|
||||
}
|
||||
|
||||
// ------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user