Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

* defs/keywords (reserved_word): made inline function static.

  [ruby-core:23210]

* parse.y (rb_reserved_word): ordinary function for ripper.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23436 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
commit 78e376a3eeab15deb1d1a240bb9b575691178a46 1 parent d2c07ec
Nobuyoshi Nakada nobu authored
7 ChangeLog
... ... @@ -1,3 +1,10 @@
  1 +Sat May 16 09:30:14 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
  2 +
  3 + * defs/keywords (reserved_word): made inline function static.
  4 + [ruby-core:23210]
  5 +
  6 + * parse.y (rb_reserved_word): ordinary function for ripper.
  7 +
1 8 Sat May 16 09:19:16 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
2 9
3 10 * parse.y (magic_comment_encoding): use rb_compile_warning() to
2  defs/keywords
@@ -2,6 +2,8 @@
2 2 struct kwtable {const char *name; int id[2]; enum lex_state_e state;};
3 3 const struct kwtable *rb_reserved_word(const char *, unsigned int);
4 4 #ifndef RIPPER
  5 +static const struct kwtable *reserved_word(const char *, unsigned int);
  6 +#define rb_reserved_word(str, len) reserved_word(str, len)
5 7 %}
6 8
7 9 struct kwtable;
2  defs/lex.c.src
@@ -2,6 +2,8 @@
2 2 struct kwtable {const char *name; int id[2]; enum lex_state_e state;};
3 3 const struct kwtable *rb_reserved_word(const char *, unsigned int);
4 4 #ifndef RIPPER
  5 +static const struct kwtable *reserved_word(const char *, unsigned int);
  6 +#define rb_reserved_word(str, len) reserved_word(str, len)
5 7 %}
6 8
7 9 struct kwtable;
96 lex.c.blt
... ... @@ -1,5 +1,5 @@
1   -/* C code produced by gperf version 3.0.3 */
2   -/* Command-line: gperf -C -p -j1 -i 1 -g -o -t -N rb_reserved_word -k'1,3,$' keywords */
  1 +/* C code produced by gperf version 3.0.4 */
  2 +/* Command-line: gperf -C -p -j1 -i 1 -g -o -t -N rb_reserved_word -k'1,3,$' defs/keywords */
3 3
4 4 #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
5 5 && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
@@ -28,12 +28,14 @@
28 28 error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
29 29 #endif
30 30
31   -#line 1 "keywords"
  31 +#line 1 "defs/keywords"
32 32
33 33 struct kwtable {const char *name; int id[2]; enum lex_state_e state;};
34 34 const struct kwtable *rb_reserved_word(const char *, unsigned int);
35 35 #ifndef RIPPER
36   -#line 7 "keywords"
  36 +static const struct kwtable *reserved_word(const char *, unsigned int);
  37 +#define rb_reserved_word(str, len) reserved_word(str, len)
  38 +#line 9 "defs/keywords"
37 39 struct kwtable;
38 40
39 41 #define TOTAL_KEYWORDS 41
@@ -101,7 +103,7 @@ hash (str, len)
101 103
102 104 #ifdef __GNUC__
103 105 __inline
104   -#ifdef __GNUC_STDC_INLINE__
  106 +#if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
