]> git.saurik.com Git - bison.git/blobdiff - tests/local.at
grammar: free the association tracking graph
[bison.git] / tests / local.at
index 39de66393c0c1749b8877973db62f061a41b0be0..c1aedf39bb93d8a8679e455dd0f6a2d4c5267254 100644 (file)
@@ -31,15 +31,18 @@ m4_define([m4_null_if],
 
 # AT_SETUP_STRIP(TITLE)
 # ---------------------
-# Abbreviate the TITLE to be passed to AT_SETUP.
+# Abbreviate the TITLE to be passed to AT_SETUP.  Remove new-lines
+# that completely break AT_SETUP.
 m4_define([AT_SETUP_STRIP],
 [m4_bpatsubsts([$1],
       [%\(language\|skeleton\) "?\([^\" ]*\)"?],
         [\2],
-      [%define "?\([-A-Za-z0-9_.]+\)"? \("\([^\" ]+\)"\|\([-A-Za-z0-9_.]+\)\)],
-        [\1=\3\4],
+      [%define "?\([-A-Za-z0-9_.]+\)"? \("[^\"]+"\|[-A-Za-z0-9_.]+\)],
+        [\1=\2],
       [%define "?\([-A-Za-z0-9_.]+\)"?],
-        [\1])dnl
+        [\1],
+      [ *
++ *],    [ ])dnl
 ])
 
 
@@ -183,10 +186,12 @@ m4_pushdef([AT_NAME_PREFIX],
            [m4_bregexp([$3], [\(%define api\.\(namespace\|prefix\)\|%name-prefix\) "\([^""]*\)"], [\3])],
            [yy])])
 m4_pushdef([AT_TOKEN_CTOR_IF],
-[m4_bmatch([$3], [%define api.token.constructor], [$1], [$2])])
+[m4_bmatch([$3], [%define api\.token\.constructor], [$1], [$2])])
 m4_pushdef([AT_TOKEN_PREFIX],
-[m4_bmatch([$3], [%define api.token.prefix ".*"],
-           [m4_bregexp([$3], [%define api.token.prefix "\(.*\)"], [\1])])])
+[m4_bmatch([$3], [%define api\.token\.prefix ".*"],
+           [m4_bregexp([$3], [%define api\.token\.prefix "\(.*\)"], [\1])])])
+m4_pushdef([AT_VARIANT_IF],
+[m4_bmatch([$3], [%define api\.value\.type "?variant"?], [$1], [$2])])
 m4_pushdef([AT_API_prefix],
 [m4_bmatch([$3], [%define api\.prefix ".*"],
            [m4_bregexp([$3], [%define api\.prefix "\([^""]*\)"], [\1])],
@@ -200,7 +205,7 @@ m4_pushdef([AT_API_PREFIX],
 m4_pushdef([AT_YYERROR_ARG_LOC_IF],
 [AT_LOCATION_IF([AT_PURE_IF([m4_bmatch([$3],
                                        m4_quote(m4_join([\|],
-                                                        [%define api.pure "?full"?],
+                                                        [%define api\.pure "?full"?],
                                                         [%glr-parser],
                                                         [%parse-param],
                                                         [%skeleton "?glr.c"?])),
@@ -285,6 +290,7 @@ m4_popdef([AT_YYERROR_SEES_LOC_IF])
 m4_popdef([AT_YYERROR_ARG_LOC_IF])
 m4_popdef([AT_API_PREFIX])
 m4_popdef([AT_API_prefix])
+m4_popdef([AT_VARIANT_IF])
 m4_popdef([AT_TOKEN_PREFIX])
 m4_popdef([AT_TOKEN_CTOR_IF])
 m4_popdef([AT_NAME_PREFIX])
@@ -758,23 +764,23 @@ m4_define([AT_FULL_COMPILE],
 [java],
   [AT_BISON_CHECK([-o $1.java $1.y])
    AT_LANG_COMPILE([$1],
-                    m4_join([ ],
-                            [$1.java],
-                            m4_ifval($2, [[$1-$2.java]]),
+                   m4_join([ ],
+                           [$1.java],
+                           m4_ifval($2, [[$1-$2.java]]),
                            m4_ifval($3, [[$1-$3.java]])))],
 [c++],
   [AT_BISON_CHECK([-o $1.cc $1.y])
    AT_LANG_COMPILE([$1],
-                     m4_join([ ],
-                             [$1.cc],
-                             m4_ifval($2, [[$1-$2.cc]]),
+                   m4_join([ ],
+                           [$1.cc],
+                           m4_ifval($2, [[$1-$2.cc]]),
                            m4_ifval($3, [[$1-$3.cc]])))],
 [c],
   [AT_BISON_CHECK([-o $1.c $1.y])
    AT_LANG_COMPILE([$1],
-                  m4_join([ ],
-                          [$1.c],
-                          m4_ifval($2, [[$1-$2.c]]),
+                   m4_join([ ],
+                           [$1.c],
+                           m4_ifval($2, [[$1-$2.c]]),
                            m4_ifval($3, [[$1-$3.c]])))])
 ])
 
@@ -956,7 +962,7 @@ yylex (void)
 
 m4_if(m4_index(m4_quote($3), [no-xml]), -1,
       [AT_BISON_CHECK],
-      [AT_BISON_CHECK_NO_XML])([[--report=all --defines -o input.c input.y]],
+      [AT_BISON_CHECK_NO_XML])([[-Wall --report=all --defines -o input.c input.y]],
                                [0], [], m4_dquote($7))
 
 m4_if(m4_index(m4_quote($3), [last-state]), -1,
@@ -976,8 +982,8 @@ $9
 # There is no "" around `wc` since some indent the result.
 m4_bmatch([$4], [%define lr.type canonical-lr],
 [if test 32767 -lt `wc -l < input.c`; then
-  CFLAGS=`echo " $CFLAGS " | sed -e 's/ -pedantic //'`
-  CXXFLAGS=`echo " $CXXFLAGS " | sed -e 's/ -pedantic //'`
+  CFLAGS=`echo " $CFLAGS " | sed -e 's/ -pedantic / /'`
+  CXXFLAGS=`echo " $CXXFLAGS " | sed -e 's/ -pedantic / /'`
 fi])
 AT_COMPILE([[input]])