mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
Set default %printer for NODE nterms
Before: ``` Reducing stack by rule 639 (line 5062): $1 = token "integer literal" (1.0-1.1: 1) -> $$ = nterm simple_numeric (1.0-1.1: ) ``` After: ``` Reducing stack by rule 641 (line 5078): $1 = token "integer literal" (1.0-1.1: 1) -> $$ = nterm simple_numeric (1.0-1.1: NODE_LIT) ``` `"<*>"` is supported by Bison 2.3b (2008-05-27) or later. https://git.savannah.gnu.org/cgit/bison.git/commit/?id=12e3584054c16ab255672c07af0ffc7bb220e8bc Therefore developers need to install Bison 2.3b+ to build ruby from source codes if their Bison is older. Minimum version requirement for Bison is changed to 3.0. See: https://bugs.ruby-lang.org/issues/19068 [Feature #19068]
This commit is contained in:
parent
7456647eff
commit
f7db1affd1
Notes:
git
2022-11-08 03:30:24 +00:00
3 changed files with 11 additions and 2 deletions
3
.github/workflows/macos.yml
vendored
3
.github/workflows/macos.yml
vendored
|
@ -51,11 +51,12 @@ jobs:
|
||||||
- name: Install libraries
|
- name: Install libraries
|
||||||
run: |
|
run: |
|
||||||
brew upgrade
|
brew upgrade
|
||||||
brew install gmp libffi openssl@1.1 zlib autoconf automake libtool readline
|
brew install gmp libffi openssl@1.1 zlib autoconf automake libtool readline bison
|
||||||
working-directory: src
|
working-directory: src
|
||||||
- name: Set ENV
|
- name: Set ENV
|
||||||
run: |
|
run: |
|
||||||
echo "MAKEFLAGS=-j$((1 + $(sysctl -n hw.activecpu)))" >> $GITHUB_ENV
|
echo "MAKEFLAGS=-j$((1 + $(sysctl -n hw.activecpu)))" >> $GITHUB_ENV
|
||||||
|
echo "PATH="/usr/local/opt/bison/bin:$PATH"" >> $GITHUB_ENV
|
||||||
- run: ./autogen.sh
|
- run: ./autogen.sh
|
||||||
working-directory: src
|
working-directory: src
|
||||||
- name: Run configure
|
- name: Run configure
|
||||||
|
|
|
@ -47,7 +47,7 @@ def prelude(f, out)
|
||||||
when /\A%%/
|
when /\A%%/
|
||||||
out << "%%\n"
|
out << "%%\n"
|
||||||
return
|
return
|
||||||
when /\A%token/
|
when /\A%token/, /\A} <node>/
|
||||||
out << line.sub(/<\w+>/, '<val>')
|
out << line.sub(/<\w+>/, '<val>')
|
||||||
when /\A%type/
|
when /\A%type/
|
||||||
out << line.sub(/<\w+>/, '<val>')
|
out << line.sub(/<\w+>/, '<val>')
|
||||||
|
|
8
parse.y
8
parse.y
|
@ -1140,6 +1140,14 @@ static int looking_at_eol_p(struct parser_params *p);
|
||||||
%define api.pure
|
%define api.pure
|
||||||
%define parse.error verbose
|
%define parse.error verbose
|
||||||
%printer {
|
%printer {
|
||||||
|
#ifndef RIPPER
|
||||||
|
if ($$) {
|
||||||
|
rb_parser_printf(p, "%s", ruby_node_name(nd_type($$)));
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
#endif
|
||||||
|
} <node>
|
||||||
|
%printer {
|
||||||
#ifndef RIPPER
|
#ifndef RIPPER
|
||||||
rb_parser_printf(p, "%"PRIsVALUE, rb_id2str($$));
|
rb_parser_printf(p, "%"PRIsVALUE, rb_id2str($$));
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Reference in a new issue