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