/[jscoverage]/trunk/highlight.cpp
ViewVC logotype

Diff of /trunk/highlight.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 459 by siliconforks, Tue Sep 22 20:24:54 2009 UTC revision 473 by siliconforks, Sun Oct 4 04:48:09 2009 UTC
# Line 30  Line 30 
30    
31  #include "util.h"  #include "util.h"
32    
33  #ifndef UINT16_MAX  #ifndef UINT32_MAX
34  #define UINT16_MAX 65535  #define UINT32_MAX ((uint32_t) (-1))
35  #endif  #endif
36    
37  enum Class {  enum Class {
# Line 90  Line 90 
90  static size_t g_num_characters;  static size_t g_num_characters;
91  static Stream * g_output;  static Stream * g_output;
92  static size_t character_offset;  static size_t character_offset;
93  static uint16_t line_num;  static uint32_t line_num;
94  static uint16_t column_num;  static uint32_t column_num;
95  static enum Class current_class;  static enum Class current_class;
96    
97  static void output_character(jschar c, enum Class class_) {  static void output_character(jschar c, enum Class class_) {
# Line 113  Line 113 
113      }      }
114    }    }
115    
116    if (column_num == UINT16_MAX) {    if (column_num == UINT32_MAX) {
117      fatal("%s: script contains a line with more than 65,535 columns", g_id);      fatal("%s: script contains a line with more than 65,535 columns", g_id);
118    }    }
119    column_num++;    column_num++;
# Line 139  Line 139 
139      }      }
140      Stream_write_char(g_output, '\n');      Stream_write_char(g_output, '\n');
141      column_num = 0;      column_num = 0;
142      if (line_num == UINT16_MAX) {      if (line_num == UINT32_MAX) {
143        fatal("%s: script contains more than 65,535 lines", g_id);        fatal("%s: script contains more than 65,535 lines", g_id);
144      }      }
145      line_num++;      line_num++;
# Line 156  Line 156 
156    character_offset++;    character_offset++;
157  }  }
158    
159  static void mark_nontoken_chars(uint16_t end_line, uint16_t end_column) {  static void mark_nontoken_chars(uint32_t end_line, uint32_t end_column) {
160    enum State {    enum State {
161      STATE_NORMAL,      STATE_NORMAL,
162      STATE_LINE_COMMENT,      STATE_LINE_COMMENT,
# Line 440  Line 440 
440        break;        break;
441      }      }
442    
443      uint16_t start_line = t.pos.begin.lineno;      uint32_t start_line = t.pos.begin.lineno;
444      uint16_t end_line = t.pos.end.lineno;      uint32_t end_line = t.pos.end.lineno;
445      uint16_t start_column = t.pos.begin.index;      uint32_t start_column = t.pos.begin.index;
446      uint16_t end_column = t.pos.end.index;      uint32_t end_column = t.pos.end.index;
447      assert(line_num == start_line);      assert(line_num == start_line);
448      assert(column_num == start_column);      assert(column_num == start_column);
449      if (start_line == end_line && start_column >= end_column) {      if (start_line == end_line && start_column >= end_column) {

Legend:
Removed from v.459  
changed lines
  Added in v.473

  ViewVC Help
Powered by ViewVC 1.1.24