Add list tests
This commit is contained in:
parent
6774f83879
commit
07340a4fe3
155
corpus/lists.txt
Normal file
155
corpus/lists.txt
Normal file
@ -0,0 +1,155 @@
|
||||
==================
|
||||
List Declaration
|
||||
==================
|
||||
|
||||
['answer', 42]
|
||||
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(open_statement
|
||||
(expression
|
||||
(value
|
||||
(list
|
||||
(value
|
||||
(string))
|
||||
(value
|
||||
(integer)))))))))
|
||||
|
||||
==================
|
||||
List Assignment
|
||||
==================
|
||||
|
||||
foobar = ['answer', 42]
|
||||
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(open_statement
|
||||
(expression
|
||||
(operation
|
||||
(expression
|
||||
(identifier))
|
||||
(operator)
|
||||
(expression
|
||||
(value
|
||||
(list
|
||||
(value
|
||||
(string))
|
||||
(value
|
||||
(integer)))))))))))
|
||||
|
||||
==================
|
||||
List Access
|
||||
==================
|
||||
|
||||
foobar = ['answer', 42]
|
||||
the_answer = foobar.1
|
||||
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(open_statement
|
||||
(expression
|
||||
(operation
|
||||
(expression
|
||||
(identifier))
|
||||
(operator)
|
||||
(expression
|
||||
(value
|
||||
(list
|
||||
(value
|
||||
(string))
|
||||
(value
|
||||
(integer))))))))))
|
||||
(item
|
||||
(statement
|
||||
(open_statement
|
||||
(expression
|
||||
(identifier)))))
|
||||
(item
|
||||
(statement
|
||||
(open_statement
|
||||
(expression
|
||||
(operation
|
||||
(expression
|
||||
(value
|
||||
(integer)))
|
||||
(operator)
|
||||
(expression
|
||||
(value
|
||||
(integer)))))))))
|
||||
|
||||
==================
|
||||
List Mutation
|
||||
==================
|
||||
|
||||
foobar = ['answer', 42]
|
||||
foobar += 'hiya'
|
||||
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(open_statement
|
||||
(expression
|
||||
(operation
|
||||
(expression
|
||||
(identifier))
|
||||
(operator)
|
||||
(expression
|
||||
(value
|
||||
(list
|
||||
(value
|
||||
(string))
|
||||
(value
|
||||
(integer))))))))))
|
||||
(item
|
||||
(statement
|
||||
(open_statement
|
||||
(expression
|
||||
(operation
|
||||
(expression
|
||||
(identifier))
|
||||
(operator)
|
||||
(expression
|
||||
(value
|
||||
(string)))))))))
|
||||
|
||||
==================
|
||||
List Nesting
|
||||
==================
|
||||
|
||||
foobar = ['answers', [42, [666]]]
|
||||
|
||||
---
|
||||
|
||||
(root
|
||||
(item
|
||||
(statement
|
||||
(open_statement
|
||||
(expression
|
||||
(operation
|
||||
(expression
|
||||
(identifier))
|
||||
(operator)
|
||||
(expression
|
||||
(value
|
||||
(list
|
||||
(value
|
||||
(string))
|
||||
(value
|
||||
(list
|
||||
(value
|
||||
(integer))
|
||||
(value
|
||||
(list
|
||||
(value
|
||||
(integer)))))))))))))))
|
Loading…
Reference in New Issue
Block a user