Add function declarations
This commit is contained in:
parent
3eb6b0a0d0
commit
e898312c95
5 changed files with 3466 additions and 2499 deletions
|
|
@ -6,6 +6,67 @@ Empty declarations
|
|||
|
||||
(source_file)
|
||||
|
||||
================================================================================
|
||||
Function declaration
|
||||
================================================================================
|
||||
|
||||
function func(a: int, b: int) = "string"
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
(source_file
|
||||
(function_declaration
|
||||
name: (identifier)
|
||||
parameters: (parameters
|
||||
name: (identifier)
|
||||
type: (identifier)
|
||||
name: (identifier)
|
||||
type: (identifier))
|
||||
body: (string_literal)))
|
||||
|
||||
================================================================================
|
||||
Function declaration single parameter
|
||||
================================================================================
|
||||
|
||||
function func(a: int) = "string"
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
(source_file
|
||||
(function_declaration
|
||||
name: (identifier)
|
||||
parameters: (parameters
|
||||
name: (identifier)
|
||||
type: (identifier))
|
||||
body: (string_literal)))
|
||||
|
||||
================================================================================
|
||||
Function declaration no parameters
|
||||
================================================================================
|
||||
|
||||
function func() = "string"
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
(source_file
|
||||
(function_declaration
|
||||
name: (identifier)
|
||||
parameters: (parameters)
|
||||
body: (string_literal)))
|
||||
|
||||
================================================================================
|
||||
Primitive declaration
|
||||
================================================================================
|
||||
|
||||
primitive prim()
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
(source_file
|
||||
(primitive_declaration
|
||||
name: (identifier)
|
||||
parameters: (parameters)))
|
||||
|
||||
================================================================================
|
||||
Variable declaration
|
||||
================================================================================
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue