aboutsummaryrefslogtreecommitdiff
path: root/tools/tree-sitter/test/corpus/compile_time_array_length.txt
blob: 0e250f2102620540ebc9261952b4c61b80790261 (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
==================
compile_time_array_length
==================

module

var
  source: const [3]Int := [1, 2, 3]
  target: Word := source.length

end.

---

(source_file
  (module_declaration
    (var_section
      (variable_declaration
        (identifier_definition
          (identifier))
        (const_type
          (array_type
            (literal
              (integer))
            (identifier)))
        (array_constructor
          (literal
            (integer))
          (literal
            (integer))
          (literal
            (integer))))
      (variable_declaration
        (identifier_definition
          (identifier))
        (identifier)
        (field_expression
          (identifier)
          (identifier))))))