swift
96bec766 - [Parse] Split prefix operators from regex in the lexer

Commit
3 years ago
[Parse] Split prefix operators from regex in the lexer Teach the lexer not to consider `/` an operator character when attempting to re-lex a regex literal. This allows us to split off a prefix operator. Previously this was done after-the-fact in the parser, but that didn't cover the unapplied infix operator case, and didn't form a `tok::amp_prefix` for `foo(&/.../)`, which led to a suboptimal diagnostic. This also now means we'll split an operator for cases such as `foo(!/^/)` rather than treating it as an unapplied infix operator. rdar://92469917
Author
Committer
Parents
Loading