Skip to content

Commit 57885a7

Browse files
Refine message
1 parent cb5a579 commit 57885a7

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

Sources/ExpressionParser/ExpressionParser.swift

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1244,7 +1244,16 @@ struct ExpressionParser {
12441244
rhs = String(pattern[range.rhs.startPosition..<range.rhs.endPosition])
12451245
}
12461246

1247-
let substitution = ["{{getChar(prev)}}" : #""\#(lhs)""#, "{{getChar(next)}}" : #""\#(rhs)""#]
1247+
let lhscharcode = lhs.unicodeScalars.map { String(format: "U+%X", $0.value) }.joined(separator: " ")
1248+
let rhscharcode = rhs.unicodeScalars.map { String(format: "U+%X", $0.value) }.joined(separator: " ")
1249+
1250+
let substitution = [
1251+
"{{getChar(prev)}}" : #""\#(lhs)""#,
1252+
"{{getChar(next)}}" : #""\#(rhs)""#,
1253+
"{{prev.code}}" : #""\#(lhscharcode)""#,
1254+
"{{next.code}}" : #""\#(rhscharcode)""#,
1255+
"{{getInsensitive()}}": "Case \(modes.i ? "in" : "")sensitive."
1256+
]
12481257

12491258
tokens.append(
12501259
Token(

0 commit comments

Comments
 (0)