Skip to content

Commit dd80274

Browse files
committed
Tweak unknown character message, add test
1 parent 62bcd62 commit dd80274

File tree

3 files changed

+24
-1
lines changed

3 files changed

+24
-1
lines changed

syntax/src/res_diagnostics.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ let explain t =
7070
" If you're trying to dereference a mutable value, use `myValue.contents` instead.\n" ^
7171
" To concatenate strings, use `\"a\" ++ \"b\"` instead."
7272
| _ ->
73-
"I have no idea what this character means…"
73+
"Not sure what to do with this character."
7474
end
7575
| Expected {context; token = t} ->
7676
let hint = match context with

syntax/tests/parsing/errors/scanner/__snapshots__/parse.spec.js.snap

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
11
// Jest Snapshot v1, https://goo.gl/fbAQLP
22

3+
exports[`badCharacter.js 1`] = `
4+
"=====Parsetree==========================================
5+
let 1 = [%rescript.exprhole ]
6+
=====Errors=============================================
7+
8+
Syntax error!
9+
parsing/errors/scanner/badCharacter.js:1:5
10+
1 │ let $ = 1
11+
12+
Not sure what to do with this character.
13+
14+
15+
Syntax error!
16+
parsing/errors/scanner/badCharacter.js:1:5-7
17+
1 │ let $ = 1
18+
19+
I was expecting a name for this let-binding. Example: \`let message = \\"hello\\"\`
20+
21+
22+
========================================================"
23+
`;
24+
325
exports[`escapeSequence.js 1`] = `
426
"=====Parsetree==========================================
527
let x = \\"\\\\\\\\0\\"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
let $ = 1

0 commit comments

Comments
 (0)