155 lines
2.8 KiB
Plaintext
155 lines
2.8 KiB
Plaintext
==================
|
|
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))))))))))))))) |