зеркало из https://github.com/github/ruby.git
[PRISM] Integrate new number parsing
This commit is contained in:
Родитель
5e0589cf52
Коммит
4016535404
37
common.mk
37
common.mk
|
@ -100,6 +100,7 @@ PRISM_FILES = prism/api_node.$(OBJEXT) \
|
|||
prism/util/pm_buffer.$(OBJEXT) \
|
||||
prism/util/pm_char.$(OBJEXT) \
|
||||
prism/util/pm_constant_pool.$(OBJEXT) \
|
||||
prism/util/pm_integer.$(OBJEXT) \
|
||||
prism/util/pm_list.$(OBJEXT) \
|
||||
prism/util/pm_memchr.$(OBJEXT) \
|
||||
prism/util/pm_newline_list.$(OBJEXT) \
|
||||
|
@ -2244,6 +2245,7 @@ ast.$(OBJEXT): $(top_srcdir)/prism/regexp.h
|
|||
ast.$(OBJEXT): $(top_srcdir)/prism/util/pm_buffer.h
|
||||
ast.$(OBJEXT): $(top_srcdir)/prism/util/pm_char.h
|
||||
ast.$(OBJEXT): $(top_srcdir)/prism/util/pm_constant_pool.h
|
||||
ast.$(OBJEXT): $(top_srcdir)/prism/util/pm_integer.h
|
||||
ast.$(OBJEXT): $(top_srcdir)/prism/util/pm_list.h
|
||||
ast.$(OBJEXT): $(top_srcdir)/prism/util/pm_memchr.h
|
||||
ast.$(OBJEXT): $(top_srcdir)/prism/util/pm_newline_list.h
|
||||
|
@ -2679,6 +2681,7 @@ builtin.$(OBJEXT): $(top_srcdir)/prism/regexp.h
|
|||
builtin.$(OBJEXT): $(top_srcdir)/prism/util/pm_buffer.h
|
||||
builtin.$(OBJEXT): $(top_srcdir)/prism/util/pm_char.h
|
||||
builtin.$(OBJEXT): $(top_srcdir)/prism/util/pm_constant_pool.h
|
||||
builtin.$(OBJEXT): $(top_srcdir)/prism/util/pm_integer.h
|
||||
builtin.$(OBJEXT): $(top_srcdir)/prism/util/pm_list.h
|
||||
builtin.$(OBJEXT): $(top_srcdir)/prism/util/pm_memchr.h
|
||||
builtin.$(OBJEXT): $(top_srcdir)/prism/util/pm_newline_list.h
|
||||
|
@ -3311,6 +3314,7 @@ compile.$(OBJEXT): $(top_srcdir)/prism/regexp.h
|
|||
compile.$(OBJEXT): $(top_srcdir)/prism/util/pm_buffer.h
|
||||
compile.$(OBJEXT): $(top_srcdir)/prism/util/pm_char.h
|
||||
compile.$(OBJEXT): $(top_srcdir)/prism/util/pm_constant_pool.h
|
||||
compile.$(OBJEXT): $(top_srcdir)/prism/util/pm_integer.h
|
||||
compile.$(OBJEXT): $(top_srcdir)/prism/util/pm_list.h
|
||||
compile.$(OBJEXT): $(top_srcdir)/prism/util/pm_memchr.h
|
||||
compile.$(OBJEXT): $(top_srcdir)/prism/util/pm_newline_list.h
|
||||
|
@ -3773,6 +3777,7 @@ cont.$(OBJEXT): $(top_srcdir)/prism/regexp.h
|
|||
cont.$(OBJEXT): $(top_srcdir)/prism/util/pm_buffer.h
|
||||
cont.$(OBJEXT): $(top_srcdir)/prism/util/pm_char.h
|
||||
cont.$(OBJEXT): $(top_srcdir)/prism/util/pm_constant_pool.h
|
||||
cont.$(OBJEXT): $(top_srcdir)/prism/util/pm_integer.h
|
||||
cont.$(OBJEXT): $(top_srcdir)/prism/util/pm_list.h
|
||||
cont.$(OBJEXT): $(top_srcdir)/prism/util/pm_memchr.h
|
||||
cont.$(OBJEXT): $(top_srcdir)/prism/util/pm_newline_list.h
|
||||
|
@ -6742,6 +6747,7 @@ eval.$(OBJEXT): $(top_srcdir)/prism/regexp.h
|
|||
eval.$(OBJEXT): $(top_srcdir)/prism/util/pm_buffer.h
|
||||
eval.$(OBJEXT): $(top_srcdir)/prism/util/pm_char.h
|
||||
eval.$(OBJEXT): $(top_srcdir)/prism/util/pm_constant_pool.h
|
||||
eval.$(OBJEXT): $(top_srcdir)/prism/util/pm_integer.h
|
||||
eval.$(OBJEXT): $(top_srcdir)/prism/util/pm_list.h
|
||||
eval.$(OBJEXT): $(top_srcdir)/prism/util/pm_memchr.h
|
||||
eval.$(OBJEXT): $(top_srcdir)/prism/util/pm_newline_list.h
|
||||
|
@ -7221,6 +7227,7 @@ gc.$(OBJEXT): $(top_srcdir)/prism/regexp.h
|
|||
gc.$(OBJEXT): $(top_srcdir)/prism/util/pm_buffer.h
|
||||
gc.$(OBJEXT): $(top_srcdir)/prism/util/pm_char.h
|
||||
gc.$(OBJEXT): $(top_srcdir)/prism/util/pm_constant_pool.h
|
||||
gc.$(OBJEXT): $(top_srcdir)/prism/util/pm_integer.h
|
||||
gc.$(OBJEXT): $(top_srcdir)/prism/util/pm_list.h
|
||||
gc.$(OBJEXT): $(top_srcdir)/prism/util/pm_memchr.h
|
||||
gc.$(OBJEXT): $(top_srcdir)/prism/util/pm_newline_list.h
|
||||
|
@ -7476,6 +7483,7 @@ goruby.$(OBJEXT): $(top_srcdir)/prism/regexp.h
|
|||
goruby.$(OBJEXT): $(top_srcdir)/prism/util/pm_buffer.h
|
||||
goruby.$(OBJEXT): $(top_srcdir)/prism/util/pm_char.h
|
||||
goruby.$(OBJEXT): $(top_srcdir)/prism/util/pm_constant_pool.h
|
||||
goruby.$(OBJEXT): $(top_srcdir)/prism/util/pm_integer.h
|
||||
goruby.$(OBJEXT): $(top_srcdir)/prism/util/pm_list.h
|
||||
goruby.$(OBJEXT): $(top_srcdir)/prism/util/pm_memchr.h
|
||||
goruby.$(OBJEXT): $(top_srcdir)/prism/util/pm_newline_list.h
|
||||
|
@ -7718,6 +7726,7 @@ hash.$(OBJEXT): $(top_srcdir)/prism/regexp.h
|
|||
hash.$(OBJEXT): $(top_srcdir)/prism/util/pm_buffer.h
|
||||
hash.$(OBJEXT): $(top_srcdir)/prism/util/pm_char.h
|
||||
hash.$(OBJEXT): $(top_srcdir)/prism/util/pm_constant_pool.h
|
||||
hash.$(OBJEXT): $(top_srcdir)/prism/util/pm_integer.h
|
||||
hash.$(OBJEXT): $(top_srcdir)/prism/util/pm_list.h
|
||||
hash.$(OBJEXT): $(top_srcdir)/prism/util/pm_memchr.h
|
||||
hash.$(OBJEXT): $(top_srcdir)/prism/util/pm_newline_list.h
|
||||
|
@ -8752,6 +8761,7 @@ iseq.$(OBJEXT): $(top_srcdir)/prism/regexp.h
|
|||
iseq.$(OBJEXT): $(top_srcdir)/prism/util/pm_buffer.h
|
||||
iseq.$(OBJEXT): $(top_srcdir)/prism/util/pm_char.h
|
||||
iseq.$(OBJEXT): $(top_srcdir)/prism/util/pm_constant_pool.h
|
||||
iseq.$(OBJEXT): $(top_srcdir)/prism/util/pm_integer.h
|
||||
iseq.$(OBJEXT): $(top_srcdir)/prism/util/pm_list.h
|
||||
iseq.$(OBJEXT): $(top_srcdir)/prism/util/pm_memchr.h
|
||||
iseq.$(OBJEXT): $(top_srcdir)/prism/util/pm_newline_list.h
|
||||
|
@ -9007,6 +9017,7 @@ load.$(OBJEXT): $(top_srcdir)/prism/regexp.h
|
|||
load.$(OBJEXT): $(top_srcdir)/prism/util/pm_buffer.h
|
||||
load.$(OBJEXT): $(top_srcdir)/prism/util/pm_char.h
|
||||
load.$(OBJEXT): $(top_srcdir)/prism/util/pm_constant_pool.h
|
||||
load.$(OBJEXT): $(top_srcdir)/prism/util/pm_integer.h
|
||||
load.$(OBJEXT): $(top_srcdir)/prism/util/pm_list.h
|
||||
load.$(OBJEXT): $(top_srcdir)/prism/util/pm_memchr.h
|
||||
load.$(OBJEXT): $(top_srcdir)/prism/util/pm_newline_list.h
|
||||
|
@ -10336,6 +10347,7 @@ miniinit.$(OBJEXT): $(top_srcdir)/prism/regexp.h
|
|||
miniinit.$(OBJEXT): $(top_srcdir)/prism/util/pm_buffer.h
|
||||
miniinit.$(OBJEXT): $(top_srcdir)/prism/util/pm_char.h
|
||||
miniinit.$(OBJEXT): $(top_srcdir)/prism/util/pm_constant_pool.h
|
||||
miniinit.$(OBJEXT): $(top_srcdir)/prism/util/pm_integer.h
|
||||
miniinit.$(OBJEXT): $(top_srcdir)/prism/util/pm_list.h
|
||||
miniinit.$(OBJEXT): $(top_srcdir)/prism/util/pm_memchr.h
|
||||
miniinit.$(OBJEXT): $(top_srcdir)/prism/util/pm_newline_list.h
|
||||
|
@ -11917,6 +11929,7 @@ prism/api_node.$(OBJEXT): $(top_srcdir)/prism/regexp.h
|
|||
prism/api_node.$(OBJEXT): $(top_srcdir)/prism/util/pm_buffer.h
|
||||
prism/api_node.$(OBJEXT): $(top_srcdir)/prism/util/pm_char.h
|
||||
prism/api_node.$(OBJEXT): $(top_srcdir)/prism/util/pm_constant_pool.h
|
||||
prism/api_node.$(OBJEXT): $(top_srcdir)/prism/util/pm_integer.h
|
||||
prism/api_node.$(OBJEXT): $(top_srcdir)/prism/util/pm_list.h
|
||||
prism/api_node.$(OBJEXT): $(top_srcdir)/prism/util/pm_memchr.h
|
||||
prism/api_node.$(OBJEXT): $(top_srcdir)/prism/util/pm_newline_list.h
|
||||
|
@ -12111,6 +12124,7 @@ prism/api_pack.$(OBJEXT): $(top_srcdir)/prism/regexp.h
|
|||
prism/api_pack.$(OBJEXT): $(top_srcdir)/prism/util/pm_buffer.h
|
||||
prism/api_pack.$(OBJEXT): $(top_srcdir)/prism/util/pm_char.h
|
||||
prism/api_pack.$(OBJEXT): $(top_srcdir)/prism/util/pm_constant_pool.h
|
||||
prism/api_pack.$(OBJEXT): $(top_srcdir)/prism/util/pm_integer.h
|
||||
prism/api_pack.$(OBJEXT): $(top_srcdir)/prism/util/pm_list.h
|
||||
prism/api_pack.$(OBJEXT): $(top_srcdir)/prism/util/pm_memchr.h
|
||||
prism/api_pack.$(OBJEXT): $(top_srcdir)/prism/util/pm_newline_list.h
|
||||
|
@ -12291,6 +12305,7 @@ prism/diagnostic.$(OBJEXT): $(top_srcdir)/prism/defines.h
|
|||
prism/diagnostic.$(OBJEXT): $(top_srcdir)/prism/diagnostic.c
|
||||
prism/diagnostic.$(OBJEXT): $(top_srcdir)/prism/diagnostic.h
|
||||
prism/diagnostic.$(OBJEXT): $(top_srcdir)/prism/util/pm_constant_pool.h
|
||||
prism/diagnostic.$(OBJEXT): $(top_srcdir)/prism/util/pm_integer.h
|
||||
prism/diagnostic.$(OBJEXT): $(top_srcdir)/prism/util/pm_list.h
|
||||
prism/diagnostic.$(OBJEXT): $(top_srcdir)/prism/util/pm_string.h
|
||||
prism/diagnostic.$(OBJEXT): {$(VPATH)}config.h
|
||||
|
@ -12317,6 +12332,7 @@ prism/extension.$(OBJEXT): $(top_srcdir)/prism/regexp.h
|
|||
prism/extension.$(OBJEXT): $(top_srcdir)/prism/util/pm_buffer.h
|
||||
prism/extension.$(OBJEXT): $(top_srcdir)/prism/util/pm_char.h
|
||||
prism/extension.$(OBJEXT): $(top_srcdir)/prism/util/pm_constant_pool.h
|
||||
prism/extension.$(OBJEXT): $(top_srcdir)/prism/util/pm_integer.h
|
||||
prism/extension.$(OBJEXT): $(top_srcdir)/prism/util/pm_list.h
|
||||
prism/extension.$(OBJEXT): $(top_srcdir)/prism/util/pm_memchr.h
|
||||
prism/extension.$(OBJEXT): $(top_srcdir)/prism/util/pm_newline_list.h
|
||||
|
@ -12505,6 +12521,7 @@ prism/node.$(OBJEXT): $(top_srcdir)/prism/regexp.h
|
|||
prism/node.$(OBJEXT): $(top_srcdir)/prism/util/pm_buffer.h
|
||||
prism/node.$(OBJEXT): $(top_srcdir)/prism/util/pm_char.h
|
||||
prism/node.$(OBJEXT): $(top_srcdir)/prism/util/pm_constant_pool.h
|
||||
prism/node.$(OBJEXT): $(top_srcdir)/prism/util/pm_integer.h
|
||||
prism/node.$(OBJEXT): $(top_srcdir)/prism/util/pm_list.h
|
||||
prism/node.$(OBJEXT): $(top_srcdir)/prism/util/pm_newline_list.h
|
||||
prism/node.$(OBJEXT): $(top_srcdir)/prism/util/pm_state_stack.h
|
||||
|
@ -12531,6 +12548,7 @@ prism/prettyprint.$(OBJEXT): $(top_srcdir)/prism/prettyprint.h
|
|||
prism/prettyprint.$(OBJEXT): $(top_srcdir)/prism/util/pm_buffer.h
|
||||
prism/prettyprint.$(OBJEXT): $(top_srcdir)/prism/util/pm_char.h
|
||||
prism/prettyprint.$(OBJEXT): $(top_srcdir)/prism/util/pm_constant_pool.h
|
||||
prism/prettyprint.$(OBJEXT): $(top_srcdir)/prism/util/pm_integer.h
|
||||
prism/prettyprint.$(OBJEXT): $(top_srcdir)/prism/util/pm_list.h
|
||||
prism/prettyprint.$(OBJEXT): $(top_srcdir)/prism/util/pm_newline_list.h
|
||||
prism/prettyprint.$(OBJEXT): $(top_srcdir)/prism/util/pm_state_stack.h
|
||||
|
@ -12553,6 +12571,7 @@ prism/prism.$(OBJEXT): $(top_srcdir)/prism/regexp.h
|
|||
prism/prism.$(OBJEXT): $(top_srcdir)/prism/util/pm_buffer.h
|
||||
prism/prism.$(OBJEXT): $(top_srcdir)/prism/util/pm_char.h
|
||||
prism/prism.$(OBJEXT): $(top_srcdir)/prism/util/pm_constant_pool.h
|
||||
prism/prism.$(OBJEXT): $(top_srcdir)/prism/util/pm_integer.h
|
||||
prism/prism.$(OBJEXT): $(top_srcdir)/prism/util/pm_list.h
|
||||
prism/prism.$(OBJEXT): $(top_srcdir)/prism/util/pm_memchr.h
|
||||
prism/prism.$(OBJEXT): $(top_srcdir)/prism/util/pm_newline_list.h
|
||||
|
@ -12572,6 +12591,7 @@ prism/regexp.$(OBJEXT): $(top_srcdir)/prism/parser.h
|
|||
prism/regexp.$(OBJEXT): $(top_srcdir)/prism/regexp.c
|
||||
prism/regexp.$(OBJEXT): $(top_srcdir)/prism/regexp.h
|
||||
prism/regexp.$(OBJEXT): $(top_srcdir)/prism/util/pm_constant_pool.h
|
||||
prism/regexp.$(OBJEXT): $(top_srcdir)/prism/util/pm_integer.h
|
||||
prism/regexp.$(OBJEXT): $(top_srcdir)/prism/util/pm_list.h
|
||||
prism/regexp.$(OBJEXT): $(top_srcdir)/prism/util/pm_memchr.h
|
||||
prism/regexp.$(OBJEXT): $(top_srcdir)/prism/util/pm_newline_list.h
|
||||
|
@ -12594,6 +12614,7 @@ prism/serialize.$(OBJEXT): $(top_srcdir)/prism/regexp.h
|
|||
prism/serialize.$(OBJEXT): $(top_srcdir)/prism/util/pm_buffer.h
|
||||
prism/serialize.$(OBJEXT): $(top_srcdir)/prism/util/pm_char.h
|
||||
prism/serialize.$(OBJEXT): $(top_srcdir)/prism/util/pm_constant_pool.h
|
||||
prism/serialize.$(OBJEXT): $(top_srcdir)/prism/util/pm_integer.h
|
||||
prism/serialize.$(OBJEXT): $(top_srcdir)/prism/util/pm_list.h
|
||||
prism/serialize.$(OBJEXT): $(top_srcdir)/prism/util/pm_memchr.h
|
||||
prism/serialize.$(OBJEXT): $(top_srcdir)/prism/util/pm_newline_list.h
|
||||
|
@ -12608,6 +12629,7 @@ prism/serialize.$(OBJEXT): {$(VPATH)}prism/serialize.c
|
|||
prism/serialize.$(OBJEXT): {$(VPATH)}prism/version.h
|
||||
prism/token_type.$(OBJEXT): $(top_srcdir)/prism/defines.h
|
||||
prism/token_type.$(OBJEXT): $(top_srcdir)/prism/util/pm_constant_pool.h
|
||||
prism/token_type.$(OBJEXT): $(top_srcdir)/prism/util/pm_integer.h
|
||||
prism/token_type.$(OBJEXT): $(top_srcdir)/prism/util/pm_string.h
|
||||
prism/token_type.$(OBJEXT): {$(VPATH)}config.h
|
||||
prism/token_type.$(OBJEXT): {$(VPATH)}prism/ast.h
|
||||
|
@ -12627,6 +12649,9 @@ prism/util/pm_constant_pool.$(OBJEXT): $(top_srcdir)/prism/defines.h
|
|||
prism/util/pm_constant_pool.$(OBJEXT): $(top_srcdir)/prism/util/pm_constant_pool.c
|
||||
prism/util/pm_constant_pool.$(OBJEXT): $(top_srcdir)/prism/util/pm_constant_pool.h
|
||||
prism/util/pm_constant_pool.$(OBJEXT): {$(VPATH)}config.h
|
||||
prism/util/pm_integer.$(OBJEXT): $(top_srcdir)/prism/defines.h
|
||||
prism/util/pm_integer.$(OBJEXT): $(top_srcdir)/prism/util/pm_integer.c
|
||||
prism/util/pm_integer.$(OBJEXT): $(top_srcdir)/prism/util/pm_integer.h
|
||||
prism/util/pm_list.$(OBJEXT): $(top_srcdir)/prism/defines.h
|
||||
prism/util/pm_list.$(OBJEXT): $(top_srcdir)/prism/util/pm_list.c
|
||||
prism/util/pm_list.$(OBJEXT): $(top_srcdir)/prism/util/pm_list.h
|
||||
|
@ -12670,6 +12695,7 @@ prism/util/pm_strpbrk.$(OBJEXT): $(top_srcdir)/prism/encoding.h
|
|||
prism/util/pm_strpbrk.$(OBJEXT): $(top_srcdir)/prism/options.h
|
||||
prism/util/pm_strpbrk.$(OBJEXT): $(top_srcdir)/prism/parser.h
|
||||
prism/util/pm_strpbrk.$(OBJEXT): $(top_srcdir)/prism/util/pm_constant_pool.h
|
||||
prism/util/pm_strpbrk.$(OBJEXT): $(top_srcdir)/prism/util/pm_integer.h
|
||||
prism/util/pm_strpbrk.$(OBJEXT): $(top_srcdir)/prism/util/pm_list.h
|
||||
prism/util/pm_strpbrk.$(OBJEXT): $(top_srcdir)/prism/util/pm_newline_list.h
|
||||
prism/util/pm_strpbrk.$(OBJEXT): $(top_srcdir)/prism/util/pm_state_stack.h
|
||||
|
@ -12695,6 +12721,7 @@ prism_init.$(OBJEXT): $(top_srcdir)/prism/regexp.h
|
|||
prism_init.$(OBJEXT): $(top_srcdir)/prism/util/pm_buffer.h
|
||||
prism_init.$(OBJEXT): $(top_srcdir)/prism/util/pm_char.h
|
||||
prism_init.$(OBJEXT): $(top_srcdir)/prism/util/pm_constant_pool.h
|
||||
prism_init.$(OBJEXT): $(top_srcdir)/prism/util/pm_integer.h
|
||||
prism_init.$(OBJEXT): $(top_srcdir)/prism/util/pm_list.h
|
||||
prism_init.$(OBJEXT): $(top_srcdir)/prism/util/pm_memchr.h
|
||||
prism_init.$(OBJEXT): $(top_srcdir)/prism/util/pm_newline_list.h
|
||||
|
@ -12910,6 +12937,7 @@ proc.$(OBJEXT): $(top_srcdir)/prism/regexp.h
|
|||
proc.$(OBJEXT): $(top_srcdir)/prism/util/pm_buffer.h
|
||||
proc.$(OBJEXT): $(top_srcdir)/prism/util/pm_char.h
|
||||
proc.$(OBJEXT): $(top_srcdir)/prism/util/pm_constant_pool.h
|
||||
proc.$(OBJEXT): $(top_srcdir)/prism/util/pm_integer.h
|
||||
proc.$(OBJEXT): $(top_srcdir)/prism/util/pm_list.h
|
||||
proc.$(OBJEXT): $(top_srcdir)/prism/util/pm_memchr.h
|
||||
proc.$(OBJEXT): $(top_srcdir)/prism/util/pm_newline_list.h
|
||||
|
@ -15392,6 +15420,7 @@ rjit.$(OBJEXT): $(top_srcdir)/prism/regexp.h
|
|||
rjit.$(OBJEXT): $(top_srcdir)/prism/util/pm_buffer.h
|
||||
rjit.$(OBJEXT): $(top_srcdir)/prism/util/pm_char.h
|
||||
rjit.$(OBJEXT): $(top_srcdir)/prism/util/pm_constant_pool.h
|
||||
rjit.$(OBJEXT): $(top_srcdir)/prism/util/pm_integer.h
|
||||
rjit.$(OBJEXT): $(top_srcdir)/prism/util/pm_list.h
|
||||
rjit.$(OBJEXT): $(top_srcdir)/prism/util/pm_memchr.h
|
||||
rjit.$(OBJEXT): $(top_srcdir)/prism/util/pm_newline_list.h
|
||||
|
@ -15644,6 +15673,7 @@ rjit_c.$(OBJEXT): $(top_srcdir)/prism/regexp.h
|
|||
rjit_c.$(OBJEXT): $(top_srcdir)/prism/util/pm_buffer.h
|
||||
rjit_c.$(OBJEXT): $(top_srcdir)/prism/util/pm_char.h
|
||||
rjit_c.$(OBJEXT): $(top_srcdir)/prism/util/pm_constant_pool.h
|
||||
rjit_c.$(OBJEXT): $(top_srcdir)/prism/util/pm_integer.h
|
||||
rjit_c.$(OBJEXT): $(top_srcdir)/prism/util/pm_list.h
|
||||
rjit_c.$(OBJEXT): $(top_srcdir)/prism/util/pm_memchr.h
|
||||
rjit_c.$(OBJEXT): $(top_srcdir)/prism/util/pm_newline_list.h
|
||||
|
@ -15922,6 +15952,7 @@ ruby.$(OBJEXT): $(top_srcdir)/prism/regexp.h
|
|||
ruby.$(OBJEXT): $(top_srcdir)/prism/util/pm_buffer.h
|
||||
ruby.$(OBJEXT): $(top_srcdir)/prism/util/pm_char.h
|
||||
ruby.$(OBJEXT): $(top_srcdir)/prism/util/pm_constant_pool.h
|
||||
ruby.$(OBJEXT): $(top_srcdir)/prism/util/pm_integer.h
|
||||
ruby.$(OBJEXT): $(top_srcdir)/prism/util/pm_list.h
|
||||
ruby.$(OBJEXT): $(top_srcdir)/prism/util/pm_memchr.h
|
||||
ruby.$(OBJEXT): $(top_srcdir)/prism/util/pm_newline_list.h
|
||||
|
@ -18362,6 +18393,7 @@ thread.$(OBJEXT): $(top_srcdir)/prism/regexp.h
|
|||
thread.$(OBJEXT): $(top_srcdir)/prism/util/pm_buffer.h
|
||||
thread.$(OBJEXT): $(top_srcdir)/prism/util/pm_char.h
|
||||
thread.$(OBJEXT): $(top_srcdir)/prism/util/pm_constant_pool.h
|
||||
thread.$(OBJEXT): $(top_srcdir)/prism/util/pm_integer.h
|
||||
thread.$(OBJEXT): $(top_srcdir)/prism/util/pm_list.h
|
||||
thread.$(OBJEXT): $(top_srcdir)/prism/util/pm_memchr.h
|
||||
thread.$(OBJEXT): $(top_srcdir)/prism/util/pm_newline_list.h
|
||||
|
@ -19622,6 +19654,7 @@ vm.$(OBJEXT): $(top_srcdir)/prism/regexp.h
|
|||
vm.$(OBJEXT): $(top_srcdir)/prism/util/pm_buffer.h
|
||||
vm.$(OBJEXT): $(top_srcdir)/prism/util/pm_char.h
|
||||
vm.$(OBJEXT): $(top_srcdir)/prism/util/pm_constant_pool.h
|
||||
vm.$(OBJEXT): $(top_srcdir)/prism/util/pm_integer.h
|
||||
vm.$(OBJEXT): $(top_srcdir)/prism/util/pm_list.h
|
||||
vm.$(OBJEXT): $(top_srcdir)/prism/util/pm_memchr.h
|
||||
vm.$(OBJEXT): $(top_srcdir)/prism/util/pm_newline_list.h
|
||||
|
@ -19879,6 +19912,7 @@ vm_backtrace.$(OBJEXT): $(top_srcdir)/prism/regexp.h
|
|||
vm_backtrace.$(OBJEXT): $(top_srcdir)/prism/util/pm_buffer.h
|
||||
vm_backtrace.$(OBJEXT): $(top_srcdir)/prism/util/pm_char.h
|
||||
vm_backtrace.$(OBJEXT): $(top_srcdir)/prism/util/pm_constant_pool.h
|
||||
vm_backtrace.$(OBJEXT): $(top_srcdir)/prism/util/pm_integer.h
|
||||
vm_backtrace.$(OBJEXT): $(top_srcdir)/prism/util/pm_list.h
|
||||
vm_backtrace.$(OBJEXT): $(top_srcdir)/prism/util/pm_memchr.h
|
||||
vm_backtrace.$(OBJEXT): $(top_srcdir)/prism/util/pm_newline_list.h
|
||||
|
@ -20108,6 +20142,7 @@ vm_dump.$(OBJEXT): $(top_srcdir)/prism/regexp.h
|
|||
vm_dump.$(OBJEXT): $(top_srcdir)/prism/util/pm_buffer.h
|
||||
vm_dump.$(OBJEXT): $(top_srcdir)/prism/util/pm_char.h
|
||||
vm_dump.$(OBJEXT): $(top_srcdir)/prism/util/pm_constant_pool.h
|
||||
vm_dump.$(OBJEXT): $(top_srcdir)/prism/util/pm_integer.h
|
||||
vm_dump.$(OBJEXT): $(top_srcdir)/prism/util/pm_list.h
|
||||
vm_dump.$(OBJEXT): $(top_srcdir)/prism/util/pm_memchr.h
|
||||
vm_dump.$(OBJEXT): $(top_srcdir)/prism/util/pm_newline_list.h
|
||||
|
@ -20548,6 +20583,7 @@ vm_trace.$(OBJEXT): $(top_srcdir)/prism/regexp.h
|
|||
vm_trace.$(OBJEXT): $(top_srcdir)/prism/util/pm_buffer.h
|
||||
vm_trace.$(OBJEXT): $(top_srcdir)/prism/util/pm_char.h
|
||||
vm_trace.$(OBJEXT): $(top_srcdir)/prism/util/pm_constant_pool.h
|
||||
vm_trace.$(OBJEXT): $(top_srcdir)/prism/util/pm_integer.h
|
||||
vm_trace.$(OBJEXT): $(top_srcdir)/prism/util/pm_list.h
|
||||
vm_trace.$(OBJEXT): $(top_srcdir)/prism/util/pm_memchr.h
|
||||
vm_trace.$(OBJEXT): $(top_srcdir)/prism/util/pm_newline_list.h
|
||||
|
@ -20988,6 +21024,7 @@ yjit.$(OBJEXT): $(top_srcdir)/prism/regexp.h
|
|||
yjit.$(OBJEXT): $(top_srcdir)/prism/util/pm_buffer.h
|
||||
yjit.$(OBJEXT): $(top_srcdir)/prism/util/pm_char.h
|
||||
yjit.$(OBJEXT): $(top_srcdir)/prism/util/pm_constant_pool.h
|
||||
yjit.$(OBJEXT): $(top_srcdir)/prism/util/pm_integer.h
|
||||
yjit.$(OBJEXT): $(top_srcdir)/prism/util/pm_list.h
|
||||
yjit.$(OBJEXT): $(top_srcdir)/prism/util/pm_memchr.h
|
||||
yjit.$(OBJEXT): $(top_srcdir)/prism/util/pm_newline_list.h
|
||||
|
|
104
prism_compile.c
104
prism_compile.c
|
@ -118,61 +118,51 @@ pm_node_line_number(const pm_parser_t *parser, const pm_node_t *node)
|
|||
return (int) pm_newline_list_line_column(&parser->newline_list, node->location.start, parser->start_line).line;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the value of an integer node into a Ruby Integer.
|
||||
*/
|
||||
static VALUE
|
||||
parse_integer(const pm_integer_node_t *node)
|
||||
{
|
||||
char *start = (char *) node->base.location.start;
|
||||
char *end = (char *) node->base.location.end;
|
||||
const pm_integer_t *integer = &node->value;
|
||||
|
||||
size_t length = end - start;
|
||||
int base = -10;
|
||||
VALUE result = UINT2NUM(integer->head.value);
|
||||
size_t shift = 0;
|
||||
|
||||
switch (node->base.flags & (PM_INTEGER_BASE_FLAGS_BINARY | PM_INTEGER_BASE_FLAGS_DECIMAL | PM_INTEGER_BASE_FLAGS_OCTAL | PM_INTEGER_BASE_FLAGS_HEXADECIMAL)) {
|
||||
case PM_INTEGER_BASE_FLAGS_BINARY:
|
||||
base = 2;
|
||||
break;
|
||||
case PM_INTEGER_BASE_FLAGS_DECIMAL:
|
||||
base = 10;
|
||||
break;
|
||||
case PM_INTEGER_BASE_FLAGS_OCTAL:
|
||||
base = 8;
|
||||
break;
|
||||
case PM_INTEGER_BASE_FLAGS_HEXADECIMAL:
|
||||
base = 16;
|
||||
break;
|
||||
default:
|
||||
rb_bug("Unreachable");
|
||||
for (pm_integer_word_t *node = integer->head.next; node != NULL; node = node->next) {
|
||||
VALUE receiver = rb_funcall(UINT2NUM(node->value), rb_intern("<<"), 1, ULONG2NUM(++shift * 32));
|
||||
result = rb_funcall(receiver, rb_intern("|"), 1, result);
|
||||
}
|
||||
|
||||
return rb_int_parse_cstr(start, length, &end, NULL, base, RB_INT_PARSE_DEFAULT);
|
||||
if (integer->negative) result = rb_funcall(result, rb_intern("-@"), 0);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the value of a float node into a Ruby Float.
|
||||
*/
|
||||
static VALUE
|
||||
parse_float(const pm_node_t *node)
|
||||
parse_float(const pm_float_node_t *node)
|
||||
{
|
||||
const uint8_t *start = node->location.start;
|
||||
const uint8_t *end = node->location.end;
|
||||
size_t length = end - start;
|
||||
|
||||
char *buffer = malloc(length + 1);
|
||||
memcpy(buffer, start, length);
|
||||
|
||||
buffer[length] = '\0';
|
||||
VALUE number = DBL2NUM(rb_cstr_to_dbl(buffer, 0));
|
||||
|
||||
free(buffer);
|
||||
return number;
|
||||
return DBL2NUM(node->value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the value of a rational node into a Ruby Rational. Rational nodes can
|
||||
* either be wrapping an integer node or a float node. If it's an integer node,
|
||||
* we can reuse our parsing. If it's not, then we'll parse the numerator and
|
||||
* then parse the denominator and create the rational from those two values.
|
||||
*/
|
||||
static VALUE
|
||||
parse_rational(const pm_node_t *node)
|
||||
parse_rational(const pm_rational_node_t *node)
|
||||
{
|
||||
const uint8_t *start = node->location.start;
|
||||
const uint8_t *end = node->location.end - 1;
|
||||
size_t length = end - start;
|
||||
VALUE result;
|
||||
|
||||
if (PM_NODE_TYPE_P(node->numeric, PM_FLOAT_NODE)) {
|
||||
const uint8_t *start = node->base.location.start;
|
||||
const uint8_t *end = node->base.location.end - 1;
|
||||
size_t length = end - start;
|
||||
|
||||
VALUE res;
|
||||
if (PM_NODE_TYPE_P(((pm_rational_node_t *)node)->numeric, PM_FLOAT_NODE)) {
|
||||
char *buffer = malloc(length + 1);
|
||||
memcpy(buffer, start, length);
|
||||
|
||||
|
@ -184,35 +174,41 @@ parse_rational(const pm_node_t *node)
|
|||
size_t fraclen = length - seen_decimal - 1;
|
||||
memmove(decimal, decimal + 1, fraclen + 1);
|
||||
|
||||
VALUE v = rb_cstr_to_inum(buffer, 10, false);
|
||||
res = rb_rational_new(v, rb_int_positive_pow(10, fraclen));
|
||||
VALUE numerator = rb_cstr_to_inum(buffer, 10, false);
|
||||
result = rb_rational_new(numerator, rb_int_positive_pow(10, fraclen));
|
||||
|
||||
free(buffer);
|
||||
}
|
||||
else {
|
||||
RUBY_ASSERT(PM_NODE_TYPE_P(((pm_rational_node_t *)node)->numeric, PM_INTEGER_NODE));
|
||||
VALUE number = rb_int_parse_cstr((const char *)start, length, NULL, NULL, -10, RB_INT_PARSE_DEFAULT);
|
||||
res = rb_rational_raw(number, INT2FIX(1));
|
||||
RUBY_ASSERT(PM_NODE_TYPE_P(node->numeric, PM_INTEGER_NODE));
|
||||
VALUE numerator = parse_integer((const pm_integer_node_t *) node->numeric);
|
||||
result = rb_rational_raw(numerator, INT2FIX(1));
|
||||
}
|
||||
|
||||
return res;
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert the value of an imaginary node into a Ruby Complex. Imaginary nodes
|
||||
* can be wrapping an integer node, a float node, or a rational node. In all
|
||||
* cases we will reuse parsing functions seen above to get the inner value, and
|
||||
* then convert into an imaginary with rb_complex_raw.
|
||||
*/
|
||||
static VALUE
|
||||
parse_imaginary(pm_imaginary_node_t *node)
|
||||
{
|
||||
VALUE imaginary_part;
|
||||
switch (PM_NODE_TYPE(node->numeric)) {
|
||||
case PM_FLOAT_NODE: {
|
||||
imaginary_part = parse_float(node->numeric);
|
||||
imaginary_part = parse_float((const pm_float_node_t *) node->numeric);
|
||||
break;
|
||||
}
|
||||
case PM_INTEGER_NODE: {
|
||||
imaginary_part = parse_integer((pm_integer_node_t *) node->numeric);
|
||||
imaginary_part = parse_integer((const pm_integer_node_t *) node->numeric);
|
||||
break;
|
||||
}
|
||||
case PM_RATIONAL_NODE: {
|
||||
imaginary_part = parse_rational(node->numeric);
|
||||
imaginary_part = parse_rational((const pm_rational_node_t *) node->numeric);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
|
@ -409,7 +405,7 @@ pm_static_literal_value(const pm_node_t *node, const pm_scope_node_t *scope_node
|
|||
case PM_FALSE_NODE:
|
||||
return Qfalse;
|
||||
case PM_FLOAT_NODE:
|
||||
return parse_float(node);
|
||||
return parse_float((const pm_float_node_t *) node);
|
||||
case PM_HASH_NODE: {
|
||||
pm_hash_node_t *cast = (pm_hash_node_t *) node;
|
||||
pm_node_list_t *elements = &cast->elements;
|
||||
|
@ -432,11 +428,11 @@ pm_static_literal_value(const pm_node_t *node, const pm_scope_node_t *scope_node
|
|||
case PM_IMAGINARY_NODE:
|
||||
return parse_imaginary((pm_imaginary_node_t *) node);
|
||||
case PM_INTEGER_NODE:
|
||||
return parse_integer((pm_integer_node_t *) node);
|
||||
return parse_integer((const pm_integer_node_t *) node);
|
||||
case PM_NIL_NODE:
|
||||
return Qnil;
|
||||
case PM_RATIONAL_NODE:
|
||||
return parse_rational(node);
|
||||
return parse_rational((const pm_rational_node_t *) node);
|
||||
case PM_REGULAR_EXPRESSION_NODE: {
|
||||
pm_regular_expression_node_t *cast = (pm_regular_expression_node_t *) node;
|
||||
|
||||
|
@ -5474,7 +5470,7 @@ pm_compile_node(rb_iseq_t *iseq, const pm_node_t *node, LINK_ANCHOR *const ret,
|
|||
}
|
||||
case PM_FLOAT_NODE: {
|
||||
if (!popped) {
|
||||
ADD_INSN1(ret, &dummy_line_node, putobject, parse_float(node));
|
||||
ADD_INSN1(ret, &dummy_line_node, putobject, parse_float((const pm_float_node_t *) node));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -5919,7 +5915,7 @@ pm_compile_node(rb_iseq_t *iseq, const pm_node_t *node, LINK_ANCHOR *const ret,
|
|||
}
|
||||
case PM_INTEGER_NODE: {
|
||||
if (!popped) {
|
||||
ADD_INSN1(ret, &dummy_line_node, putobject, parse_integer((pm_integer_node_t *) node));
|
||||
ADD_INSN1(ret, &dummy_line_node, putobject, parse_integer((const pm_integer_node_t *) node));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
@ -6623,7 +6619,7 @@ pm_compile_node(rb_iseq_t *iseq, const pm_node_t *node, LINK_ANCHOR *const ret,
|
|||
// 1r
|
||||
// ^^
|
||||
if (!popped) {
|
||||
PUSH_INSN1(ret, location, putobject, parse_rational(node));
|
||||
PUSH_INSN1(ret, location, putobject, parse_rational((const pm_rational_node_t *) node));
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче