tree-sitter-tiger/test/corpus/declarations.txt

79 lines
2.2 KiB
Plaintext
Raw Normal View History

2022-06-01 20:37:24 +02:00
================================================================================
Empty declarations
================================================================================
--------------------------------------------------------------------------------
(source_file)
2022-06-01 20:41:25 +02:00
================================================================================
Variable declaration
================================================================================
var a := 12
--------------------------------------------------------------------------------
(source_file
(variable_declaration
name: (identifier)
value: (integer_literal)))
================================================================================
Variable declaration with type
================================================================================
var a : int := 27
--------------------------------------------------------------------------------
(source_file
(variable_declaration
name: (identifier)
type: (identifier)
value: (integer_literal)))
================================================================================
Multiple variable declarations
================================================================================
var a := 12
var b := 27
--------------------------------------------------------------------------------
(source_file
(variable_declaration
name: (identifier)
value: (integer_literal))
(variable_declaration
name: (identifier)
value: (integer_literal)))
2022-06-01 20:37:24 +02:00
================================================================================
Import
================================================================================
import "a.tih"
--------------------------------------------------------------------------------
(source_file
(import_declaration
file: (string_literal)))
================================================================================
Multiple imports
================================================================================
import "a.tih"
import "b.tih"
--------------------------------------------------------------------------------
(source_file
(import_declaration
file: (string_literal))
(import_declaration
file: (string_literal)))