Skip to content

Commit

Permalink
chore: promote
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyfettes committed Dec 25, 2024
1 parent 3f97f63 commit b7fec74
Show file tree
Hide file tree
Showing 4 changed files with 107 additions and 4 deletions.
50 changes: 46 additions & 4 deletions src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -1945,7 +1945,7 @@
},
{
"type": "STRING",
"value": "&&"
"value": "&"
},
{
"type": "SYMBOL",
Expand All @@ -1966,7 +1966,7 @@
},
{
"type": "STRING",
"value": "||"
"value": "|"
},
{
"type": "SYMBOL",
Expand All @@ -1978,6 +1978,48 @@
{
"type": "PREC_LEFT",
"value": 11,
"content": {
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "expression"
},
{
"type": "STRING",
"value": "&&"
},
{
"type": "SYMBOL",
"name": "expression"
}
]
}
},
{
"type": "PREC_LEFT",
"value": 10,
"content": {
"type": "SEQ",
"members": [
{
"type": "SYMBOL",
"name": "expression"
},
{
"type": "STRING",
"value": "||"
},
{
"type": "SYMBOL",
"name": "expression"
}
]
}
},
{
"type": "PREC_LEFT",
"value": 9,
"content": {
"type": "SEQ",
"members": [
Expand Down Expand Up @@ -4286,7 +4328,7 @@
},
"as_pattern": {
"type": "PREC",
"value": 9,
"value": 7,
"content": {
"type": "SEQ",
"members": [
Expand All @@ -4307,7 +4349,7 @@
},
"or_pattern": {
"type": "PREC_RIGHT",
"value": 10,
"value": 8,
"content": {
"type": "SEQ",
"members": [
Expand Down
4 changes: 4 additions & 0 deletions src/node-types.json
Original file line number Diff line number Diff line change
Expand Up @@ -2581,6 +2581,10 @@
"type": "%",
"named": false
},
{
"type": "&",
"named": false
},
{
"type": "&&",
"named": false
Expand Down
Binary file modified src/parser.c
Binary file not shown.
57 changes: 57 additions & 0 deletions test/corpus/expression.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1001,3 +1001,60 @@ fn init {
(atomic_expression
(literal
(integer_literal))))))))))))))))))

================================================================================
apply expression with labeled argument
================================================================================
fn main {
let a = 1 | 2 && 3 & 4 || 5
}
--------------------------------------------------------------------------------

(structure
(structure_item
(function_definition
(function_identifier
(lowercase_identifier))
(block_expression
(statement_expression
(let_expression
(pattern
(simple_pattern
(lowercase_identifier)))
(expression
(simple_expression
(binary_expression
(expression
(simple_expression
(binary_expression
(expression
(simple_expression
(binary_expression
(expression
(simple_expression
(atomic_expression
(literal
(integer_literal)))))
(expression
(simple_expression
(atomic_expression
(literal
(integer_literal))))))))
(expression
(simple_expression
(binary_expression
(expression
(simple_expression
(atomic_expression
(literal
(integer_literal)))))
(expression
(simple_expression
(atomic_expression
(literal
(integer_literal)))))))))))
(expression
(simple_expression
(atomic_expression
(literal
(integer_literal))))))))))))))

0 comments on commit b7fec74

Please sign in to comment.