diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-01 01:25:13 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-01 01:25:13 +0000 |
commit | a73f0f2caead604ad0a1d1de657d7bdcb00cf242 (patch) | |
tree | 43ed331be341f34621f4f4d660fcdded994a2904 | |
parent | 10bb9e6faba749c3e9656b9088da77b3f1146937 (diff) | |
download | ruby-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
-rw-r--r-- | parse.y | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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++; } |