use of org.antlr.v4.runtime.CodePointCharStream in project antlr4 by antlr.
the class TestCodePointCharStream method singleEmojiCodePointLookAheadPastEndShouldReturnEOF.
@Test
public void singleEmojiCodePointLookAheadPastEndShouldReturnEOF() {
CodePointCharStream s = CharStreams.fromString(new StringBuilder().appendCodePoint(0x1F4A9).toString());
assertEquals(IntStream.EOF, s.LA(2));
assertEquals(0, s.index());
}
use of org.antlr.v4.runtime.CodePointCharStream in project antlr4 by antlr.
the class TestCodePointCharStream method singleLatinCodePointLookAheadPastEndShouldReturnEOF.
@Test
public void singleLatinCodePointLookAheadPastEndShouldReturnEOF() {
CodePointCharStream s = CharStreams.fromString("X");
assertEquals(IntStream.EOF, s.LA(2));
}
use of org.antlr.v4.runtime.CodePointCharStream in project antlr4 by antlr.
the class TestCodePointCharStream method singleEmojiCodePointLookAheadShouldReturnCodePoint.
@Test
public void singleEmojiCodePointLookAheadShouldReturnCodePoint() {
CodePointCharStream s = CharStreams.fromString(new StringBuilder().appendCodePoint(0x1F4A9).toString());
assertEquals(0x1F4A9, s.LA(1));
assertEquals(0, s.index());
}
use of org.antlr.v4.runtime.CodePointCharStream in project antlr4 by antlr.
the class TestCodePointCharStream method toStringWithLatin.
@Test
public void toStringWithLatin() {
CodePointCharStream s = CharStreams.fromString("0123456789");
assertEquals("0123456789", s.toString());
}
use of org.antlr.v4.runtime.CodePointCharStream in project antlr4 by antlr.
the class TestCodePointCharStream method getTextWithCJK.
@Test
public void getTextWithCJK() {
CodePointCharStream s = CharStreams.fromString("01234䂔6789");
assertEquals("34䂔67", s.getText(Interval.of(3, 7)));
}
Aggregations