Hello S/E,
I’d like to put forward a perhaps rather banal change to the Swift lexer
primarily intended to make entering regular expression patterns easier.
https://github.com/DoubleSpeak/swift-evolution/blob/master/proposals/NNNN-raw-string-escaping.md
<https://github.com/DoubleSpeak/swift-evolution/blob/master/proposals/NNNN-raw-string-escaping.md>
With a raw literal a string prefixed by “r” the \ character would have no
special role at all and be processed like any other character i.e.
r"\n\(var)\n" == "\\n\\(var)\\n"
r"\?\y\=" == "\\?\\y\\="
r"c:\windows\system32" == "c:\\windows\\system32"
r"""
Line One\
Line Two\
""" == "Line One\\\nLineTwo\\"
I had considered another version of the proposal where known escapes
were still processed but it proved too difficult to reason exactly what was
contained in the string.
There is a example toolchain available for testing:
http://johnholdsworth.com/swift-LOCAL-2017-11-23-a-osx.tar.gz
<http://johnholdsworth.com/swift-LOCAL-2017-11-23-a-osx.tar.gz>
Can we shepard this minor additive change into Swift 4.1?
John
_______________________________________________
swift-evolution mailing list
swift-evolution@swift.org
https://lists.swift.org/mailman/listinfo/swift-evolution