Skip to content

Commit c5ed709

Browse files
committedApr 25, 2023
fix: wrong next state in regex state
1 parent 990745a commit c5ed709

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed
 

‎src/mode/_test/text_lucene.txt

+1
Original file line numberDiff line numberDiff line change
@@ -55,3 +55,4 @@ esc\:aped
5555
esc\\aped
5656
esc\ aped:foo
5757
"foo\"bar"
58+
foo:/bar/

‎src/mode/_test/tokens_lucene.json

+6
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,12 @@
327327
],[
328328
"start",
329329
["string","\"foo\\\"bar\""]
330+
],[
331+
"start",
332+
["keyword","foo:"],
333+
["string.regexp.start","/"],
334+
["string.regexp","bar"],
335+
["string.regexp.end","/"]
330336
],[
331337
"start"
332338
]]

‎src/mode/lucene_highlight_rules.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ var LuceneHighlightRules = function() {
7373
// flag
7474
token: "string.regexp.end",
7575
regex: "/[sxngimy]*",
76-
next: "no_regex"
76+
next: "start"
7777
}, {
7878
// invalid operators
7979
token : "invalid",
@@ -96,7 +96,7 @@ var LuceneHighlightRules = function() {
9696
}, {
9797
token: "empty",
9898
regex: "$",
99-
next: "no_regex"
99+
next: "start"
100100
}, {
101101
defaultToken: "string.regexp"
102102
}
@@ -115,9 +115,9 @@ var LuceneHighlightRules = function() {
115115
}, {
116116
token: "empty",
117117
regex: "$",
118-
next: "no_regex"
118+
next: "start"
119119
}, {
120-
defaultToken: "string.regexp.charachterclass"
120+
defaultToken: "string.regexp.characterclass"
121121
}
122122
]
123123
};

0 commit comments

Comments
 (0)
Please sign in to comment.