Compare commits
2 Commits
d4aac2c729
...
1d6b49ba25
Author | SHA1 | Date | |
---|---|---|---|
1d6b49ba25 | |||
60013f34da |
@ -3,7 +3,7 @@ name = "dust-lang"
|
||||
description = "Data-Oriented Programming Language"
|
||||
version = "0.3.5"
|
||||
repository = "https://github.com/tree-sitter/tree-sitter-dust"
|
||||
edition = "2018"
|
||||
edition = "2021"
|
||||
license = "MIT"
|
||||
|
||||
[[bin]]
|
||||
|
15
tree-sitter-dust/corpus/yield.txt
Normal file
15
tree-sitter-dust/corpus/yield.txt
Normal file
@ -0,0 +1,15 @@
|
||||
================================================================================
|
||||
Simple Yield
|
||||
================================================================================
|
||||
|
||||
1 -> (output)
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
================================================================================
|
||||
Yield Chain
|
||||
================================================================================
|
||||
|
||||
x -> (foo) -> (bar) -> (abc)
|
||||
|
||||
--------------------------------------------------------------------------------
|
@ -41,6 +41,12 @@ module.exports = grammar({
|
||||
),
|
||||
optional(';'),
|
||||
)),
|
||||
|
||||
yield: $ => prec.left(seq(
|
||||
$.expression,
|
||||
'->',
|
||||
$.function_call,
|
||||
)),
|
||||
|
||||
expression: $ => prec.right(choice(
|
||||
$._expression_kind,
|
||||
@ -54,6 +60,7 @@ module.exports = grammar({
|
||||
$.logic,
|
||||
$.math,
|
||||
$.value,
|
||||
$.yield,
|
||||
),
|
||||
|
||||
_expression_list: $ => repeat1(prec.right(seq(
|
||||
|
@ -135,6 +135,27 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
"yield": {
|
||||
"type": "PREC_LEFT",
|
||||
"value": 0,
|
||||
"content": {
|
||||
"type": "SEQ",
|
||||
"members": [
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "expression"
|
||||
},
|
||||
{
|
||||
"type": "STRING",
|
||||
"value": "->"
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "function_call"
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
"expression": {
|
||||
"type": "PREC_RIGHT",
|
||||
"value": 0,
|
||||
@ -191,6 +212,10 @@
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "value"
|
||||
},
|
||||
{
|
||||
"type": "SYMBOL",
|
||||
"name": "yield"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
@ -127,6 +127,10 @@
|
||||
{
|
||||
"type": "value",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "yield",
|
||||
"named": true
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -746,6 +750,25 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "yield",
|
||||
"named": true,
|
||||
"fields": {},
|
||||
"children": {
|
||||
"multiple": true,
|
||||
"required": true,
|
||||
"types": [
|
||||
{
|
||||
"type": "expression",
|
||||
"named": true
|
||||
},
|
||||
{
|
||||
"type": "function_call",
|
||||
"named": true
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "!=",
|
||||
"named": false
|
||||
@ -790,6 +813,10 @@
|
||||
"type": "-=",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": "->",
|
||||
"named": false
|
||||
},
|
||||
{
|
||||
"type": "..",
|
||||
"named": false
|
||||
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user