about summary refs log tree commit diff
path: root/src/libexpr
diff options
context:
space:
mode:
authorEelco Dolstra <e.dolstra@tudelft.nl>2006-10-02T14·43+0000
committerEelco Dolstra <e.dolstra@tudelft.nl>2006-10-02T14·43+0000
commit7581cfdee4001cba719d4d72f8f17f1b4c04ed51 (patch)
tree69810f27a97c8669a95e717d2fa552dfd1400d37 /src/libexpr
parentf316b6c1a91e596b2717bc4db76c6513e3ef5f85 (diff)
* Hack for Bison 2.3 compatability.
Diffstat (limited to 'src/libexpr')
-rw-r--r--src/libexpr/lexer.l1
-rw-r--r--src/libexpr/parser.y15
2 files changed, 14 insertions, 2 deletions
diff --git a/src/libexpr/lexer.l b/src/libexpr/lexer.l
index 625e044b682f..5db13a71699b 100644
--- a/src/libexpr/lexer.l
+++ b/src/libexpr/lexer.l
@@ -10,6 +10,7 @@
 #include "aterm.hh"
 #include "nixexpr.hh"
 #include "nixexpr-ast.hh"
+#define BISON_HEADER_HACK
 #include "parser-tab.hh"
 
 using namespace nix;
diff --git a/src/libexpr/parser.y b/src/libexpr/parser.y
index dd4d509a453b..e4b220e04fb8 100644
--- a/src/libexpr/parser.y
+++ b/src/libexpr/parser.y
@@ -2,12 +2,20 @@
 %pure-parser
 %locations
 %error-verbose
+%defines
+%no-lines
 %parse-param { yyscan_t scanner }
 %parse-param { ParseData * data }
 %lex-param { yyscan_t scanner }
 
 
 %{
+/* Newer versions of Bison copy the declarations below to
+   parser-tab.hh, which sucks bigtime since lexer.l doesn't want that
+   stuff.  So allow it to be excluded. */
+#ifndef BISON_HEADER_HACK
+#define BISON_HEADER_HACK
+    
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -75,7 +83,7 @@ static Pos makeCurPos(YYLTYPE * loc, ParseData * data)
 }
 
 
-void yyerror(YYLTYPE * loc, yyscan_t scanner, ParseData * data, char * error)
+void yyerror(YYLTYPE * loc, yyscan_t scanner, ParseData * data, const char * error)
 {
     data->error = (format("%1%, at `%2%':%3%:%4%")
         % error % data->path % loc->first_line % loc->first_column).str();
@@ -100,7 +108,10 @@ static void freeAndUnprotect(void * p)
 #define YYMALLOC mallocAndProtect
 #define YYFREE freeAndUnprotect
 
- 
+
+#endif
+
+
 %}
 
 %union {