]>
luflow.net public git repositories - flow-web.git/blob - static/highlight/es/languages/reasonml.js
1 /*! `reasonml` grammar compiled for Highlight.js 11.11.1 */
2 var hljsGrammar
= (function () {
7 Description: Reason lets you write simple, fast and quality type safe code while leveraging both the JavaScript & OCaml ecosystems.
8 Website: https://reasonml.github.io
9 Author: Gidi Meir Morris <oss@gidi.io>
12 function reasonml(hljs
) {
13 const BUILT_IN_TYPES
= [
34 $pattern: /[a-z_]\w*!?/,
92 built_in: BUILT_IN_TYPES
,
93 literal: ["true", "false"],
95 illegal: /(:-|:=|\$\{|\+=)/,
99 match: /\[(\|\|)?\]|\(\)/,
102 hljs
.C_LINE_COMMENT_MODE
,
103 hljs
.COMMENT(/\/\*/, /\*\//, { illegal: /^(#,\/\/)/ }),
104 { /* type variable */
106 match: /\'[A-Za-z_](?!\')[\w\']*/
107 /* the grammar is ambiguous on how 'a'b should be interpreted but not the compiler */
109 { /* polymorphic variant */
111 match: /`[A-Z][\w\']*/
113 { /* module or constructor */
115 match: /\b[A-Z][\w\']*/,
118 { /* don't color identifiers, but safely catch all identifiers with ' */
119 match: /[a-z_]\w*\'[\w\']*/,
124 match: /\s+(\|\||\+[\+\.]?|\*[\*\/\.]?|\/[\.]?|\.\.\.|\|>|&&|===?)\s+/,
127 hljs
.inherit(hljs
.APOS_STRING_MODE
, {
131 hljs
.inherit(hljs
.QUOTE_STRING_MODE
, { illegal: null }),
135 { match: /\b0[xX][a-fA-F0-9_]+[Lln]?/ },
136 { match: /\b0[oO][0-7_]+[Lln]?/ },
137 { match: /\b0[bB][01_]+[Lln]?/ },
138 { match: /\b[0-9][0-9_]*([Lln]|(\.[0-9_]*)?([eE][-+]?[0-9_]+)?)/ },
150 export default hljsGrammar
;