diff --git a/corpus/lists.txt b/corpus/lists.txt new file mode 100644 index 0000000..7509f8a --- /dev/null +++ b/corpus/lists.txt @@ -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))))))))))))))) \ No newline at end of file