aboutsummaryrefslogtreecommitdiff
path: root/tools/tree-sitter/test/corpus/const_negation.txt
diff options
context:
space:
mode:
Diffstat (limited to 'tools/tree-sitter/test/corpus/const_negation.txt')
-rw-r--r--tools/tree-sitter/test/corpus/const_negation.txt49
1 files changed, 49 insertions, 0 deletions
diff --git a/tools/tree-sitter/test/corpus/const_negation.txt b/tools/tree-sitter/test/corpus/const_negation.txt
new file mode 100644
index 0000000..89e801c
--- /dev/null
+++ b/tools/tree-sitter/test/corpus/const_negation.txt
@@ -0,0 +1,49 @@
+==================
+const_negation
+==================
+
+program()
+var
+ x: const Int := -5
+ y: const Int := -x
+
+begin
+ assert(x = -5);
+ assert(y = 5);
+end.
+
+---
+
+(source_file
+ (program_declaration
+ (var_section
+ (variable_declaration
+ (identifier_definition
+ (identifier))
+ (const_type
+ (identifier))
+ (unary_expression
+ (literal
+ (integer))))
+ (variable_declaration
+ (identifier_definition
+ (identifier))
+ (const_type
+ (identifier))
+ (unary_expression
+ (identifier))))
+ (call_expression
+ (identifier)
+ (argument_list
+ (binary_expression
+ (identifier)
+ (unary_expression
+ (literal
+ (integer))))))
+ (call_expression
+ (identifier)
+ (argument_list
+ (binary_expression
+ (identifier)
+ (literal
+ (integer)))))))