aboutsummaryrefslogtreecommitdiffstats
path: root/parse.y
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-01 01:25:13 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-12-01 01:25:13 +0000
commita73f0f2caead604ad0a1d1de657d7bdcb00cf242 (patch)
tree43ed331be341f34621f4f4d660fcdded994a2904 /parse.y
parent10bb9e6faba749c3e9656b9088da77b3f1146937 (diff)
downloadruby-a73f0f2caead604ad0a1d1de657d7bdcb00cf242.tar.gz
parse.y: TAB_WIDTH
* parse.y (TAB_WIDTH, token_info_get_column): add constant for column calcuation. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@52825 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y4
1 files changed, 3 insertions, 1 deletions
diff --git a/parse.y b/parse.y
index 3cebf0a03c..bc6de5a3ec 100644
--- a/parse.y
+++ b/parse.y
@@ -38,6 +38,8 @@
# define WARN_PAST_SCOPE 0
#endif
+#define TAB_WIDTH 8
+
#define YYMALLOC(size) rb_parser_malloc(parser, (size))
#define YYREALLOC(ptr, size) rb_parser_realloc(parser, (ptr), (size))
#define YYCALLOC(nelem, size) rb_parser_calloc(parser, (nelem), (size))
@@ -5309,7 +5311,7 @@ token_info_get_column(struct parser_params *parser, const char *pend)
const char *p;
for (p = lex_pbeg; p < pend; p++) {
if (*p == '\t') {
- column = (((column - 1) / 8) + 1) * 8;
+ column = (((column - 1) / TAB_WIDTH) + 1) * TAB_WIDTH;
}
column++;
}