Changeset 216
- Timestamp:
- 11/09/02 18:18:10 (21 years ago)
- Location:
- trunk/j/src/org/armedbear/j
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/j/src/org/armedbear/j/CTagger.java
r202 r216 3 3 * 4 4 * Copyright (C) 1998-2002 Peter Graves 5 * $Id: CTagger.java,v 1. 4 2002-11-05 02:24:53piso Exp $5 * $Id: CTagger.java,v 1.5 2002-11-09 18:17:45 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 60 60 } 61 61 if (pos.lookingAt("/*")) { 62 skipComment( );62 skipComment(pos); 63 63 continue; 64 64 } 65 65 if (pos.lookingAt("//")) { 66 Line nextLine = pos.getNextLine(); 67 if (nextLine == null) 68 break; 69 pos.moveTo(nextLine, 0); 66 skipSingleLineComment(pos); 70 67 continue; 71 68 } … … 165 162 return sb.toString(); 166 163 } 167 164 168 165 private static boolean isDefunStart(String s) 169 166 { -
trunk/j/src/org/armedbear/j/CppTagger.java
r201 r216 61 61 } 62 62 if (pos.lookingAt("/*")) { 63 skipComment( );63 skipComment(pos); 64 64 continue; 65 65 } 66 66 if (pos.lookingAt("//")) { 67 Line nextLine = pos.getNextLine(); 68 if (nextLine == null) 69 break; 70 pos.moveTo(nextLine, 0); 67 skipSingleLineComment(pos); 71 68 continue; 72 69 } -
trunk/j/src/org/armedbear/j/JavaTagger.java
r2 r216 3 3 * 4 4 * Copyright (C) 1998-2002 Peter Graves 5 * $Id: JavaTagger.java,v 1. 1.1.1 2002-09-24 16:08:08piso Exp $5 * $Id: JavaTagger.java,v 1.2 2002-11-09 18:17:21 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 76 76 } 77 77 if (pos.lookingAt("/*")) { 78 skipComment( );78 skipComment(pos); 79 79 continue; 80 80 } 81 81 if (pos.lookingAt("//")) { 82 Line next = pos.getNextLine(); 83 if (next == null) 84 break; 85 pos.moveTo(next, 0); 82 skipSingleLineComment(pos); 86 83 continue; 87 84 } … … 302 299 } 303 300 304 protected void skipComment()301 protected static final void skipComment(Position pos) 305 302 { 306 303 while (!pos.lookingAt("*/") && pos.next()) … … 308 305 if (pos.lookingAt("*/")) 309 306 pos.skip(2); 307 } 308 309 protected static final void skipSingleLineComment(Position pos) 310 { 311 Line next = pos.getNextLine(); 312 if (next != null) 313 pos.moveTo(next, 0); 314 else 315 pos.setOffset(pos.getLineLength()); 310 316 } 311 317 … … 339 345 while (true) { 340 346 if (pos.lookingAt("/*")) { 341 skipComment( );347 skipComment(pos); 342 348 continue; 343 349 } 344 350 if (pos.lookingAt("//")) { 345 Line nextLine = pos.getNextLine(); 346 if (nextLine == null) 347 break; 348 pos.moveTo(nextLine, 0); 351 skipSingleLineComment(pos); 349 352 continue; 350 353 } … … 372 375 while (true) { 373 376 if (pos.lookingAt("/*")) { 374 skipComment( );377 skipComment(pos); 375 378 continue; 376 379 } 377 380 if (pos.lookingAt("//")) { 378 Line nextLine = pos.getNextLine(); 379 if (nextLine != null) { 380 pos.moveTo(nextLine, 0); 381 continue; 382 } 383 // Next line is null. Reached end of buffer. 384 pos.setOffset(pos.getLineLength()); 385 break; 381 skipSingleLineComment(pos); 382 continue; 386 383 } 387 384 char c = pos.getChar(); … … 414 411 while (!pos.atEnd()) { 415 412 if (pos.lookingAt("/*")) { 416 skipComment( );413 skipComment(pos); 417 414 continue; 418 415 } 419 416 if (pos.lookingAt("//")) { 420 Line nextLine = pos.getNextLine(); 421 if (nextLine == null) { 422 // Next line is null. Reached end of buffer. 423 pos.setOffset(pos.getLineLength()); 424 break; 425 } else { 426 pos.moveTo(nextLine, 0); 427 continue; 428 } 417 skipSingleLineComment(pos); 418 continue; 429 419 } 430 420 char c = pos.getChar();
Note: See TracChangeset
for help on using the changeset viewer.