From 54f6fb3c7b5ec0e5a00cd88c7813a56b4c03d1a4 Mon Sep 17 00:00:00 2001 From: mhoffm Date: Sat, 12 Jun 2021 22:47:25 +0200 Subject: [PATCH] tests --- test/corpus/literals.txt | 64 +++++++++++++++------------------------- 1 file changed, 24 insertions(+), 40 deletions(-) diff --git a/test/corpus/literals.txt b/test/corpus/literals.txt index d0d20b9..d819571 100644 --- a/test/corpus/literals.txt +++ b/test/corpus/literals.txt @@ -10,10 +10,7 @@ pi = 3 (body (attribute (identifier) - (expression - (expr_term - (literal_value - (numeric_lit))))))) + (expression (expr_term (literal_value (numeric_lit))))))) ================== numeric literal scientific notation 2 @@ -27,10 +24,7 @@ pi = 3.14 (body (attribute (identifier) - (expression - (expr_term - (literal_value - (numeric_lit))))))) + (expression (expr_term (literal_value (numeric_lit))))))) ================== numeric literal scientific notation 3 @@ -44,10 +38,7 @@ big_pi = 3.14e+10 (body (attribute (identifier) - (expression - (expr_term - (literal_value - (numeric_lit))))))) + (expression (expr_term (literal_value (numeric_lit))))))) ================== numeric literal scientific notation 4 @@ -61,10 +52,7 @@ big_pi = 3.14E+10 (body (attribute (identifier) - (expression - (expr_term - (literal_value - (numeric_lit))))))) + (expression (expr_term (literal_value (numeric_lit))))))) ================== numeric literal scientific notation 5 @@ -78,10 +66,7 @@ small_pi = 3.14e-10 (body (attribute (identifier) - (expression - (expr_term - (literal_value - (numeric_lit))))))) + (expression (expr_term (literal_value (numeric_lit))))))) ================== @@ -96,10 +81,7 @@ small_pi = 3.14E-10 (body (attribute (identifier) - (expression - (expr_term - (literal_value - (numeric_lit))))))) + (expression (expr_term (literal_value (numeric_lit))))))) ================== bool literal true @@ -113,10 +95,7 @@ foo = true (body (attribute (identifier) - (expression - (expr_term - (literal_value - (bool_lit))))))) + (expression (expr_term (literal_value (bool_lit))))))) ================== bool literal false @@ -130,10 +109,7 @@ foo = false (body (attribute (identifier) - (expression - (expr_term - (literal_value - (bool_lit))))))) + (expression (expr_term (literal_value (bool_lit))))))) ================== null literal @@ -147,10 +123,7 @@ foo = null (body (attribute (identifier) - (expression - (expr_term - (literal_value - (null_lit))))))) + (expression (expr_term (literal_value (null_lit))))))) ================== string literal one line @@ -164,10 +137,7 @@ foo = "bar" (body (attribute (identifier) - (expression - (expr_term - (literal_value - (string_lit))))))) + (expression (expr_term (literal_value (string_lit))))))) ================== string literal escaped newline @@ -296,3 +266,17 @@ foo = "foo bar" (identifier) (expression (expr_term (literal_value (string_lit (ERROR (UNEXPECTED 'b'))))))))) +================== +string literal unescaped backslash +================== + +foo = "foo\bar" + +--- + +(config_file + (body + (attribute + (identifier) + (expression (expr_term (literal_value (string_lit (ERROR (UNEXPECTED 'b'))))))))) +