anchors_start.ebnf (449B)
1 // Start anchors only (no end anchors), so the lexer keeps the anchor-free fast 2 // path and the --lexer-codegen scanner is emitted with alternate start states 3 // (start_text for \A, start_line for ^ under --multiline). Used by the lexer 4 // codegen equivalence test to exercise the generated start-state switch. 5 %lex { 6 KW = \A "if"; 7 LN = ^ "ln"; 8 ID = [a-z][a-z]*; 9 NUM = [0-9][0-9]*; 10 %skip WS = [ \t\r\n]+; 11 } 12 13 start = (KW | LN | ID | NUM)*;