From b29c0eceda137552cbd9751bbb5357eb89f775f2 Mon Sep 17 00:00:00 2001 From: nobu Date: Tue, 29 Sep 2015 16:47:13 +0000 Subject: 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 --- parse.y | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) (limited to 'parse.y') 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 */ -- cgit v1.2.3