Search in sources :

Example 1 with com.jetbrains.rest.lexer._RestFlexLexer

use of com.jetbrains.rest.lexer._RestFlexLexer in project intellij-community by JetBrains.

the class RestLexerTest method doTest.

private static void doTest(String text, String... expected) throws IOException {
    _RestFlexLexer lexer = createLexer(text);
    for (String expectedTokenText : expected) {
        IElementType type = lexer.advance();
        if (type == null) {
            fail("Not enough tokens");
        }
        String tokenText = "[" + lexer.yytext() + ", " + type + "]";
        assertEquals(expectedTokenText, tokenText);
    }
}
Also used : IElementType(com.intellij.psi.tree.IElementType) com.jetbrains.rest.lexer._RestFlexLexer(com.jetbrains.rest.lexer._RestFlexLexer)

Example 2 with com.jetbrains.rest.lexer._RestFlexLexer

use of com.jetbrains.rest.lexer._RestFlexLexer in project intellij-community by JetBrains.

the class RestLexerTest method createLexer.

public static _RestFlexLexer createLexer(String text) {
    _RestFlexLexer lexer = new _RestFlexLexer((Reader) null);
    lexer.reset(text, 0, text.length(), _RestFlexLexer.YYINITIAL);
    return lexer;
}
Also used : com.jetbrains.rest.lexer._RestFlexLexer(com.jetbrains.rest.lexer._RestFlexLexer)

Aggregations

com.jetbrains.rest.lexer._RestFlexLexer (com.jetbrains.rest.lexer._RestFlexLexer)2 IElementType (com.intellij.psi.tree.IElementType)1