From 0ad4ae91ea6c9c489946a390b231e90c1bf9eedd Mon Sep 17 00:00:00 2001 From: aamine Date: Sun, 19 Sep 2004 18:48:29 +0000 Subject: [PATCH] * parse.y [ripper]: spaces before heredoc marker was lost. * keywords: rb_reserved_word() should be defined only in ruby core. * lex.c: sync with keywords. * ext/ripper/ripper.rb.in (parse): fix typo. * ext/ripper/lib/ripper.rb: sync with ripper.rb.in. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@6924 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 13 +++++++++++++ ext/ripper/lib/ripper.rb | 2 +- ext/ripper/ripper.rb.in | 2 +- keywords | 5 +++++ lex.c | 6 +++++- parse.y | 1 + 6 files changed, 26 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8a128ccb7e..8451c7cb08 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +Mon Sep 20 03:46:54 2004 Minero Aoki + + * parse.y [ripper]: spaces before heredoc marker was lost. + + * keywords: rb_reserved_word() should be defined only in ruby + core. + + * lex.c: sync with keywords. + + * ext/ripper/ripper.rb.in (parse): fix typo. + + * ext/ripper/lib/ripper.rb: sync with ripper.rb.in. + Mon Sep 20 03:37:59 2004 Tanaka Akira * ext/zlib/zlib.c (gzfile_read_raw): call readpartial at first. diff --git a/ext/ripper/lib/ripper.rb b/ext/ripper/lib/ripper.rb index 15a05aaddc..38b9071200 100644 --- a/ext/ripper/lib/ripper.rb +++ b/ext/ripper/lib/ripper.rb @@ -13,7 +13,7 @@ require 'ripper.so' class Ripper def Ripper.parse(str, *args) - new.parse(str, *args) + new(str, *args).parse end private diff --git a/ext/ripper/ripper.rb.in b/ext/ripper/ripper.rb.in index c6fa554296..fd155cb7bd 100644 --- a/ext/ripper/ripper.rb.in +++ b/ext/ripper/ripper.rb.in @@ -13,7 +13,7 @@ require 'ripper.so' class Ripper def Ripper.parse(str, *args) - new.parse(str, *args) + new(str, *args).parse end private diff --git a/keywords b/keywords index d79af71983..06f1f011f2 100644 --- a/keywords +++ b/keywords @@ -1,4 +1,7 @@ struct kwtable {char *name; int id[2]; enum lex_state_e state;}; +struct kwtable *rb_reserved_word _((const char *, unsigned int)); +#ifndef RIPPER + %% __LINE__, {k__LINE__, k__LINE__}, EXPR_END __FILE__, {k__FILE__, k__FILE__}, EXPR_END @@ -40,3 +43,5 @@ until, {kUNTIL, kUNTIL_MOD}, EXPR_BEG when, {kWHEN, kWHEN}, EXPR_BEG while, {kWHILE, kWHILE_MOD}, EXPR_BEG yield, {kYIELD, kYIELD}, EXPR_ARG +%% +#endif diff --git a/lex.c b/lex.c index 30c6666d4f..93b056bdef 100644 --- a/lex.c +++ b/lex.c @@ -1,6 +1,9 @@ /* C code produced by gperf version 2.7.2 */ -/* Command-line: gperf -p -j1 -i 1 -g -o -t -N rb_reserved_word -k'1,3,$' keywords */ +/* Command-line: gperf -p -j1 -i 1 -g -o -t -N rb_reserved_word -k'1,3,$' /home/aamine/c/ruby/keywords */ struct kwtable {char *name; int id[2]; enum lex_state_e state;}; +struct kwtable *rb_reserved_word _((const char *, unsigned int)); +#ifndef RIPPER +; #define TOTAL_KEYWORDS 40 #define MIN_WORD_LENGTH 2 @@ -134,3 +137,4 @@ rb_reserved_word (str, len) } return 0; } +#endif diff --git a/parse.y b/parse.y index 0976d367c7..e749d49cd3 100644 --- a/parse.y +++ b/parse.y @@ -5046,6 +5046,7 @@ parser_heredoc_identifier(parser) tokfix(); #ifdef RIPPER + ripper_dispatch_space(parser); ripper_dispatch_nonspace(parser, tHEREDOC_BEG); #endif len = lex_p - lex_pbeg;