Skip to content

Commit ebaccf6

Browse files
committed
[mathematica mode] Remove some regexps with exponential blowup risk
1 parent 749409d commit ebaccf6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mode/mathematica/mathematica.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@ CodeMirror.defineMode('mathematica', function(_config, _parserConfig) {
7171
}
7272

7373
// usage
74-
if (stream.match(/([a-zA-Z\$]+(?:`?[a-zA-Z0-9\$])*::usage)/, true, false)) {
74+
if (stream.match(/([a-zA-Z\$][a-zA-Z0-9\$]*(?:`[a-zA-Z0-9\$]+)*::usage)/, true, false)) {
7575
return 'meta';
7676
}
7777

7878
// message
79-
if (stream.match(/([a-zA-Z\$]+(?:`?[a-zA-Z0-9\$])*::[a-zA-Z\$][a-zA-Z0-9\$]*):?/, true, false)) {
79+
if (stream.match(/([a-zA-Z\$][a-zA-Z0-9\$]*(?:`[a-zA-Z0-9\$]+)*::[a-zA-Z\$][a-zA-Z0-9\$]*):?/, true, false)) {
8080
return 'string-2';
8181
}
8282

0 commit comments

Comments
 (0)