2024-02-13 14:19:23 +00:00
|
|
|
================================================================================
|
|
|
|
Simple As
|
|
|
|
================================================================================
|
|
|
|
|
|
|
|
1 as int
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
(root
|
|
|
|
(statement
|
2024-02-16 15:55:15 +00:00
|
|
|
(statement_kind
|
|
|
|
(expression
|
|
|
|
(as
|
|
|
|
(expression
|
|
|
|
(value
|
|
|
|
(integer)))
|
|
|
|
(type))))))
|
2024-02-13 14:19:23 +00:00
|
|
|
|
|
|
|
================================================================================
|
|
|
|
As Function
|
|
|
|
================================================================================
|
|
|
|
|
|
|
|
foo as (int) -> int
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
(root
|
|
|
|
(statement
|
2024-02-16 15:55:15 +00:00
|
|
|
(statement_kind
|
|
|
|
(expression
|
|
|
|
(as
|
|
|
|
(expression
|
|
|
|
(identifier))
|
|
|
|
(type
|
|
|
|
(type)
|
|
|
|
(type)))))))
|
2024-02-13 14:19:23 +00:00
|
|
|
|
|
|
|
================================================================================
|
|
|
|
As List in For Loop
|
|
|
|
================================================================================
|
|
|
|
|
2024-02-13 15:26:26 +00:00
|
|
|
for i in foobar as [string] {}
|
2024-02-13 14:19:23 +00:00
|
|
|
|
|
|
|
--------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
(root
|
|
|
|
(statement
|
2024-02-16 15:55:15 +00:00
|
|
|
(statement_kind
|
|
|
|
(for
|
|
|
|
(identifier)
|
|
|
|
(expression
|
|
|
|
(as
|
|
|
|
(expression
|
|
|
|
(identifier))
|
2024-02-13 15:26:26 +00:00
|
|
|
(type
|
2024-02-16 15:55:15 +00:00
|
|
|
(type
|
|
|
|
(identifier)))))
|
|
|
|
(block)))))
|