Le 16 févr. 2012 à 15:57, Akim Demaille a écrit :

> From f9c75dd016198f9b8c255f1bb139360eef3f071f Mon Sep 17 00:00:00 2001
> From: Akim Demaille <[email protected]>
> 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:

> %@{
> -  #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 *);
> %@}


> @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 <[email protected]>
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
 %@{
   #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




Reply via email to