aboutsummaryrefslogtreecommitdiff
path: root/tools/tree-sitter/test/corpus/const_negation.txt
blob: 89e801ca8d9b43921540912e5c940a576201e01c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
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)))))))