From 2f4c13b0f070689e10f965c3ecc386381e092866 Mon Sep 17 00:00:00 2001 From: matz Date: Wed, 3 Dec 2003 07:55:54 +0000 Subject: [PATCH] * 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: svn+ssh://ci.ruby-lang.org/ruby/trunk@5093 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 11 +++++++++++ configure.in | 4 ++++ defines.h | 2 +- parse.y | 9 +++++++++ 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 0420ebd9e9..bd5546e2fd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -40,6 +40,17 @@ Tue Dec 2 21:31:42 2003 Nobuyoshi Nakada * test/runner.rb: exit with the test result. +Tue Dec 2 20:18:48 2003 Eric Sunshine + + * 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. + Tue Dec 2 20:03:20 2003 Minero Aoki * test/fileutils/test_fileutils.rb: check if Pathnames are usable diff --git a/configure.in b/configure.in index a23831c5a5..23149915e4 100644 --- a/configure.in +++ b/configure.in @@ -157,6 +157,10 @@ AC_SUBST(OUTFLAG) RUBY_MINGW32 AC_PROG_YACC +if test "$YACC" = "yacc"; then + AC_DEFINE([OLD_YACC]) +fi + AC_CHECK_TOOL(RANLIB, ranlib, :) AC_CHECK_TOOL(AR, ar) if test -z "$AR"; then diff --git a/defines.h b/defines.h index ca7cd8e1e1..6d9a7013c8 100644 --- a/defines.h +++ b/defines.h @@ -180,7 +180,7 @@ flush_register_windows(void) #define PATH_ENV "PATH" #endif -#if defined(DOSISH) && !defined(__human68k__) +#if defined(DOSISH) && !defined(__human68k__) && !defined(__EMX__) #define ENV_IGNORECASE #endif diff --git a/parse.y b/parse.y index 79bdc15db1..a2c21aa25d 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 {