Add list expressions
This commit is contained in:
parent
f548b1d5ad
commit
e13f15e8db
5 changed files with 734 additions and 193 deletions
|
|
@ -71,3 +71,118 @@ foo = `Hello\nWorld!`
|
|||
(assignment
|
||||
(identifier)
|
||||
(raw_string_literal)))
|
||||
|
||||
================================================================================
|
||||
List (empty)
|
||||
================================================================================
|
||||
|
||||
foo = []
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
(source_file
|
||||
(assignment
|
||||
(identifier)
|
||||
(list_expression)))
|
||||
|
||||
================================================================================
|
||||
List (singleton)
|
||||
================================================================================
|
||||
|
||||
foo = [42]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
(source_file
|
||||
(assignment
|
||||
(identifier)
|
||||
(list_expression
|
||||
(integer_literal))))
|
||||
|
||||
================================================================================
|
||||
List (singleton multiline)
|
||||
================================================================================
|
||||
|
||||
foo = [
|
||||
42
|
||||
]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
(source_file
|
||||
(assignment
|
||||
(identifier)
|
||||
(list_expression
|
||||
(integer_literal))))
|
||||
|
||||
================================================================================
|
||||
List (singleton trailing comma)
|
||||
================================================================================
|
||||
|
||||
foo = [
|
||||
42,
|
||||
]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
(source_file
|
||||
(assignment
|
||||
(identifier)
|
||||
(list_expression
|
||||
(integer_literal))))
|
||||
|
||||
================================================================================
|
||||
List (mixed values)
|
||||
================================================================================
|
||||
|
||||
foo = [
|
||||
42,
|
||||
"foobar",
|
||||
]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
(source_file
|
||||
(assignment
|
||||
(identifier)
|
||||
(list_expression
|
||||
(integer_literal)
|
||||
(interpreted_string_literal))))
|
||||
|
||||
================================================================================
|
||||
List (list of list)
|
||||
================================================================================
|
||||
|
||||
foo = [
|
||||
[42],
|
||||
["foobar"],
|
||||
[],
|
||||
]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
(source_file
|
||||
(assignment
|
||||
(identifier)
|
||||
(list_expression
|
||||
(list_expression
|
||||
(integer_literal))
|
||||
(list_expression
|
||||
(interpreted_string_literal))
|
||||
(list_expression))))
|
||||
|
||||
================================================================================
|
||||
List (rogue comma)
|
||||
================================================================================
|
||||
|
||||
foo = [
|
||||
,
|
||||
]
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
(source_file
|
||||
(assignment
|
||||
(identifier)
|
||||
(list_expression
|
||||
(ERROR))))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue