tree-sitter-dust/corpus/async.txt

170 lines
3.6 KiB
Plaintext
Raw Normal View History

2023-10-16 20:36:07 +00:00
==================
Simple Async Statements
==================
2023-10-16 20:47:43 +00:00
async { (output 'Whaddup') }
2023-10-16 20:36:07 +00:00
---
(root
(item
(statement
(async
2023-10-17 01:13:39 +00:00
(statement
(expression
(function_call
(tool)
(expression
(value
(string))))))))))
2023-10-16 20:36:07 +00:00
==================
2023-10-16 20:47:43 +00:00
Complex Async Statements
2023-10-16 20:36:07 +00:00
==================
2023-10-16 20:47:43 +00:00
async {
if 1 % 2 == 0 {
2023-10-17 01:13:39 +00:00
(output 'true')
2023-10-16 20:47:43 +00:00
} else {
(output 'false')
}
2023-10-16 20:36:07 +00:00
2023-10-16 20:47:43 +00:00
(output 'foobar')
}
2023-10-16 20:36:07 +00:00
---
(root
(item
(statement
(async
2023-10-17 01:13:39 +00:00
(statement
(if_else
(if
(expression
(logic
(expression
(math
(expression
(value
(integer)))
(math_operator)
(expression
(value
(integer)))))
(logic_operator)
(expression
(value
(integer)))))
(statement
(expression
(function_call
(tool)
(expression
(value
(string)))))))
(else
(statement
(expression
(function_call
(tool)
(expression
(value
(string)))))))))
(statement
(expression
(function_call
(tool)
(expression
(value
(string))))))))))
==================
Simple Async Await Statements
==================
x = async {
1
}
---
(root
(item
(statement
(assignment
(identifier)
(assignment_operator)
(statement
(async
(statement
(expression
(value
(integer))))))))))
==================
Complex Async Await Statements
==================
x = async {
i = 0
while i < 5 {
(output i)
i += 1
}
(read "examples/assets/faithful.csv")
}
---
(root
(item
(statement
(assignment
(identifier)
(assignment_operator)
(statement
(async
(statement
(assignment
(identifier)
(assignment_operator)
(statement
(expression
(value
(integer))))))
(statement
(while
2023-10-16 20:36:07 +00:00
(expression
(logic
(expression
2023-10-17 01:13:39 +00:00
(identifier))
2023-10-16 20:36:07 +00:00
(logic_operator)
(expression
(value
(integer)))))
2023-10-17 01:13:39 +00:00
(item
(statement
(expression
(function_call
(tool)
(expression
(identifier)))))
(statement
(assignment
(identifier)
(assignment_operator)
(statement
(expression
(value
(integer)))))))))
(statement
(expression
(function_call
(tool)
2023-10-16 20:36:07 +00:00
(expression
2023-10-17 01:13:39 +00:00
(value
(string))))))))))))