]>
luflow.net public git repositories - flow-web.git/blob - static/highlight/languages/reasonml.js
1 /*! `reasonml` grammar compiled for Highlight.js 11.11.1 */
3 var hljsGrammar
= (function () {
8 Description: Reason lets you write simple, fast and quality type safe code while leveraging both the JavaScript & OCaml ecosystems.
9 Website: https://reasonml.github.io
10 Author: Gidi Meir Morris <oss@gidi.io>
13 function reasonml(hljs
) {
14 const BUILT_IN_TYPES
= [
35 $pattern: /[a-z_]\w*!?/,
93 built_in: BUILT_IN_TYPES
,
94 literal: ["true", "false"],
96 illegal: /(:-|:=|\$\{|\+=)/,
100 match: /\[(\|\|)?\]|\(\)/,
103 hljs
.C_LINE_COMMENT_MODE
,
104 hljs
.COMMENT(/\/\*/, /\*\//, { illegal: /^(#,\/\/)/ }),
105 { /* type variable */
107 match: /\'[A-Za-z_](?!\')[\w\']*/
108 /* the grammar is ambiguous on how 'a'b should be interpreted but not the compiler */
110 { /* polymorphic variant */
112 match: /`[A-Z][\w\']*/
114 { /* module or constructor */
116 match: /\b[A-Z][\w\']*/,
119 { /* don't color identifiers, but safely catch all identifiers with ' */
120 match: /[a-z_]\w*\'[\w\']*/,
125 match: /\s+(\|\||\+[\+\.]?|\*[\*\/\.]?|\/[\.]?|\.\.\.|\|>|&&|===?)\s+/,
128 hljs
.inherit(hljs
.APOS_STRING_MODE
, {
132 hljs
.inherit(hljs
.QUOTE_STRING_MODE
, { illegal: null }),
136 { match: /\b0[xX][a-fA-F0-9_]+[Lln]?/ },
137 { match: /\b0[oO][0-7_]+[Lln]?/ },
138 { match: /\b0[bB][01_]+[Lln]?/ },
139 { match: /\b[0-9][0-9_]*([Lln]|(\.[0-9_]*)?([eE][-+]?[0-9_]+)?)/ },
151 hljs
.registerLanguage('reasonml', hljsGrammar
);