summaryrefslogtreecommitdiffstats
path: root/parse.y
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-03 07:55:54 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-12-03 07:55:54 +0000
commit59a8609a64ebb75cb4ba2f80b79f46ad597dd862 (patch)
treef533981e70f40f4a4da3a089ad75fcd81599ad56 /parse.y
parentb099d79ccc4a52634e35dd67c73d0c5439cb21ac (diff)
downloadruby-59a8609a64ebb75cb4ba2f80b79f46ad597dd862.tar.gz
ruby-59a8609a64ebb75cb4ba2f80b79f46ad597dd862.tar.xz
ruby-59a8609a64ebb75cb4ba2f80b79f46ad597dd862.zip
* configure.in (AC_PROG_YACC): AC_DEFINE(OLD_YACC) if Yacc is found
instead of Bison or byacc. * parse.y: If OLD_YACC is defined, ensure that YYMAXDEPTH is at least 10000 (Bison's default) since some old versions of Yacc define it as low as 150 by default, which is too low for Ruby to parse some files, such as date/format.rb. Among other issues, the parse problem causes "make test" to fail. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5093 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y9
1 files changed, 9 insertions, 0 deletions
diff --git a/parse.y b/parse.y
index 79bdc15db..a2c21aa25 100644
--- a/parse.y
+++ b/parse.y
@@ -177,6 +177,15 @@ static void top_local_setup();
#define nd_paren(node) (char)((node)->u2.id >> CHAR_BIT*2)
#define nd_nest u3.id
+/* Older versions of Yacc set YYMAXDEPTH to a very low value by default (150,
+ for instance). This is too low for Ruby to parse some files, such as
+ date/format.rb, therefore bump the value up to at least Bison's default. */
+#ifdef OLD_YACC
+#ifndef YYMAXDEPTH
+#define YYMAXDEPTH 10000
+#endif
+#endif
+
%}
%union {