MCPcopy Create free account
hub / github.com/antlr/codebuff / outside

Method outside

output/java/1.4.19/STLexer.java:248–281  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

246 }
247
248 protected Token outside() {
249 if ( input.getCharPositionInLine()==0 && (c==' ' || c=='\t') ) {
250 while ( c==' ' || c=='\t' ) consume(); // scarf indent
251 if ( c!= EOF ) return newToken(INDENT);
252 return newToken(TEXT);
253 }
254
255 if ( c==delimiterStartChar ) {
256 consume();
257 if ( c=='!' ) return COMMENT();
258 if ( c=='\\' ) return ESCAPE(); // <\\> <\uFFFF> <\n> etc...
259 scanningInsideExpr = true;
260 return newToken(LDELIM);
261 }
262
263 if ( c=='\r' ) {
264 consume();
265 consume();
266 return newToken(NEWLINE);
267 } // \r\n -> \n
268
269 if ( c=='\n' ) {
270 consume();
271 return newToken(NEWLINE);
272 }
273
274 if ( c=='}' && subtemplateDepth>0) {
275 scanningInsideExpr = true;
276 subtemplateDepth--;
277 consume();
278 return newTokenFromPreviousChar(RCURLY);
279 }
280 return mTEXT();
281 }
282
283 protected Token inside() {
284 while ( true ) {

Callers 1

_nextTokenMethod · 0.95

Calls 7

consumeMethod · 0.95
newTokenMethod · 0.95
COMMENTMethod · 0.95
ESCAPEMethod · 0.95
mTEXTMethod · 0.95
getCharPositionInLineMethod · 0.80

Tested by

no test coverage detected