mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* parse.y (token_info_push, token_info_pop): reduced ifdefs.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@25319 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
525f6818fa
commit
475bdfee7c
2 changed files with 21 additions and 34 deletions
|
@ -1,4 +1,6 @@
|
||||||
Tue Oct 13 18:20:57 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
Tue Oct 13 18:23:17 2009 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* parse.y (token_info_push, token_info_pop): reduced ifdefs.
|
||||||
|
|
||||||
* parse.y (parser_magic_comment): fixed normalization.
|
* parse.y (parser_magic_comment): fixed normalization.
|
||||||
|
|
||||||
|
|
51
parse.y
51
parse.y
|
@ -604,6 +604,11 @@ static void ripper_compile_error(struct parser_params*, const char *fmt, ...);
|
||||||
#ifndef RIPPER
|
#ifndef RIPPER
|
||||||
static void token_info_push(struct parser_params*, const char *token);
|
static void token_info_push(struct parser_params*, const char *token);
|
||||||
static void token_info_pop(struct parser_params*, const char *token);
|
static void token_info_pop(struct parser_params*, const char *token);
|
||||||
|
#define token_info_push(token) (RTEST(ruby_verbose) ? token_info_push(parser, token) : (void)0)
|
||||||
|
#define token_info_pop(token) (RTEST(ruby_verbose) ? token_info_pop(parser, token) : (void)0)
|
||||||
|
#else
|
||||||
|
#define token_info_push(token) /* nothing */
|
||||||
|
#define token_info_pop(token) /* nothing */
|
||||||
#endif
|
#endif
|
||||||
%}
|
%}
|
||||||
|
|
||||||
|
@ -2976,89 +2981,67 @@ primary_value : primary
|
||||||
|
|
||||||
k_begin : keyword_begin
|
k_begin : keyword_begin
|
||||||
{
|
{
|
||||||
#ifndef RIPPER
|
token_info_push("begin");
|
||||||
if (RTEST(ruby_verbose)) token_info_push(parser, "begin");
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
k_if : keyword_if
|
k_if : keyword_if
|
||||||
{
|
{
|
||||||
#ifndef RIPPER
|
token_info_push("if");
|
||||||
if (RTEST(ruby_verbose)) token_info_push(parser, "if");
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
k_unless : keyword_unless
|
k_unless : keyword_unless
|
||||||
{
|
{
|
||||||
#ifndef RIPPER
|
token_info_push("unless");
|
||||||
if (RTEST(ruby_verbose)) token_info_push(parser, "unless");
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
k_while : keyword_while
|
k_while : keyword_while
|
||||||
{
|
{
|
||||||
#ifndef RIPPER
|
token_info_push("while");
|
||||||
if (RTEST(ruby_verbose)) token_info_push(parser, "while");
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
k_until : keyword_until
|
k_until : keyword_until
|
||||||
{
|
{
|
||||||
#ifndef RIPPER
|
token_info_push("until");
|
||||||
if (RTEST(ruby_verbose)) token_info_push(parser, "until");
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
k_case : keyword_case
|
k_case : keyword_case
|
||||||
{
|
{
|
||||||
#ifndef RIPPER
|
token_info_push("case");
|
||||||
if (RTEST(ruby_verbose)) token_info_push(parser, "case");
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
k_for : keyword_for
|
k_for : keyword_for
|
||||||
{
|
{
|
||||||
#ifndef RIPPER
|
token_info_push("for");
|
||||||
if (RTEST(ruby_verbose)) token_info_push(parser, "for");
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
k_class : keyword_class
|
k_class : keyword_class
|
||||||
{
|
{
|
||||||
#ifndef RIPPER
|
token_info_push("class");
|
||||||
if (RTEST(ruby_verbose)) token_info_push(parser, "class");
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
k_module : keyword_module
|
k_module : keyword_module
|
||||||
{
|
{
|
||||||
#ifndef RIPPER
|
token_info_push("module");
|
||||||
if (RTEST(ruby_verbose)) token_info_push(parser, "module");
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
k_def : keyword_def
|
k_def : keyword_def
|
||||||
{
|
{
|
||||||
#ifndef RIPPER
|
token_info_push("def");
|
||||||
if (RTEST(ruby_verbose)) token_info_push(parser, "def");
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
k_end : keyword_end
|
k_end : keyword_end
|
||||||
{
|
{
|
||||||
#ifndef RIPPER
|
token_info_pop("end");
|
||||||
if (RTEST(ruby_verbose)) token_info_pop(parser, "end"); /* POP */
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
|
@ -4825,6 +4808,7 @@ token_info_has_nonspaces(struct parser_params *parser, const char *token)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#undef token_info_push
|
||||||
static void
|
static void
|
||||||
token_info_push(struct parser_params *parser, const char *token)
|
token_info_push(struct parser_params *parser, const char *token)
|
||||||
{
|
{
|
||||||
|
@ -4841,6 +4825,7 @@ token_info_push(struct parser_params *parser, const char *token)
|
||||||
parser->parser_token_info = ptinfo;
|
parser->parser_token_info = ptinfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#undef token_info_pop
|
||||||
static void
|
static void
|
||||||
token_info_pop(struct parser_params *parser, const char *token)
|
token_info_pop(struct parser_params *parser, const char *token)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue