ruby-changes:40348
From: nobu <ko1@a...>
Date: Tue, 3 Nov 2015 08:08:39 +0900 (JST)
Subject: [ruby-changes:40348] nobu:r52429 (trunk): keywords: make name singed
nobu 2015-11-03 08:08:26 +0900 (Tue, 03 Nov 2015) New Revision: 52429 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=52429 Log: keywords: make name singed * defs/keywords (kwtable::name): turn into singed int, as gperf fills invalid slots with -1. Modified files: trunk/Makefile.in trunk/defs/keywords trunk/defs/lex.c.src trunk/lex.c.blt Index: defs/lex.c.src =================================================================== --- defs/lex.c.src (revision 52428) +++ defs/lex.c.src (revision 52429) @@ -1,5 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/defs/lex.c.src#L1 %{ -struct kwtable {unsigned int name, id[2], state;}; +struct kwtable {int name, id[2], state;}; const struct kwtable *rb_reserved_word(const char *, unsigned int); #ifndef RIPPER static const struct kwtable *reserved_word(const char *, unsigned int); Index: defs/keywords =================================================================== --- defs/keywords (revision 52428) +++ defs/keywords (revision 52429) @@ -1,5 +1,5 @@ https://github.com/ruby/ruby/blob/trunk/defs/keywords#L1 %{ -struct kwtable {unsigned int name, id[2], state;}; +struct kwtable {int name, id[2], state;}; const struct kwtable *rb_reserved_word(const char *, unsigned int); #ifndef RIPPER static const struct kwtable *reserved_word(const char *, unsigned int); Index: lex.c.blt =================================================================== --- lex.c.blt (revision 52428) +++ lex.c.blt (revision 52429) @@ -30,7 +30,7 @@ error "gperf generated tables don't work https://github.com/ruby/ruby/blob/trunk/lex.c.blt#L30 #line 1 "defs/keywords" -struct kwtable {unsigned int name, id[2], state;}; +struct kwtable {int name, id[2], state;}; const struct kwtable *rb_reserved_word(const char *, unsigned int); #ifndef RIPPER static const struct kwtable *reserved_word(const char *, unsigned int); Index: Makefile.in =================================================================== --- Makefile.in (revision 52428) +++ Makefile.in (revision 52429) @@ -328,7 +328,7 @@ lex.c: defs/keywords https://github.com/ruby/ruby/blob/trunk/Makefile.in#L328 else \ [ $(Q) ] && echo generating $@ || set -x; \ gperf -C -P -p -j1 -i 1 -g -o -t -N rb_reserved_word -k1,3,$$ $? \ - | sed 's/(int)(long)&((\(struct stringpool_t\) *\*)0)->\(stringpool_[a-z0-9]*\)/offsetof(\1, \2)/g' \ + | sed 's/(long)&((\(struct stringpool_t\) *\*)0)->\(stringpool_[a-z0-9]*\)/offsetof(\1, \2)/g' \ > $@.tmp && \ $(MV) $@.tmp $@ && \ $(CP) $? $(srcdir)/defs/lex.c.src && \ -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/