[前][次][番号順一覧][スレッド一覧]

ruby-changes:40746

From: nobu <ko1@a...>
Date: Tue, 1 Dec 2015 10:25:23 +0900 (JST)
Subject: [ruby-changes:40746] nobu:r52825 (trunk): parse.y: TAB_WIDTH

nobu	2015-12-01 10:25:13 +0900 (Tue, 01 Dec 2015)

  New Revision: 52825

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=52825

  Log:
    parse.y: TAB_WIDTH
    
    * parse.y (TAB_WIDTH, token_info_get_column): add constant for
      column calcuation.

  Modified files:
    trunk/parse.y
Index: parse.y
===================================================================
--- parse.y	(revision 52824)
+++ parse.y	(revision 52825)
@@ -38,6 +38,8 @@ https://github.com/ruby/ruby/blob/trunk/parse.y#L38
 # 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_para https://github.com/ruby/ruby/blob/trunk/parse.y#L5311
     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++;
     }

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]