aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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 */