swiftlang / swift-experimental-string-processing

An early experimental general-purpose pattern matching engine for Swift.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

`[\n]` should not match `\r\n`

hamishknight opened this issue · comments

Currently [\n] matches \r\n in grapheme semantic mode, however this should not be the case.

This is open for debate as to whether we consider \n to be a literal scalar escape or some kind of newline character class.

@milseman AFAIK other engines treat [\n] as equivalent to \n. We could define it differently, though that would also mean we'd also have to ban its use as a range operand e.g [\n-0]

Oh hey looks like Lily already fixed this in #525, adding a couple more tests in #570

Happy to re-open if we decide we want a custom matching behavior instead