Skip to content

Commit 192ccf1

Browse files
authored
[Parser] Add greek question mark as semicolon confusable character (#33047)
1 parent 2c8ae98 commit 192ccf1

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

include/swift/Parse/Confusables.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,5 +123,6 @@ CONFUSABLE(0x276f, 0x3e)
123123
CONFUSABLE(0x2c3, 0x3e)
124124
CONFUSABLE(0x1d237, 0x3e)
125125
CONFUSABLE(0x1433, 0x3e)
126+
CONFUSABLE(0x037e, 0x3b)
126127

127128
#undef CONFUSABLE

test/Parse/confusables.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,9 @@ if (5 ‒ 5) == 0 {} // expected-note {{unicode character '‒' looks similar to
2222
// expected-note @-1 {{operator function '=='}}
2323

2424
// FIXME(rdar://61028087): The above note should read "required by referencing operator function '==' on 'BinaryInteger' where 'Self' = '(Int, Int)'".
25+
26+
// GREEK QUESTION MARK (which looks like a semicolon)
27+
print("A"); print("B")
28+
// expected-error@-1 2{{consecutive statements on a line must be separated by ';'}}
29+
// expected-error@-2 {{cannot find ';' in scope}}
30+
// expected-note@-3 {{identifier ';' contains possibly confused characters; did you mean to use ';'?}} {{11-13=;}}

0 commit comments

Comments
 (0)