[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: FYI: master: doc: fix mfcalc code
From: |
Akim Demaille |
Subject: |
Re: FYI: master: doc: fix mfcalc code |
Date: |
Fri, 17 Feb 2012 15:56:34 +0100 |
Le 16 févr. 2012 à 15:57, Akim Demaille a écrit :
> From f9c75dd016198f9b8c255f1bb139360eef3f071f Mon Sep 17 00:00:00 2001
> From: Akim Demaille <address@hidden>
> Date: Thu, 16 Feb 2012 15:07:23 +0100
> Subject: [PATCH 2/5] doc: fix mfcalc code.
>
> * doc/bison.texinfo (Multi-function Calc): Add missing includes.
> Fix the rendering of the result: use @result and remove the
> initial tabulation in the actual code.
> Fix stylistic issues: avoid the , operator.
> Add extexi mark-up.
> * examples/extexi: Also support @smallexample.
The following bit:
> address@hidden
> - #include <math.h> /* For math functions, cos(), sin(), etc. */
> - #include "calc.h" /* Contains definition of `symrec'. */
> + #include <stdio.h> /* For printf, etc. */
> + #include "calc.h" /* Contains definition of `symrec'. */
> int yylex (void);
> void yyerror (char const *);
> address@hidden
> @group
> +#include <math.h> /* Math functions, cos(), sin(), etc. */
> struct init const arith_fncts[] =
missed the fact that pow was used in the grammar, much
earlier. Fixed below.
From 578e34133a8b51febc66f715b7567a3d2cf30b8e Mon Sep 17 00:00:00 2001
From: Akim Demaille <address@hidden>
Date: Fri, 17 Feb 2012 15:49:03 +0100
Subject: [PATCH 2/2] doc: mfcalc: fix includes.
* doc/bison.texinfo: math.h is needed early.
---
doc/bison.texinfo | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/doc/bison.texinfo b/doc/bison.texinfo
index f39f79e..cd687b9 100644
--- a/doc/bison.texinfo
+++ b/doc/bison.texinfo
@@ -2336,6 +2336,7 @@ Here are the C and Bison declarations for the
multi-function calculator.
@group
address@hidden
#include <stdio.h> /* For printf, etc. */
+ #include <math.h> /* For pow, used in the grammar. */
#include "calc.h" /* Contains definition of `symrec'. */
int yylex (void);
void yyerror (char const *);
@@ -2484,7 +2485,6 @@ struct init
@end group
@group
-#include <math.h> /* Math functions, cos(), sin(), etc. */
struct init const arith_fncts[] =
@{
@{ "atan", atan @},
--
1.7.9