From abd8f92864e2ecbf907c3587d65b940d77fa82cb Mon Sep 17 00:00:00 2001 From: Aymeric Wibo Date: Mon, 30 Sep 2024 17:34:40 +0200 Subject: [PATCH] tests: Test a bunch of non-obvious multiline situations (will try to expand this as much as possible) --- test/corpus/mutliline.txt | 109 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 test/corpus/mutliline.txt diff --git a/test/corpus/mutliline.txt b/test/corpus/mutliline.txt new file mode 100644 index 0000000..f99ff93 --- /dev/null +++ b/test/corpus/mutliline.txt @@ -0,0 +1,109 @@ +=== +Multiline tests +=== + +[ + 1, + 2, + 3, +] + +fn params_over_multiple_lines( + param1, + param2, + param3, +) { +} + +{ print "inside block" } print "outside block" +print "outside block" { print "inside block" } + +return; return pure fn test {} + +--- + +(source_file + (statement + (expression + (vec + (expression + (literal + (number) + ) + ) + (expression + (literal + (number) + ) + ) + (expression + (literal + (number) + ) + ) + ) + ) + ) + (function_declaration + name: (identifier) + params: (param_list + (param ident: (identifier)) + (param ident: (identifier)) + (param ident: (identifier)) + ) + body: (block) + ) + (block + body: (statement + (print + msg: (expression + (literal + (string) + ) + ) + ) + ) + ) + (statement + (print + msg: (expression + (literal + (string) + ) + ) + ) + ) + (statement + (print + msg: (expression + (literal + (string) + ) + ) + ) + ) + (block + body: (statement + (print + msg: (expression + (literal + (string) + ) + ) + ) + ) + ) + (statement + (return) + ) + (statement + (return) + ) + (function_declaration + qualifiers: (qualifier_list + (qualifier) + ) + name: (identifier) + body: (block) + ) +)