2022-06-01 19:48:54 +02:00
|
|
|
================================================================================
|
|
|
|
Array expression
|
|
|
|
================================================================================
|
|
|
|
|
|
|
|
array_of_int[42] of 0
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
(source_file
|
|
|
|
(array_expression
|
2022-06-03 10:15:37 +02:00
|
|
|
type: (type_identifier)
|
2022-06-01 19:48:54 +02:00
|
|
|
size: (integer_literal)
|
|
|
|
init: (integer_literal)))
|
|
|
|
|
|
|
|
================================================================================
|
|
|
|
Array associativity
|
|
|
|
================================================================================
|
|
|
|
|
|
|
|
array_of_array_of_int[12] of array_of_int[27] of 0
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
(source_file
|
|
|
|
(array_expression
|
2022-06-03 10:15:37 +02:00
|
|
|
type: (type_identifier)
|
2022-06-01 19:48:54 +02:00
|
|
|
size: (integer_literal)
|
|
|
|
init: (array_expression
|
2022-06-03 10:15:37 +02:00
|
|
|
type: (type_identifier)
|
2022-06-01 19:48:54 +02:00
|
|
|
size: (integer_literal)
|
|
|
|
init: (integer_literal))))
|
2022-06-01 19:54:09 +02:00
|
|
|
|
|
|
|
================================================================================
|
|
|
|
Record expression
|
|
|
|
================================================================================
|
|
|
|
|
|
|
|
record_type { a = 12, b = "27" }
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
(source_file
|
|
|
|
(record_expression
|
2022-06-03 10:15:37 +02:00
|
|
|
type: (type_identifier)
|
2022-06-03 10:31:30 +02:00
|
|
|
field: (field_identifier)
|
2022-06-01 19:54:09 +02:00
|
|
|
init: (integer_literal)
|
2022-06-03 10:31:30 +02:00
|
|
|
field: (field_identifier)
|
2022-06-01 19:54:09 +02:00
|
|
|
init: (string_literal)))
|
|
|
|
|
|
|
|
================================================================================
|
|
|
|
Record expression single field
|
|
|
|
================================================================================
|
|
|
|
|
|
|
|
record_type { a = 12 }
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
(source_file
|
|
|
|
(record_expression
|
2022-06-03 10:15:37 +02:00
|
|
|
type: (type_identifier)
|
2022-06-03 10:31:30 +02:00
|
|
|
field: (field_identifier)
|
2022-06-01 19:54:09 +02:00
|
|
|
init: (integer_literal)))
|
|
|
|
|
|
|
|
================================================================================
|
|
|
|
Record expression no fields
|
|
|
|
================================================================================
|
|
|
|
|
|
|
|
record_type {}
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
(source_file
|
|
|
|
(record_expression
|
2022-06-03 10:15:37 +02:00
|
|
|
type: (type_identifier)))
|
2022-06-01 19:54:09 +02:00
|
|
|
|
|
|
|
================================================================================
|
|
|
|
Record expression trailing comma
|
|
|
|
================================================================================
|
|
|
|
|
|
|
|
record_type { a = 12, }
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
(source_file
|
|
|
|
(record_expression
|
2022-06-03 10:15:37 +02:00
|
|
|
type: (type_identifier)
|
2022-06-03 10:31:30 +02:00
|
|
|
field: (field_identifier)
|
2022-06-01 19:54:09 +02:00
|
|
|
init: (integer_literal)
|
|
|
|
(ERROR)))
|
2022-06-01 19:58:40 +02:00
|
|
|
|
|
|
|
================================================================================
|
|
|
|
Function call
|
|
|
|
================================================================================
|
|
|
|
|
|
|
|
f(12, "27")
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
(source_file
|
|
|
|
(function_call
|
|
|
|
function: (identifier)
|
|
|
|
arguments: (integer_literal)
|
|
|
|
arguments: (string_literal)))
|
|
|
|
|
|
|
|
================================================================================
|
|
|
|
Function call single argument
|
|
|
|
================================================================================
|
|
|
|
|
|
|
|
f(12)
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
(source_file
|
|
|
|
(function_call
|
|
|
|
function: (identifier)
|
|
|
|
arguments: (integer_literal)))
|
|
|
|
|
|
|
|
================================================================================
|
|
|
|
Function call no arguments
|
|
|
|
================================================================================
|
|
|
|
|
|
|
|
f()
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
(source_file
|
|
|
|
(function_call
|
|
|
|
function: (identifier)))
|
|
|
|
|
|
|
|
================================================================================
|
|
|
|
Function call trailing comma
|
|
|
|
================================================================================
|
|
|
|
|
|
|
|
f(12,)
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
(source_file
|
|
|
|
(function_call
|
|
|
|
function: (identifier)
|
|
|
|
arguments: (integer_literal)
|
|
|
|
(ERROR)))
|
2022-06-01 20:11:52 +02:00
|
|
|
|
|
|
|
================================================================================
|
|
|
|
Assignments
|
|
|
|
================================================================================
|
|
|
|
|
|
|
|
a := array[12] := record.field
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
(source_file
|
|
|
|
(assignment_expression
|
|
|
|
left: (identifier)
|
2022-06-03 11:42:57 +02:00
|
|
|
(operator)
|
2022-06-01 20:11:52 +02:00
|
|
|
right: (assignment_expression
|
|
|
|
left: (array_value
|
|
|
|
array: (identifier)
|
|
|
|
index: (integer_literal))
|
2022-06-03 11:42:57 +02:00
|
|
|
(operator)
|
2022-06-01 20:11:52 +02:00
|
|
|
right: (record_value
|
|
|
|
record: (identifier)
|
2022-06-03 10:31:30 +02:00
|
|
|
field: (field_identifier)))))
|