File tree 3 files changed +94
-4
lines changed
3 files changed +94
-4
lines changed Original file line number Diff line number Diff line change @@ -3,9 +3,10 @@ merlin NEXT_VERSION
3
3
4
4
+ merlin binary
5
5
- destruct: Removal of residual patterns (#1737 , fixes #1560 )
6
- - Do not erase fields' names when destructing punned record fields (#1734 ,
6
+ - Do not erase fields' names when destructing punned record fields (#1734 ,
7
7
fixes #1661 )
8
8
- Ignore SIGPIPE in the Merlin server process (#1746 )
9
+ - Fix lexing of quoted strings in comments (#1754 , fixes #1753 )
9
10
10
11
merlin 4.14
11
12
===========
Original file line number Diff line number Diff line change @@ -658,10 +658,8 @@ and comment state = parse
658
658
state.buffer <- buffer;
659
659
Buffer.add_char state.buffer '\"';
660
660
comment state lexbuf }
661
- | "{" ('%' '%'? extattrident blank*) ? lowercase* " |"
661
+ | "{" ('%' '%'? extattrident blank*) ? ( lowercase* as delim) " |"
662
662
{
663
- let delim = Lexing. lexeme lexbuf in
664
- let delim = String. sub delim ~pos: 1 ~len: (String. length delim - 2 ) in
665
663
state.string_start_loc < - Location. curr lexbuf;
666
664
Buffer. add_string state.buffer (Lexing. lexeme lexbuf);
667
665
(catch (quoted_string delim state lexbuf) (fun e l -> match e with
Original file line number Diff line number Diff line change
1
+ should be accepted
2
+ $ $ MERLIN single errors -filename main. ml << ' EOF' | \
3
+ > jq ' .value[0]'
4
+ > (* {% ext | babar| } * )
5
+ > EOF
6
+ null
7
+
8
+ should fail
9
+ $ $ MERLIN single errors -filename main. ml << ' EOF' | \
10
+ > jq ' .value[0]'
11
+ > (* {% ext id| babar| } * )
12
+ > EOF
13
+ {
14
+ " start" : {
15
+ " line" : 1 ,
16
+ " col" : 0
17
+ },
18
+ " end" : {
19
+ " line" : 1 ,
20
+ " col" : 2
21
+ },
22
+ " type" : " typer" ,
23
+ " sub" : [
24
+ {
25
+ " start" : {
26
+ " line" : 1 ,
27
+ " col" : 0
28
+ },
29
+ " end" : {
30
+ " line" : 1 ,
31
+ " col" : 2
32
+ },
33
+ " message" : " String literal begins here"
34
+ }
35
+ ],
36
+ " valid" : true,
37
+ " message" : " This comment contains an unterminated string literal"
38
+ }
39
+
40
+ should accept
41
+ $ $ MERLIN single errors -filename main. ml << ' EOF' | \
42
+ > jq ' .value[0]'
43
+ > (* {% ext id| babar| id} * )
44
+ > EOF
45
+ null
46
+
47
+ should accept
48
+ $ $ MERLIN single errors -filename main. ml << ' EOF' | \
49
+ > jq ' .value[0]'
50
+ > (* {id| babar| id} * )
51
+ > EOF
52
+ null
53
+
54
+ should accept
55
+ $ $ MERLIN single errors -filename main. ml << ' EOF' | \
56
+ > jq ' .value[0]'
57
+ > (* {| babar| } * )
58
+ > EOF
59
+ null
60
+
61
+ should fail
62
+ $ $ MERLIN single errors -filename main. ml << ' EOF' | \
63
+ > jq ' .value[0]'
64
+ > (* {id| babar| } * )
65
+ > EOF
66
+ {
67
+ " start" : {
68
+ " line" : 1 ,
69
+ " col" : 0
70
+ },
71
+ " end" : {
72
+ " line" : 1 ,
73
+ " col" : 2
74
+ },
75
+ " type" : " typer" ,
76
+ " sub" : [
77
+ {
78
+ " start" : {
79
+ " line" : 1 ,
80
+ " col" : 0
81
+ },
82
+ " end" : {
83
+ " line" : 1 ,
84
+ " col" : 2
85
+ },
86
+ " message" : " String literal begins here"
87
+ }
88
+ ],
89
+ " valid" : true,
90
+ " message" : " This comment contains an unterminated string literal"
91
+ }
You can’t perform that action at this time.
0 commit comments