kit

kit
git clone https://git.ryansepassi.com/git/kit.git
Log | Files | Refs | README

desugar_utf8.ebnf (472B)


      1 // utf8-mode desugaring fixture: exercises the scalar-path shorthand expansion
      2 // (\w \d \s, ASCII even in utf8 mode), `{n,m}` on a shorthand, and a fragment.
      3 // Parity-only (the byte path is exercised at runtime by test_desugar.c); held
      4 // byte-identical across generators by the parity stamps.
      5 %lex :utf8 {
      6   %def letter = [A-Za-z];
      7 
      8   SP   = \s+;
      9   WORD = (letter | "_") \w*;
     10   NUM  = \d+ ("." \d+)?;
     11   TAG  = "#" \w{1,8};
     12 }
     13 
     14 doc = item*;
     15 item = SP | WORD | NUM | TAG;