aboutsummaryrefslogtreecommitdiffstats
path: root/parse.y
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-09-29 16:47:13 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-09-29 16:47:13 +0000
commitb29c0eceda137552cbd9751bbb5357eb89f775f2 (patch)
tree6d72be5a5d45141b070d9d5a8d55256e8b88770a /parse.y
parent3a07e554ee34fff1e69472e6f92456f13a4e7f84 (diff)
downloadruby-b29c0eceda137552cbd9751bbb5357eb89f775f2.tar.gz
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
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y15
1 files changed, 4 insertions, 11 deletions
diff --git a/parse.y b/parse.y
index c29f068e74..28c1bf6c3c 100644
--- a/parse.y
+++ b/parse.y
@@ -5335,23 +5335,16 @@ token_info_pop(struct parser_params *parser, const char *token, size_t len)
if (!ptinfo) return;
parser->token_info = ptinfo->next;
- if (token_info_get_column(parser, t) == ptinfo->column) { /* OK */
- goto finish;
- }
linenum = ruby_sourceline;
- if (linenum == ptinfo->linenum) { /* SKIP */
- goto finish;
- }
- if (token_info_has_nonspaces(parser, t) || ptinfo->nonspc) { /* SKIP */
- goto finish;
- }
- if (parser->token_info_enabled) {
+ if (parser->token_info_enabled &&
+ linenum != ptinfo->linenum && !ptinfo->nonspc &&
+ !token_info_has_nonspaces(parser, t) &&
+ token_info_get_column(parser, t) != ptinfo->column) {
rb_compile_warn(ruby_sourcefile, linenum,
"mismatched indentations at '%s' with '%s' at %d",
token, ptinfo->token, ptinfo->linenum);
}
- finish:
xfree(ptinfo);
}
#endif /* RIPPER */