[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] cosmetics: fix typos and wording in some yacc tests
From: |
Stefano Lattarini |
Subject: |
[PATCH] cosmetics: fix typos and wording in some yacc tests |
Date: |
Sun, 10 Apr 2011 11:17:10 +0200 |
User-agent: |
KMail/1.13.3 (Linux/2.6.30-2-686; KDE/4.4.4; i686; ; ) |
On Sunday 10 April 2011, Ralf Wildenhues wrote:
> * Stefano Lattarini wrote on Sun, Apr 10, 2011 at 10:26:40AM CEST:
> > <http://lists.gnu.org/archive/html/automake-patches/2011-01/msg00306.html>
> >
> > > Related to automake bug#7648 and PR automake/491.
> > >
> > > * lib/am/yacc.am (am__yacc_c2h): New internal variable.
> > > (?GENERIC?%EXT%%DERIVED-EXT%, ?!GENERIC?%OBJ%): Get the name of
> > > the header dynamically at make runtime, so that its extension is
> > > modelled after the extension of the source.
> > > * automake.in (lang_yacc_target_hook): Adjust the calculation of
> > > `$header' accordingly.
> > > * tests/yacc-cxx.test: New test.
> > > * tests/yacc-d-cxx.test: Likewise.
> > > * tests/yacc-weirdnames.test: Likewise.
> > > * tests/yacc-basic.test: Update comments.
> > > * tests/yacc-d-basic.test: Likewise.
> > > * tests/yaccpp.test: Updated and extended.
> > > * tests/Makefile.am (TESTS): Update.
> > >
> > This patch has been applied in the meantime, but it lacked NEWS and
> > documentation updates. I will post them soonish in two different
> > patches.
>
> While at it, you might want to fix
>
> > +// Valid as C++, but deliberatly invalid as C.
>
> deliberately
>
> I think you meant to write:
> Valid C++, but deliberately invalid C.
>
> > +#include <cstdio>
> > +#include <cstdlib>
> > +int yylex (void) { return (getchar ()); }
>
> Extra parentheses, not needed for return.
>
> which is how far I got with reviewing before you pushed the patch.
>
> Cheers,
> Ralf
>
I've fixed that, plus some similar blunders, and added a few other
misc fixlets too. The resulting patch is attached. OK for yacc-work?
Thanks,
Stefano
From 2b1a61f59b1be829bac9f90bdb10e2c6e8df832d Mon Sep 17 00:00:00 2001
From: Stefano Lattarini <address@hidden>
Date: Sun, 10 Apr 2011 11:13:54 +0200
Subject: [PATCH] cosmetics: fix typos and wording in some yacc tests
* tests/yacc-cxx.test (foo.cc): Clarify comment about the content
of this file being valid C++ but invalid C.
(parse1.yy): Likewise. Also, remove redundant parentheses in a
`return' statement.
* tests/yacc-d-cxx.test (write_parse): Clarify comment about the
content of the generated files being valid C++ but invalid C.
(write_main): Likewise.
* tests/yacc-basic.test: Remove redundant parentheses in a
`return' statement.
* tests/yacc-d-vpath.test: Adjust spacing around curly brackets.
* tests/yaccvpath.test: Likewise.
* tests/yaccdry.test: Likewise.
* tests/yacc8.test: Likewise.
* tests/yacc4.test: Likewise.
Suggested by Ralf Wildenhues.
---
ChangeLog | 19 +++++++++++++++++++
tests/yacc-basic.test | 2 +-
tests/yacc-cxx.test | 6 +++---
tests/yacc-d-cxx.test | 4 ++--
tests/yacc-d-vpath.test | 6 +++---
tests/yacc8.test | 2 +-
tests/yaccdry.test | 2 +-
tests/yaccvpath.test | 6 +++---
8 files changed, 33 insertions(+), 14 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 2fc4a45..9e6c3a9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,22 @@
+2011-04-10 Stefano Lattarini <address@hidden>
+
+ cosmetics: fix typos and wording in some yacc tests
+ * tests/yacc-cxx.test (foo.cc): Clarify comment about the content
+ of this file being valid C++ but invalid C.
+ (parse1.yy): Likewise. Also, remove redundant parentheses in a
+ `return' statement.
+ * tests/yacc-d-cxx.test (write_parse): Clarify comment about the
+ content of the generated files being valid C++ but invalid C.
+ (write_main): Likewise.
+ * tests/yacc-basic.test: Remove redundant parentheses in a
+ `return' statement.
+ * tests/yacc-d-vpath.test: Adjust spacing around curly brackets.
+ * tests/yaccvpath.test: Likewise.
+ * tests/yaccdry.test: Likewise.
+ * tests/yacc8.test: Likewise.
+ * tests/yacc4.test: Likewise.
+ Suggested by Ralf Wildenhues.
+
2011-04-10 Stefano Lattarini <address@hidden>
yacc: update docs w.r.t. extension of yacc-generated headers
diff --git a/tests/yacc-basic.test b/tests/yacc-basic.test
index 845a861..96625cc 100755
--- a/tests/yacc-basic.test
+++ b/tests/yacc-basic.test
@@ -45,7 +45,7 @@ cat > parse.y << 'END'
%{
#include <stdio.h>
#include <stdlib.h>
-int yylex () { return (getchar ()); }
+int yylex () { return getchar (); }
void yyerror (char *s) {}
%}
%%
diff --git a/tests/yacc-cxx.test b/tests/yacc-cxx.test
index 86693d6..a6682e5 100755
--- a/tests/yacc-cxx.test
+++ b/tests/yacc-cxx.test
@@ -45,10 +45,10 @@ END
cat > parse1.yy << 'END'
%{
-// Valid as C++, but deliberatly invalid as C.
+// Valid C++, but deliberately invalid C.
#include <cstdio>
#include <cstdlib>
-int yylex (void) { return (getchar ()); }
+int yylex (void) { return getchar (); }
void yyerror (const char *s) { return; }
%}
%%
@@ -59,7 +59,7 @@ cp parse1.yy parse3.yxx
cp parse1.yy parse4.ypp
cat > foo.cc << 'END'
-// Valid as C++, but deliberatly invalid as C.
+// Valid C++, but deliberately invalid C.
using namespace std;
int main (int argc, char **argv)
{
diff --git a/tests/yacc-d-cxx.test b/tests/yacc-d-cxx.test
index b94b14d..a8de6b3 100755
--- a/tests/yacc-d-cxx.test
+++ b/tests/yacc-d-cxx.test
@@ -31,7 +31,7 @@ write_parse ()
header=$1
sed 's/^ *//' <<END
%{
- // Valid as C++, but deliberatly invalid as C.
+ // Valid C++, but deliberately invalid C.
#include <cstdlib>
#include "$header"
int yylex (void) { return 0; }
@@ -47,7 +47,7 @@ write_main ()
{
header=$1
sed 's/^ *//' <<END
- // Valid as C++, but deliberatly invalid as C.
+ // Valid C++, but deliberately invalid C.
#include <cstdio>
#include "$header"
int main (int argc, char **argv)
diff --git a/tests/yacc-d-vpath.test b/tests/yacc-d-vpath.test
index bb09990..0efa61e 100755
--- a/tests/yacc-d-vpath.test
+++ b/tests/yacc-d-vpath.test
@@ -44,7 +44,7 @@ END
# Original parser, with `foobar'
cat > parse.y << 'END'
%{
-int yylex () {return 0;}
+int yylex () { return 0; }
void yyerror (char *s) {}
%}
%token FOOBAR
@@ -77,7 +77,7 @@ $sleep
# New parser, with `fubar'
cat > ../parse.y << 'END'
%{
-int yylex () {return 0;}
+int yylex () { return 0; }
void yyerror (char *s) {}
%}
%token FUBAR
@@ -97,7 +97,7 @@ $sleep
# New parser, with `maude'
cat > ../parse.y << 'END'
%{
-int yylex () {return 0;}
+int yylex () { return 0; }
void yyerror (char *s) {}
%}
%token MAUDE
diff --git a/tests/yacc8.test b/tests/yacc8.test
index a683c8d..ca1ac68 100755
--- a/tests/yacc8.test
+++ b/tests/yacc8.test
@@ -52,7 +52,7 @@ mkdir foo
cat > foo/parse.y << 'END'
%{
-int yylex () {return 0;}
+int yylex () { return 0; }
void yyerror (char *s) {}
%}
%%
diff --git a/tests/yaccdry.test b/tests/yaccdry.test
index d30fb80..3ad4f75 100755
--- a/tests/yaccdry.test
+++ b/tests/yaccdry.test
@@ -39,7 +39,7 @@ END
cat > parse.y << 'END'
%{
-int yylex () {return 0;}
+int yylex () { return 0; }
void yyerror (char *s) {}
%}
%%
diff --git a/tests/yaccvpath.test b/tests/yaccvpath.test
index 52092fa..77df917 100755
--- a/tests/yaccvpath.test
+++ b/tests/yaccvpath.test
@@ -44,7 +44,7 @@ END
# Original parser, with `foobar'
cat > parse.y << 'END'
%{
-int yylex () {return 0;}
+int yylex () { return 0; }
void yyerror (char *s) {}
%}
%%
@@ -71,7 +71,7 @@ $sleep
# New parser, with `fubar'
cat > ../parse.y << 'END'
%{
-int yylex () {return 0;}
+int yylex () { return 0; }
void yyerror (char *s) {}
%}
%%
@@ -89,7 +89,7 @@ $sleep
# New parser, with `maude'
cat > ../parse.y << 'END'
%{
-int yylex () {return 0;}
+int yylex () { return 0; }
void yyerror (char *s) {}
%}
%%
--
1.7.2.3
[PATCH 2/2] yacc: update docs w.r.t. extension of yacc-generated headers, Stefano Lattarini, 2011/04/10