ruby-changes:56378
From: Nobuyoshi <ko1@a...>
Date: Sun, 7 Jul 2019 15:50:57 +0900 (JST)
Subject: [ruby-changes:56378] Nobuyoshi Nakada: 789e49dc7e (master): Renamed column in token_info to indent
https://git.ruby-lang.org/ruby.git/commit/?id=789e49dc7e From 789e49dc7e36f2c19a3df6dfa348e95b7105061c Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Sun, 7 Jul 2019 14:43:54 +0900 Subject: Renamed column in token_info to indent diff --git a/parse.y b/parse.y index 3708601..88c0208 100644 --- a/parse.y +++ b/parse.y @@ -175,8 +175,8 @@ struct local_vars { https://github.com/ruby/ruby/blob/trunk/parse.y#L175 typedef struct token_info { const char *token; - int linenum; - int column; + rb_code_position_t beg; + int indent; int nonspc; struct token_info *next; } token_info; @@ -5387,8 +5387,8 @@ setup_token_info(token_info *ptinfo, const char *ptr, const rb_code_location_t * https://github.com/ruby/ruby/blob/trunk/parse.y#L5387 } } - ptinfo->linenum = loc->beg_pos.lineno; - ptinfo->column = column; + ptinfo->beg = loc->beg_pos; + ptinfo->indent = column; ptinfo->nonspc = nonspc; } @@ -5426,13 +5426,13 @@ token_info_warn(struct parser_params *p, const char *token, token_info *ptinfo_b https://github.com/ruby/ruby/blob/trunk/parse.y#L5426 if (!p->token_info_enabled) return; if (!ptinfo_beg) return; setup_token_info(ptinfo_end, p->lex.pbeg, loc); - if (ptinfo_beg->linenum == ptinfo_end->linenum) return; /* ignore one-line block */ + if (ptinfo_beg->beg.lineno == ptinfo_end->beg.lineno) return; /* ignore one-line block */ if (ptinfo_beg->nonspc || ptinfo_end->nonspc) return; /* ignore keyword in the middle of a line */ - if (ptinfo_beg->column == ptinfo_end->column) return; /* the indents are matched */ - if (!same && ptinfo_beg->column < ptinfo_end->column) return; - rb_warn3L(ptinfo_end->linenum, + if (ptinfo_beg->indent == ptinfo_end->indent) return; /* the indents are matched */ + if (!same && ptinfo_beg->indent < ptinfo_end->indent) return; + rb_warn3L(ptinfo_end->beg.lineno, "mismatched indentations at '%s' with '%s' at %d", - WARN_S(token), WARN_S(ptinfo_beg->token), WARN_I(ptinfo_beg->linenum)); + WARN_S(token), WARN_S(ptinfo_beg->token), WARN_I(ptinfo_beg->beg.lineno)); } static int -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/