Changeset 190
- Timestamp:
- 10/31/02 13:45:21 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/j/src/org/armedbear/j/CTagger.java
r2 r190 3 3 * 4 4 * Copyright (C) 1998-2002 Peter Graves 5 * $Id: CTagger.java,v 1. 1.1.1 2002-09-24 16:09:14piso Exp $5 * $Id: CTagger.java,v 1.2 2002-10-31 13:45:21 piso Exp $ 6 6 * 7 7 * This program is free software; you can redistribute it and/or … … 24 24 import gnu.regexp.RE; 25 25 import gnu.regexp.UncheckedRE; 26 import java.util. Vector;26 import java.util.ArrayList; 27 27 28 28 public final class CTagger extends JavaTagger … … 44 44 public void run() 45 45 { 46 Vector tags = new Vector();46 ArrayList tags = new ArrayList(); 47 47 pos = new Position(buffer.getFirstLine(), 0); 48 48 token = null; … … 63 63 continue; 64 64 } 65 if (pos.lookingAt("//") || (c == '#' && pos.getOffset() == 0)) {65 if (pos.lookingAt("//")) { 66 66 Line nextLine = pos.getNextLine(); 67 67 if (nextLine == null) 68 68 break; 69 69 pos.moveTo(nextLine, 0); 70 continue; 71 } 72 if (c == '#' && pos.getOffset() == 0) { 73 skipPreprocessor(pos); 70 74 continue; 71 75 } … … 169 173 token = sb.toString(); 170 174 } 175 176 private static void skipPreprocessor(Position pos) 177 { 178 while (true) { 179 Line line = pos.getLine(); 180 Line nextLine = line.next(); 181 if (nextLine == null) { 182 pos.setOffset(line.length()); 183 return; 184 } 185 pos.moveTo(nextLine, 0); 186 if (line.length() == 0 || line.charAt(line.length()-1) != '\\') 187 return; 188 } 189 } 171 190 172 191 private static final boolean isIdentifierStart(char c)
Note: See TracChangeset
for help on using the changeset viewer.