### Question:
SyntaxHighlighter extends TreeVisitor<InputFileContext> { private void highlight(InputFileContext ctx, TextRange range, TypeOfText typeOfText) { newHighlighting.highlight(ctx.textRange(range), typeOfText); } SyntaxHighlighter();   }### Answer:
@Test public void empty_input() throws Exception { highlight(""); assertHighlighting(1, 0, 0, null); }
@Test public void single_line_comment() throws Exception { highlight(" assertHighlighting(0, 1, null); assertHighlighting(2, 12, COMMENT); }
@Test public void comment() throws Exception { highlight(" "); assertHighlighting(0, 1, null); assertHighlighting(2, 12, COMMENT); assertHighlighting(13, 13, null); }
@Test public void multiline_comment() throws Exception { highlight(" "); assertHighlighting(1, 0, 1, COMMENT); assertHighlighting(2, 0, 6, COMMENT); assertHighlighting(3, 0, 1, COMMENT); assertHighlighting(3, 2, 2, null); }
@Test public void keyword() throws Exception { highlight("fun foo() { if(x) y; }"); assertHighlighting(0, 2, KEYWORD); assertHighlighting(3, 11, null); assertHighlighting(12, 13, KEYWORD); assertHighlighting(14, 22, null); }
@Test public void string_literal() throws Exception { highlight("x + \"abc\" + y;"); assertHighlighting(1, 3, null); assertHighlighting(4, 8, STRING); assertHighlighting(9, 9, null); }
@Test public void numeric_literal() throws Exception { highlight("x + 123 + y;"); assertHighlighting(1, 3, null); assertHighlighting(4, 6, CONSTANT); assertHighlighting(7, 7, null); }