2023-10-31 19:21:13 +00:00
|
|
|
================================================================================
|
2023-10-18 21:52:56 +00:00
|
|
|
Simple Function
|
2023-10-31 19:21:13 +00:00
|
|
|
================================================================================
|
2023-10-18 21:52:56 +00:00
|
|
|
|
2023-11-27 20:02:08 +00:00
|
|
|
|| <str> { "Hiya" }
|
2023-10-18 21:52:56 +00:00
|
|
|
|
2023-10-31 19:21:13 +00:00
|
|
|
--------------------------------------------------------------------------------
|
2023-10-18 21:52:56 +00:00
|
|
|
|
|
|
|
(root
|
2023-11-11 01:44:03 +00:00
|
|
|
(statement
|
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(function
|
2023-11-27 20:02:08 +00:00
|
|
|
(type)
|
2023-11-11 01:44:03 +00:00
|
|
|
(block
|
|
|
|
(statement
|
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(string))))))))))
|
2023-10-31 19:21:13 +00:00
|
|
|
|
2023-10-31 22:18:39 +00:00
|
|
|
================================================================================
|
|
|
|
Function Assignment
|
|
|
|
================================================================================
|
|
|
|
|
2023-11-27 20:02:08 +00:00
|
|
|
x = || <str> { "Hiya" }
|
2023-10-31 22:18:39 +00:00
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
(root
|
2023-11-11 01:44:03 +00:00
|
|
|
(statement
|
|
|
|
(assignment
|
|
|
|
(identifier)
|
|
|
|
(assignment_operator)
|
|
|
|
(statement
|
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(function
|
2023-11-27 20:02:08 +00:00
|
|
|
(type)
|
2023-11-11 01:44:03 +00:00
|
|
|
(block
|
|
|
|
(statement
|
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(string))))))))))))
|
2023-10-31 22:18:39 +00:00
|
|
|
|
2023-10-31 19:21:13 +00:00
|
|
|
================================================================================
|
2023-10-18 21:52:56 +00:00
|
|
|
Function Call
|
2023-10-31 19:21:13 +00:00
|
|
|
================================================================================
|
2023-10-18 21:52:56 +00:00
|
|
|
|
|
|
|
(foobar "Hiya")
|
|
|
|
|
2023-10-31 19:21:13 +00:00
|
|
|
--------------------------------------------------------------------------------
|
2023-10-18 21:52:56 +00:00
|
|
|
|
|
|
|
(root
|
2023-11-11 01:44:03 +00:00
|
|
|
(statement
|
|
|
|
(expression
|
|
|
|
(function_call
|
2023-11-18 01:10:07 +00:00
|
|
|
(expression
|
|
|
|
(identifier))
|
2023-11-11 01:44:03 +00:00
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(string)))))))
|
2023-10-18 21:52:56 +00:00
|
|
|
|
2023-10-31 19:21:13 +00:00
|
|
|
================================================================================
|
2023-10-18 21:52:56 +00:00
|
|
|
Complex Function
|
2023-10-31 19:21:13 +00:00
|
|
|
================================================================================
|
2023-10-18 21:52:56 +00:00
|
|
|
|
2023-11-27 20:02:08 +00:00
|
|
|
|message <str> number <int>| {
|
2023-10-18 21:52:56 +00:00
|
|
|
(output message)
|
|
|
|
(output number)
|
|
|
|
}
|
|
|
|
|
2023-10-31 19:21:13 +00:00
|
|
|
--------------------------------------------------------------------------------
|
2023-10-18 21:52:56 +00:00
|
|
|
|
|
|
|
(root
|
2023-11-11 01:44:03 +00:00
|
|
|
(statement
|
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(function
|
2023-11-28 15:29:42 +00:00
|
|
|
(parameter
|
|
|
|
(identifier)
|
|
|
|
(type))
|
|
|
|
(parameter
|
|
|
|
(identifier)
|
|
|
|
(type))
|
2023-11-11 01:44:03 +00:00
|
|
|
(block
|
|
|
|
(statement
|
|
|
|
(expression
|
|
|
|
(function_call
|
|
|
|
(built_in_function
|
|
|
|
(expression
|
|
|
|
(identifier))))))
|
|
|
|
(statement
|
|
|
|
(expression
|
|
|
|
(function_call
|
|
|
|
(built_in_function
|
|
|
|
(expression
|
|
|
|
(identifier))))))))))))
|
2023-10-18 21:52:56 +00:00
|
|
|
|
2023-10-31 19:21:13 +00:00
|
|
|
================================================================================
|
2023-10-18 21:52:56 +00:00
|
|
|
Complex Function Call
|
2023-10-31 19:21:13 +00:00
|
|
|
================================================================================
|
2023-10-18 21:52:56 +00:00
|
|
|
|
|
|
|
(foobar
|
|
|
|
"hi"
|
|
|
|
42
|
2023-11-04 01:16:55 +00:00
|
|
|
map {
|
2023-10-18 21:52:56 +00:00
|
|
|
x = 1
|
|
|
|
y = 2
|
|
|
|
}
|
|
|
|
)
|
|
|
|
|
2023-10-31 19:21:13 +00:00
|
|
|
--------------------------------------------------------------------------------
|
2023-10-18 21:52:56 +00:00
|
|
|
|
|
|
|
(root
|
2023-11-11 01:44:03 +00:00
|
|
|
(statement
|
|
|
|
(expression
|
|
|
|
(function_call
|
2023-11-18 01:10:07 +00:00
|
|
|
(expression
|
|
|
|
(identifier))
|
2023-11-11 01:44:03 +00:00
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(string)))
|
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(integer)))
|
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(map
|
|
|
|
(identifier)
|
|
|
|
(statement
|
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(integer))))
|
|
|
|
(identifier)
|
|
|
|
(statement
|
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(integer)))))))))))
|