parse.y: reorder conditions
* parse.y (token_info_pop): scan lex buffer only when token info is enabled. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51984 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
aad3a8679f
commit
c2310baf9a
15
parse.y
15
parse.y
@ -5335,23 +5335,16 @@ token_info_pop(struct parser_params *parser, const char *token, size_t len)
|
|||||||
|
|
||||||
if (!ptinfo) return;
|
if (!ptinfo) return;
|
||||||
parser->token_info = ptinfo->next;
|
parser->token_info = ptinfo->next;
|
||||||
if (token_info_get_column(parser, t) == ptinfo->column) { /* OK */
|
|
||||||
goto finish;
|
|
||||||
}
|
|
||||||
linenum = ruby_sourceline;
|
linenum = ruby_sourceline;
|
||||||
if (linenum == ptinfo->linenum) { /* SKIP */
|
if (parser->token_info_enabled &&
|
||||||
goto finish;
|
linenum != ptinfo->linenum && !ptinfo->nonspc &&
|
||||||
}
|
!token_info_has_nonspaces(parser, t) &&
|
||||||
if (token_info_has_nonspaces(parser, t) || ptinfo->nonspc) { /* SKIP */
|
token_info_get_column(parser, t) != ptinfo->column) {
|
||||||
goto finish;
|
|
||||||
}
|
|
||||||
if (parser->token_info_enabled) {
|
|
||||||
rb_compile_warn(ruby_sourcefile, linenum,
|
rb_compile_warn(ruby_sourcefile, linenum,
|
||||||
"mismatched indentations at '%s' with '%s' at %d",
|
"mismatched indentations at '%s' with '%s' at %d",
|
||||||
token, ptinfo->token, ptinfo->linenum);
|
token, ptinfo->token, ptinfo->linenum);
|
||||||
}
|
}
|
||||||
|
|
||||||
finish:
|
|
||||||
xfree(ptinfo);
|
xfree(ptinfo);
|
||||||
}
|
}
|
||||||
#endif /* RIPPER */
|
#endif /* RIPPER */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user