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-12-02 03:54:25 +00:00
|
|
|
<fn -> 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
|
2023-12-02 03:54:25 +00:00
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(function
|
|
|
|
(type_definition
|
|
|
|
(type
|
|
|
|
(type)))
|
|
|
|
(block
|
|
|
|
(statement
|
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(string))))))))))
|
|
|
|
|
|
|
|
================================================================================
|
|
|
|
Function Assignment
|
|
|
|
================================================================================
|
|
|
|
|
|
|
|
foobar = <fn -> str> |text| { text }
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
(root
|
|
|
|
(statement
|
|
|
|
(assignment
|
2023-11-11 01:44:03 +00:00
|
|
|
(identifier)
|
2023-12-02 03:54:25 +00:00
|
|
|
(assignment_operator)
|
|
|
|
(statement
|
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(function
|
|
|
|
(type_definition
|
|
|
|
(type
|
|
|
|
(type)))
|
|
|
|
(identifier)
|
|
|
|
(block
|
|
|
|
(statement
|
|
|
|
(expression
|
|
|
|
(identifier)))))))))))
|
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-12-02 07:34:23 +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-12-02 03:54:25 +00:00
|
|
|
<fn str num> |message number| {
|
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
|
2023-12-02 03:54:25 +00:00
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(function
|
|
|
|
(type_definition
|
|
|
|
(type
|
|
|
|
(type)
|
|
|
|
(type)))
|
|
|
|
(identifier)
|
|
|
|
(identifier)
|
|
|
|
(block
|
|
|
|
(statement
|
|
|
|
(expression
|
|
|
|
(function_call
|
2023-12-02 07:34:23 +00:00
|
|
|
(expression
|
|
|
|
(identifier))
|
2023-12-02 03:54:25 +00:00
|
|
|
(expression
|
|
|
|
(identifier)))))
|
|
|
|
(statement
|
|
|
|
(expression
|
|
|
|
(function_call
|
2023-12-02 07:34:23 +00:00
|
|
|
(expression
|
|
|
|
(identifier))
|
2023-12-02 03:54:25 +00:00
|
|
|
(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-28 16:01:38 +00:00
|
|
|
{
|
2023-10-18 21:52:56 +00:00
|
|
|
x = 1
|
|
|
|
y = 2
|
2023-11-28 16:01:38 +00:00
|
|
|
}
|
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
|
|
|
|
(function_call
|
2023-12-02 07:34:23 +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)))))))))))
|