Conversation
…ghlighting-compiler
DHowett
left a comment
There was a problem hiding this comment.
14/19 plus high water mark of 171 on generator.rs; still ongoing
| JumpIfMatchPrefixInsensitive { idx: u32, tgt: u32 }, | ||
|
|
||
| // Flushes the current HighlightKind to the output. | ||
| FlushHighlight { kind: Register }, |
There was a problem hiding this comment.
(why is this its own instruction instead of a register? i guess having a special register would mean you need to check writes to every register to see if it was the special output register. however, you already have that with pc...)
| //! | `[a-z]?` | `Charset{cs, min=0, max=1}` - optional char | | ||
| //! | `$` | `EndOfLine` condition | | ||
| //! | `.*` | `MovImm off, MAX` - skip to end of line | | ||
| //! | `\>` | `If Charset(\w) then FAIL else MATCH` - word boundary | |
There was a problem hiding this comment.
this feels like a vim-ism; everyone else uses \b for word boundary... right?
| //! | `[a-z]+` | `Charset{cs, min=1, max=∞}` - greedy char class | | ||
| //! | `[a-z]?` | `Charset{cs, min=0, max=1}` - optional char | |
There was a problem hiding this comment.
actually these are Repeat{Charset{cs}, min=..., max=...}
There was a problem hiding this comment.
nm, not in the IR they're not! only in the regex layer. ignore
| } | ||
| } | ||
|
|
||
| /// a|b|c |
There was a problem hiding this comment.
"or a", because this is also the parser for the no-alternation case
| Ok(Regex::Group { inner: Box::new(inner), capturing: false }) | ||
| } | ||
| Some('i') => { | ||
| // Case-insensitive (?i:...) |
There was a problem hiding this comment.
does this mean we can't have a capturing ?i?
|
|
||
| let mut charset = Charset::no(); | ||
|
|
||
| // First char can be ] or - literally |
| optimize_noop(compiler); | ||
| } | ||
|
|
||
| /// This isn't an optimization for the VM, it's one for my autistic side. |
There was a problem hiding this comment.
nope. can't say this, i'm sorry.
This PR contains no CLI frontend, etc., for the compiler,
as I split out everything but the compiler to reduce the PR size.
Part of #624