bison-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

FYI: calc.at


From: Akim Demaille
Subject: FYI: calc.at
Date: 10 Sep 2001 11:39:16 +0200
User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Artificial Intelligence)

Index: ChangeLog
from  Akim Demaille  <address@hidden>

        * tests/calc.at: Use m4_match.
        (_AT_DATA_CALC_Y): Check `yyin != NULL', not `stdin != NULL'.

Index: tests/calc.at
===================================================================
RCS file: /cvsroot/bison/bison/tests/calc.at,v
retrieving revision 1.5.2.1
diff -u -u -r1.5.2.1 calc.at
--- tests/calc.at 2001/08/30 15:36:37 1.5.2.1
+++ tests/calc.at 2001/09/10 09:31:28
@@ -220,14 +220,16 @@
 }
 
 int
-main (int argn, const char **argv)
+main (int argc, const char **argv)
 {
-  if (argn == 2)
+  yyin = NULL;
+
+  if (argc == 2)
     yyin = fopen (argv[1], "r");
   else
     yyin = stdin;
 
-  if (!stdin)
+  if (!yyin)
     {
       perror (argv[1]);
       exit (1);
@@ -252,9 +254,8 @@
 # Produce `calc.y'.
 m4_define([AT_DATA_CALC_Y],
 [_AT_DATA_CALC_Y($[1], $[2], $[3],
-                 [m4_if(m4_regexp([$1], [--yyerror-verbose]),
-                        [-1], [],
-                        [[#define YYERROR_VERBOSE]])])])
+                 [m4_match([$1], [--yyerror-verbose],
+                           [[#define YYERROR_VERBOSE]])])])
 
 
 
@@ -268,12 +269,12 @@
 [AT_DATA([[input]],
 [[$2
 ]])
-m4_if(m4_regexp([$1], [--debug]),
-  [-1],
-     [AT_CHECK([./calc <input],
-               [0], [], [])],
-     [AT_CHECK([calc ./input 2>&1 >/dev/null | grep 'parse error' >&2],
-               [1], [], [])])])
+m4_match([$1], [--debug],
+          [AT_CHECK([calc ./input 2>&1 >/dev/null | grep 'parse error' >&2],
+                    [1], [], [])],
+          [AT_CHECK([./calc <input],
+               [0], [], [])])dnl
+])
 
 
 # _AT_CHECK_CALC_ERROR(BISON-OPTIONS, INPUT,
@@ -286,12 +287,10 @@
 ]])
 
 AT_CHECK([./calc <input 2>&1 >/dev/null | grep 'parse error' >&2], 0,
-          [],
-[m4_if(m4_regexp([$1], [--location]),
-       [-1], [], [$3: ])[]dnl
+         [],
+[m4_match([$1], [--location], [$3: ])[]dnl
 parse error[]dnl
-m4_if(m4_regexp([$1], [--yyerror-verbose]),
-      [-1], [], [$4])[]dnl
+m4_match([$1], [--yyerror-verbose], [$4])[]dnl
 
 ])])
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]