1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Update the latest versions from upstream repository of racc

This commit is contained in:
Hiroshi SHIBATA 2019-10-30 21:36:59 +09:00
parent e6d611ad37
commit 6c3ed0d71c
No known key found for this signature in database
GPG key ID: F9CF13417264FAC2
10 changed files with 21 additions and 18 deletions

View file

@ -1,8 +1,7 @@
module Racc
PARSER_TEXT = <<'__end_of_file__'
#
# $Id: 1c0ef52c0f41acc465725e9e44b5b9d74d392ba5 $
#
# frozen_string_literal: false
#--
# Copyright (c) 1999-2006 Minero Aoki
#
# This program is free software.
@ -11,7 +10,7 @@ module Racc
# As a special exception, when this code is copied by Racc
# into a Racc output file, you may use that output file
# without restriction.
#
#++
require 'racc/info'
@ -45,7 +44,7 @@ end
# [--version] [--copyright] [--help] <var>grammarfile</var>
#
# [+filename+]
# Racc grammar file. Any extention is permitted.
# Racc grammar file. Any extension is permitted.
# [-o+outfile+, --output-file=+outfile+]
# A filename for output. default is <+filename+>.tab.rb
# [-O+filename+, --log-file=+filename+]
@ -189,10 +188,10 @@ module Racc
class Parser
Racc_Runtime_Version = ::Racc::VERSION
Racc_Runtime_Revision = '$Id: 1c0ef52c0f41acc465725e9e44b5b9d74d392ba5 $'
Racc_Runtime_Revision = '$Id: 87af5c09d4467cae567837b4162ec2145417a90e $'
Racc_Runtime_Core_Version_R = ::Racc::VERSION
Racc_Runtime_Core_Revision_R = '$Id: 1c0ef52c0f41acc465725e9e44b5b9d74d392ba5 $'.split[1]
Racc_Runtime_Core_Revision_R = '$Id: 87af5c09d4467cae567837b4162ec2145417a90e $'.split[1]
begin
if Object.const_defined?(:RUBY_ENGINE) and RUBY_ENGINE == 'jruby'
require 'racc/cparse-jruby.jar'
@ -269,9 +268,11 @@ puts $!.backtrace
# def next_token
# @q.shift
# end
class_eval %{
def do_parse
__send__(Racc_Main_Parsing_Routine, _racc_setup(), false)
#{Racc_Main_Parsing_Routine}(_racc_setup(), false)
end
}
# The method to fetch next token.
# If you use #do_parse method, you must implement #next_token.
@ -329,9 +330,11 @@ puts $!.backtrace
#
# RECEIVER#METHOD_ID is a method to get next token.
# It must 'yield' the token, which format is [TOKEN-SYMBOL, VALUE].
class_eval %{
def yyparse(recv, mid)
__send__(Racc_YY_Parse_Method, recv, mid, _racc_setup(), false)
#{Racc_YY_Parse_Method}(recv, mid, _racc_setup(), true)
end
}
def _racc_yyparse_rb(recv, mid, arg, c_debug)
action_table, action_check, action_default, action_pointer,