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