more tests; add function expressions

This commit is contained in:
mhoffm
2021-06-11 23:32:22 +02:00
parent 08ce0c6653
commit 2226687dd7
8 changed files with 2413 additions and 1683 deletions

86
test/corpus/splat.txt Normal file
View File

@@ -0,0 +1,86 @@
==================
get attr
==================
foo = bar.baz
---
(config_file
(body
(attribute
(identifier)
(expression
(expr_term
(expr_term
(variable_expr
(identifier)))
(get_attr
(identifier)))))))
==================
get index
==================
foo = bar[1]
---
(config_file
(body
(attribute
(identifier)
(expression
(expr_term
(expr_term
(variable_expr
(identifier)))
(index
(expression
(expr_term
(literal_value
(numeric_lit))))))))))
==================
attr splat
==================
foo = bar.*.foo
---
(config_file
(body
(attribute
(identifier)
(expression
(expr_term
(expr_term
(variable_expr
(identifier)))
(splat
(attr_splat
(get_attr
(identifier)))))))))
==================
full splat
==================
foo = bar[*].foo
---
(config_file
(body
(attribute
(identifier)
(expression
(expr_term
(expr_term
(variable_expr
(identifier)))
(splat
(full_splat
(get_attr
(identifier)))))))))