Changeset 213
- Timestamp:
- 11/06/02 17:11:43 (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/j/src/org/armedbear/j/LispTagger.java
r184 r213 60 60 continue; 61 61 } 62 if (c == '#' && pos.lookingAt("#|")) { 63 pos.skip(2); 64 skipComment(pos); 65 continue; 66 } 62 67 if (c == '\"') { 63 68 pos.skipQuote(); … … 85 90 state = NEUTRAL; 86 91 continue; 87 } 92 } 88 93 if (state == OPEN_PAREN) { 89 94 String preceding = … … 108 113 buffer.setTags(tags); 109 114 } 110 115 111 116 private static final String[] tokens = new String[] { 112 117 "defun", "defvar", "defmacro", "defcustom", "defgroup", "defsubst" 113 118 }; 114 119 115 120 // pos points to first char after token. 116 121 private boolean isDefinitionStart(String token, Position pos) … … 119 124 if (Utilities.isOneOf(token, tokens)) 120 125 return true; 121 126 122 127 return false; 123 128 } … … 135 140 return sb.toString(); 136 141 } 137 142 138 143 // Advances pos past token. 139 144 private void skipToken(Position pos) … … 144 149 } 145 150 } 151 152 private void skipComment(Position pos) 153 { 154 while (!pos.atEnd()) { 155 char c = pos.getChar(); 156 if (c == '\\') { 157 // Escape. 158 if (pos.getOffset() < pos.getLineLength()-1) 159 pos.skip(2); 160 else { 161 Line nextLine = pos.getNextLine(); 162 if (nextLine == null) 163 break; 164 pos.moveTo(nextLine, 0); 165 } 166 continue; 167 } 168 if (c == '|' && pos.lookingAt("|#")) { 169 pos.skip(2); 170 return; 171 } 172 pos.next(); 173 } 174 } 146 175 }
Note: See TracChangeset
for help on using the changeset viewer.