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
This commit is contained in:
parent
10bb9e6fab
commit
a73f0f2cae
4
parse.y
4
parse.y
@ -38,6 +38,8 @@
|
|||||||
# define WARN_PAST_SCOPE 0
|
# define WARN_PAST_SCOPE 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define TAB_WIDTH 8
|
||||||
|
|
||||||
#define YYMALLOC(size) rb_parser_malloc(parser, (size))
|
#define YYMALLOC(size) rb_parser_malloc(parser, (size))
|
||||||
#define YYREALLOC(ptr, size) rb_parser_realloc(parser, (ptr), (size))
|
#define YYREALLOC(ptr, size) rb_parser_realloc(parser, (ptr), (size))
|
||||||
#define YYCALLOC(nelem, size) rb_parser_calloc(parser, (nelem), (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;
|
const char *p;
|
||||||
for (p = lex_pbeg; p < pend; p++) {
|
for (p = lex_pbeg; p < pend; p++) {
|
||||||
if (*p == '\t') {
|
if (*p == '\t') {
|
||||||
column = (((column - 1) / 8) + 1) * 8;
|
column = (((column - 1) / TAB_WIDTH) + 1) * TAB_WIDTH;
|
||||||
}
|
}
|
||||||
column++;
|
column++;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user