use of org.antlr.v4.runtime.misc.IntervalSet in project antlr4 by antlr.
the class UnicodeDataTemplateController method addIntervalForCategory.
private static void addIntervalForCategory(Map<String, IntervalSet> categoryMap, String categoryName, int start, int finish) {
IntervalSet intervalSet = categoryMap.get(categoryName);
if (intervalSet == null) {
intervalSet = new IntervalSet();
categoryMap.put(categoryName, intervalSet);
}
intervalSet.add(start, finish);
}
use of org.antlr.v4.runtime.misc.IntervalSet in project antlr4 by antlr.
the class TestEscapeSequenceParsing method testParseUnicodePropertyInverted.
@Test
public void testParseUnicodePropertyInverted() {
IntervalSet expected = IntervalSet.of(0, 66559);
expected.add(66640, Character.MAX_CODE_POINT);
assertEquals(new Result(Result.Type.PROPERTY, -1, expected, 11), EscapeSequenceParsing.parseEscape("\\P{Deseret}", 0));
}
use of org.antlr.v4.runtime.misc.IntervalSet in project antlr4 by antlr.
the class TestIntervalSet method testEmptyIntersectionSingleElements.
@Test
public void testEmptyIntersectionSingleElements() throws Exception {
IntervalSet s = IntervalSet.of('a');
IntervalSet s2 = IntervalSet.of('d');
String expecting = "{}";
String result = (s.and(s2)).toString();
assertEquals(expecting, result);
}
use of org.antlr.v4.runtime.misc.IntervalSet in project antlr4 by antlr.
the class TestIntervalSet method testNotRIntersectionNotT.
/** The following was broken:
{'