()
| 457 | } |
| 458 | |
| 459 | Token UNICODE() { |
| 460 | consume(); |
| 461 | char[] chars = new char[4]; |
| 462 | if ( !isUnicodeLetter(c) ) { |
| 463 | NoViableAltException e = new NoViableAltException("", 0, 0, input); |
| 464 | errMgr.lexerError(input.getSourceName(), |
| 465 | "invalid unicode char: '"+str(c)+"'", |
| 466 | templateToken, |
| 467 | e); |
| 468 | } |
| 469 | chars[0] = c; |
| 470 | consume(); |
| 471 | if ( !isUnicodeLetter(c) ) { |
| 472 | NoViableAltException e = new NoViableAltException("", 0, 0, input); |
| 473 | errMgr.lexerError(input.getSourceName(), |
| 474 | "invalid unicode char: '"+str(c)+"'", |
| 475 | templateToken, |
| 476 | e); |
| 477 | } |
| 478 | chars[1] = c; |
| 479 | consume(); |
| 480 | if ( !isUnicodeLetter(c) ) { |
| 481 | NoViableAltException e = new NoViableAltException("", 0, 0, input); |
| 482 | errMgr.lexerError(input.getSourceName(), |
| 483 | "invalid unicode char: '"+str(c)+"'", |
| 484 | templateToken, |
| 485 | e); |
| 486 | } |
| 487 | chars[2] = c; |
| 488 | consume(); |
| 489 | if ( !isUnicodeLetter(c) ) { |
| 490 | NoViableAltException e = new NoViableAltException("", 0, 0, input); |
| 491 | errMgr.lexerError(input.getSourceName(), |
| 492 | "invalid unicode char: '"+str(c)+"'", |
| 493 | templateToken, |
| 494 | e); |
| 495 | } |
| 496 | chars[3] = c; |
| 497 | // ESCAPE kills > |
| 498 | char uc = (char)Integer.parseInt(new String(chars), 16); |
| 499 | Token t = newToken(TEXT, String.valueOf(uc), input.getCharPositionInLine()-6); |
| 500 | consume(); |
| 501 | match(delimiterStopChar); |
| 502 | return t; |
| 503 | } |
| 504 | |
| 505 | Token mTEXT() { |
| 506 | boolean modifiedText = false; |
no test coverage detected