Skip to content

Commit

Permalink
fix: wrong next state in regex state
Browse files Browse the repository at this point in the history
  • Loading branch information
mkslanc committed Apr 25, 2023
1 parent 990745a commit c5ed709
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/mode/_test/text_lucene.txt
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,4 @@ esc\:aped
esc\\aped
esc\ aped:foo
"foo\"bar"
foo:/bar/
6 changes: 6 additions & 0 deletions src/mode/_test/tokens_lucene.json
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,12 @@
],[
"start",
["string","\"foo\\\"bar\""]
],[
"start",
["keyword","foo:"],
["string.regexp.start","/"],
["string.regexp","bar"],
["string.regexp.end","/"]
],[
"start"
]]
8 changes: 4 additions & 4 deletions src/mode/lucene_highlight_rules.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ var LuceneHighlightRules = function() {
// flag
token: "string.regexp.end",
regex: "/[sxngimy]*",
next: "no_regex"
next: "start"
}, {
// invalid operators
token : "invalid",
Expand All @@ -96,7 +96,7 @@ var LuceneHighlightRules = function() {
}, {
token: "empty",
regex: "$",
next: "no_regex"
next: "start"
}, {
defaultToken: "string.regexp"
}
Expand All @@ -115,9 +115,9 @@ var LuceneHighlightRules = function() {
}, {
token: "empty",
regex: "$",
next: "no_regex"
next: "start"
}, {
defaultToken: "string.regexp.charachterclass"
defaultToken: "string.regexp.characterclass"
}
]
};
Expand Down

0 comments on commit c5ed709

Please sign in to comment.