1
0
dust/tree-sitter-dust/corpus/logic.txt

200 lines
5.1 KiB
Plaintext
Raw Normal View History

================================================================================
Simple Logic
================================================================================
true && false
--------------------------------------------------------------------------------
(root
(statement
(expression
(logic
(expression
(value
(boolean)))
(logic_operator)
(expression
(value
(boolean)))))))
================================================================================
Logic Sequence
================================================================================
1 == 2 || false
--------------------------------------------------------------------------------
(root
(statement
(expression
(logic
(expression
(logic
(expression
(value
(integer)))
(logic_operator)
(expression
(value
(integer)))))
(logic_operator)
(expression
(value
(boolean)))))))
================================================================================
Complex Logic Sequence
================================================================================
(length(suspects) == 1)
&& (length(rooms) == 1)
&& (length(weapons) == 1)
--------------------------------------------------------------------------------
(root
(statement
(expression
(logic
(expression
(logic
(expression
(logic
(expression
(function_call
(function_expression
(identifier
(built_in_function)))
(expression
(identifier))))
(logic_operator)
(expression
(value
(integer)))))
(logic_operator)
(expression
(logic
(expression
(function_call
(function_expression
(identifier
(built_in_function)))
(expression
(identifier))))
(logic_operator)
(expression
(value
(integer)))))))
(logic_operator)
(expression
(logic
(expression
(function_call
(function_expression
(identifier
(built_in_function)))
(expression
(identifier))))
(logic_operator)
(expression
(value
(integer)))))))))
================================================================================
\==
================================================================================
3 == 1 + 1 + 1
--------------------------------------------------------------------------------
(root
(statement
(expression
(math
(expression
(math
(expression
(logic
(expression
(value
(integer)))
(logic_operator)
(expression
(value
(integer)))))
(math_operator)
(expression
(value
(integer)))))
(math_operator)
(expression
(value
(integer)))))))
================================================================================
&&
================================================================================
4 + 2 == 42 && true
--------------------------------------------------------------------------------
(root
(statement
(expression
(logic
(expression
(logic
(expression
(math
(expression
(value
(integer)))
(math_operator)
(expression
(value
(integer)))))
(logic_operator)
(expression
(value
(integer)))))
(logic_operator)
(expression
(value
(boolean)))))))
================================================================================
\||
================================================================================
4 + 2 == 42 || true
--------------------------------------------------------------------------------
(root
(statement
(expression
(logic
(expression
(logic
(expression
(math
(expression
(value
(integer)))
(math_operator)
(expression
(value
(integer)))))
(logic_operator)
(expression
(value
(integer)))))
(logic_operator)
(expression
(value
(boolean)))))))