@Test @DisplayName("The lexer skips spaces when requested to skip") void testSkipSpace() { final var lexer = new Lexer("/\\s*\\/[a-zA-Z]/ a |",true); final var regex = lexer.get(); Assertions.assertEquals(Lexeme.Type.REGEX,regex.type); Assertions.assertEquals("\\s*/[a-zA-Z]",regex.string); final var word = lexer.get(); Assertions.assertEquals(Lexeme.Type.WORD,word.type); Assertions.assertEquals("a",word.string); final var symb = lexer.get(); Assertions.assertEquals(Lexeme.Type.SYMBOL,symb.type); Assertions.assertEquals("|",symb.string); }
public Lexeme get() { final var ret = lookAhead != null ? lookAhead : next(); lookAhead = next(); return ret; }
Lexer { public Lexeme get() { final var ret = lookAhead != null ? lookAhead : next(); lookAhead = next(); return ret; } }
Lexer { public Lexeme get() { final var ret = lookAhead != null ? lookAhead : next(); lookAhead = next(); return ret; } Lexer(final String input);  Lexer(final String input, boolean selectorExpression); }
Lexer { public Lexeme get() { final var ret = lookAhead != null ? lookAhead : next(); lookAhead = next(); return ret; } Lexer(final String input);  Lexer(final String input, boolean selectorExpression); @Override String toString(); String rest(); Lexeme get(); Lexeme peek(); }
Lexer { public Lexeme get() { final var ret = lookAhead != null ? lookAhead : next(); lookAhead = next(); return ret; } Lexer(final String input);  Lexer(final String input, boolean selectorExpression); @Override String toString(); String rest(); Lexeme get(); Lexeme peek();  }