105 107 __attribute__ ((__gnu_inline__))
106 108 #endif
107 109 #endif
@@ -113,88 +115,88 @@ rb_reserved_word (str, len)
113 115 static const struct kwtable wordlist[] =
114 116 {
115 117 {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""},
116   -#line 17 "keywords"
  118 +#line 19 "defs/keywords"
117 119 {"break", {keyword_break, keyword_break}, EXPR_MID},
118   -#line 23 "keywords"
  120 +#line 25 "defs/keywords"
119 121 {"else", {keyword_else, keyword_else}, EXPR_BEG},
120   -#line 33 "keywords"
  122 +#line 35 "defs/keywords"
121 123 {"nil", {keyword_nil, keyword_nil}, EXPR_END},
122   -#line 26 "keywords"
  124 +#line 28 "defs/keywords"
123 125 {"ensure", {keyword_ensure, keyword_ensure}, EXPR_BEG},
124   -#line 25 "keywords"
  126 +#line 27 "defs/keywords"
125 127 {"end", {keyword_end, keyword_end}, EXPR_END},
126   -#line 42 "keywords"
  128 +#line 44 "defs/keywords"
127 129 {"then", {keyword_then, keyword_then}, EXPR_BEG},
128   -#line 34 "keywords"
  130 +#line 36 "defs/keywords"
129 131 {"not", {keyword_not, keyword_not}, EXPR_ARG},
130   -#line 27 "keywords"
  132 +#line 29 "defs/keywords"
131 133 {"false", {keyword_false, keyword_false}, EXPR_END},
132   -#line 40 "keywords"
  134 +#line 42 "defs/keywords"
133 135 {"self", {keyword_self, keyword_self}, EXPR_END},
134   -#line 24 "keywords"
  136 +#line 26 "defs/keywords"
135 137 {"elsif", {keyword_elsif, keyword_elsif}, EXPR_VALUE},
136   -#line 37 "keywords"
  138 +#line 39 "defs/keywords"
137 139 {"rescue", {keyword_rescue, modifier_rescue}, EXPR_MID},
138   -#line 43 "keywords"
  140 +#line 45 "defs/keywords"
139 141 {"true", {keyword_true, keyword_true}, EXPR_END},
140   -#line 46 "keywords"
  142 +#line 48 "defs/keywords"
141 143 {"until", {keyword_until, modifier_until}, EXPR_VALUE},
142   -#line 45 "keywords"
  144 +#line 47 "defs/keywords"
143 145 {"unless", {keyword_unless, modifier_unless}, EXPR_VALUE},
144   -#line 39 "keywords"
  146 +#line 41 "defs/keywords"
145 147 {"return", {keyword_return, keyword_return}, EXPR_MID},
146   -#line 20 "keywords"
  148 +#line 22 "defs/keywords"
147 149 {"def", {keyword_def, keyword_def}, EXPR_FNAME},
148   -#line 15 "keywords"
  150 +#line 17 "defs/keywords"
149 151 {"and", {keyword_and, keyword_and}, EXPR_VALUE},
150   -#line 22 "keywords"
  152 +#line 24 "defs/keywords"
151 153 {"do", {keyword_do, keyword_do}, EXPR_BEG},
152   -#line 49 "keywords"
  154 +#line 51 "defs/keywords"
153 155 {"yield", {keyword_yield, keyword_yield}, EXPR_ARG},
154   -#line 28 "keywords"
  156 +#line 30 "defs/keywords"
155 157 {"for", {keyword_for, keyword_for}, EXPR_VALUE},
156   -#line 44 "keywords"
  158 +#line 46 "defs/keywords"
157 159 {"undef", {keyword_undef, keyword_undef}, EXPR_FNAME},
158   -#line 35 "keywords"
  160 +#line 37 "defs/keywords"
159 161 {"or", {keyword_or, keyword_or}, EXPR_VALUE},
160   -#line 30 "keywords"
  162 +#line 32 "defs/keywords"
161 163 {"in", {keyword_in, keyword_in}, EXPR_VALUE},
162   -#line 47 "keywords"
  164 +#line 49 "defs/keywords"
163 165 {"when", {keyword_when, keyword_when}, EXPR_VALUE},
164   -#line 38 "keywords"
  166 +#line 40 "defs/keywords"
165 167 {"retry", {keyword_retry, keyword_retry}, EXPR_END},
166   -#line 29 "keywords"
  168 +#line 31 "defs/keywords"
167 169 {"if", {keyword_if, modifier_if}, EXPR_VALUE},
168   -#line 18 "keywords"
  170 +#line 20 "defs/keywords"
169 171 {"case", {keyword_case, keyword_case}, EXPR_VALUE},
170   -#line 36 "keywords"
  172 +#line 38 "defs/keywords"
171 173 {"redo", {keyword_redo, keyword_redo}, EXPR_END},
172   -#line 32 "keywords"
  174 +#line 34 "defs/keywords"
173 175 {"next", {keyword_next, keyword_next}, EXPR_MID},
174   -#line 41 "keywords"
  176 +#line 43 "defs/keywords"
175 177 {"super", {keyword_super, keyword_super}, EXPR_ARG},
176   -#line 31 "keywords"
  178 +#line 33 "defs/keywords"
177 179 {"module", {keyword_module, keyword_module}, EXPR_VALUE},
178   -#line 16 "keywords"
  180 +#line 18 "defs/keywords"
179 181 {"begin", {keyword_begin, keyword_begin}, EXPR_BEG},
180   -#line 10 "keywords"
  182 +#line 12 "defs/keywords"
181 183 {"__LINE__", {keyword__LINE__, keyword__LINE__}, EXPR_END},
182   -#line 11 "keywords"
  184 +#line 13 "defs/keywords"
183 185 {"__FILE__", {keyword__FILE__, keyword__FILE__}, EXPR_END},
184   -#line 9 "keywords"
  186 +#line 11 "defs/keywords"
185 187 {"__ENCODING__", {keyword__ENCODING__, keyword__ENCODING__}, EXPR_END},
186   -#line 13 "keywords"
  188 +#line 15 "defs/keywords"
187 189 {"END", {keyword_END, keyword_END}, EXPR_END},
188   -#line 14 "keywords"
  190 +#line 16 "defs/keywords"
189 191 {"alias", {keyword_alias, keyword_alias}, EXPR_FNAME},
190   -#line 12 "keywords"
  192 +#line 14 "defs/keywords"
191 193 {"BEGIN", {keyword_BEGIN, keyword_BEGIN}, EXPR_END},
192   -#line 21 "keywords"
  194 +#line 23 "defs/keywords"
193 195 {"defined?", {keyword_defined, keyword_defined}, EXPR_ARG},
194   -#line 19 "keywords"
  196 +#line 21 "defs/keywords"
195 197 {"class", {keyword_class, keyword_class}, EXPR_CLASS},
196 198 {""}, {""},
197   -#line 48 "keywords"
  199 +#line 50 "defs/keywords"
198 200 {"while", {keyword_while, modifier_while}, EXPR_VALUE}
199 201 };
200 202
@@ -212,6 +214,6 @@ rb_reserved_word (str, len)
212 214 }
213 215 return 0;
214 216 }
215   -#line 50 "keywords"
  217 +#line 52 "defs/keywords"
216 218
217 219 #endif
8 parse.y
@@ -9715,6 +9715,14 @@ VALUE rb_parser_get_yydebug(VALUE);
9715 9715 VALUE rb_parser_set_yydebug(VALUE, VALUE);
9716 9716
9717 9717 #ifndef RIPPER
  9718 +#undef rb_reserved_word
  9719 +
  9720 +const struct kwtable *
  9721 +rb_reserved_word(const char *str, unsigned int len)
  9722 +{
  9723 + return reserved_word(str, len);
  9724 +}
  9725 +
9718 9726 static struct parser_params *
9719 9727 parser_new(void)
9720 9728 {

0 comments on commit 78e376a

Please sign in to comment.
Something went wrong with that request. Please try again.