summaryrefslogtreecommitdiff
path: root/tests/quotes.l
diff options
context:
space:
mode:
Diffstat (limited to 'tests/quotes.l')
-rw-r--r--tests/quotes.l24
1 files changed, 22 insertions, 2 deletions
diff --git a/tests/quotes.l b/tests/quotes.l
index 62f4fb4..d1b97eb 100644
--- a/tests/quotes.l
+++ b/tests/quotes.l
@@ -67,19 +67,39 @@ static int foo (int i){
/* indented code [[[ 3 ]]] */
/* indented code [[[[ 4 ]]]] */
/* indented code ]] unmatched [[ */
+%{
+// non-indented code [ 1 ]
+// non-indented code [[ 2 ]]
+// non-indented code [[[ 3 ]]]
+// non-indented code [[[[ 4 ]]]]
+%}
+
a /* action comment [ 1 ] */ ;
b /* action comment [[ 2 ]] */ ;
c /* action comment [[[ 3 ]]] */ ;
d /* action comment [[[[ 4 ]]]] */ ;
e /* action comment ]] unmatched [[ */ ;
f return 1+foo(a[b[c[0]]]);
-.|\n {
+.|\n {
+
+#if 0
+ action code [ 1 ] TEST_XXX
+ action code [[ 2 ]] TEST_XXX
+ action code [[[ 3 ]]] TEST_XXX
+ action code [[[[ 4 ]]]] TEST_XXX
+ action code ]] unmatched [[ TEST_XXX
+#endif
/* action block [ 1 ] TEST_XXX */
/* action block [[ 2 ]] TEST_XXX */
/* action block [[[ 3 ]]] TEST_XXX */
/* action block [[[[ 4 ]]]] TEST_XXX */
/* action block ]] unmatched [[ TEST_XXX */
- assert(!strcmp("m4_define(alpha, beta)", "m4_""define(alpha, beta)"));
+ assert(!strcmp("[[ 2 ]]", "[""[ 2 ]""]"));
+ assert(!strcmp("[[[ 3 ]]]", "[""[""[ 3 ]""]""]"));
+ assert(!strcmp("[[[[ 4 ]]]]", "[""[""[""[ 4 ]""]""]""]"));
+ assert(!strcmp("]] unmatched [[", "]""] unmatched [""["));
+ assert(!strcmp("]]m4_define(alpha, beta)[[",
+ "]""]m4_""define(alpha, beta)[""["));
return 1+foo(a[b[c[0]]]); /* TEST_XXX */
}
%%