Skip to content

Commit 5f5f38c

Browse files
committed
OCaml: Regexp simplification
1 parent 9be0f88 commit 5f5f38c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

components/prism-ocaml.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,16 @@ Prism.languages.ocaml = {
1212
],
1313
'number': /\b-?(?:0x[\da-f][\da-f_]+|(?:0[bo])?\d[\d_]*\.?[\d_]*(?:e[+-]?[\d_]+)?)/i,
1414
'type': {
15-
pattern: /\B['`][a-z\d_]*/i,
15+
pattern: /\B['`]\w*/,
1616
alias: 'variable'
1717
},
1818
'directive': {
19-
pattern: /\B#[a-z\d_]+/i,
19+
pattern: /\B#\w+/,
2020
alias: 'function'
2121
},
2222
'keyword': /\b(?:as|assert|begin|class|constraint|do|done|downto|else|end|exception|external|for|fun|function|functor|if|in|include|inherit|initializer|lazy|let|match|method|module|mutable|new|object|of|open|prefix|private|rec|then|sig|struct|to|try|type|val|value|virtual|where|while|with)\b/,
2323
'boolean': /\b(?:false|true)\b/,
2424
// Custom operators are allowed
25-
'operator': /:=|[=<>@^|&+\-*\/$%!?~][!$%&\*+\-.\/:<=>?@^|~]*|\b(?:and|asr|land|lor|lxor|lsl|lsr|mod|nor|or)\b/,
25+
'operator': /:=|[=<>@^|&+\-*\/$%!?~][!$%&*+\-.\/:<=>?@^|~]*|\b(?:and|asr|land|lor|lxor|lsl|lsr|mod|nor|or)\b/,
2626
'punctuation': /[(){}\[\]|_.,:;]/
2727
};

components/prism-ocaml.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)