tree-sitter-dust/corpus/match.txt

171 lines
3.2 KiB
Plaintext
Raw Normal View History

2023-10-06 10:18:02 +00:00
==================
2023-10-06 17:32:49 +00:00
If
2023-10-06 10:18:02 +00:00
==================
2023-10-06 17:32:49 +00:00
if true then "True"
2023-10-06 10:18:02 +00:00
---
(root
(item
(statement
2023-10-06 17:32:49 +00:00
(if_else
2023-10-06 10:18:02 +00:00
(expression
2023-10-06 17:32:49 +00:00
(value
(boolean)))
(statement
(expression
(value
(string))))))))
==================
If Assignment
==================
x = if true then 1
---
(root
(item
(statement
(assignment
(identifier)
(statement
(if_else
(expression
(value
(boolean)))
(statement
(expression
(value
(integer))))))))))
==================
If Else
==================
if false then "True" else "False"
---
(root
(item
(statement
(if_else
(expression
(value
(boolean)))
(statement
(expression
(value
(string))))
(statement
(expression
(value
(string))))))))
==================
If Else If
==================
if 1 == 1
then "math is fun"
else if 4 == 9
then "math is broken"
---
(root
(item
(statement
(if_else
(expression
(logic
2023-10-06 10:18:02 +00:00
(expression
(value
(integer)))
2023-10-06 17:32:49 +00:00
(logic_operator)
2023-10-06 10:18:02 +00:00
(expression
(value
(integer)))))
(statement
(expression
(value
2023-10-06 17:32:49 +00:00
(string))))
(statement
(if_else
(expression
(logic
(expression
(value
(integer)))
(logic_operator)
(expression
(value
(integer)))))
(statement
(expression
(value
(string))))))))))
==================
If Else Else If Else
==================
if false
then "no"
else if false
then "no"
else if 1 + 1 == 9
then "not the answer"
else "42"
---
(root
(item
(statement
(if_else
(expression
(value
(boolean)))
2023-10-06 10:18:02 +00:00
(statement
(expression
(value
2023-10-06 17:32:49 +00:00
(string))))
(statement
(if_else
(expression
(value
(boolean)))
(statement
(expression
(value
(string))))
(statement
(if_else
(expression
(logic
(expression
(math
(expression
(value
(integer)))
(math_operator)
(expression
(value
(integer)))))
(logic_operator)
(expression
(value
(integer)))))
(statement
(expression
(value
(string))))
(statement
(expression
(value
(string))))))))))))