]>
luflow.net public git repositories - flow-web.git/blob - static/highlight/es/languages/sml.js
1 /*! `sml` grammar compiled for Highlight.js 11.11.1 */
2 var hljsGrammar
= (function () {
6 Language: SML (Standard ML)
7 Author: Edwin Dalorzo <edwin@dalorzo.org>
8 Description: SML language definition.
9 Website: https://www.smlnj.org
15 name: 'SML (Standard ML)',
18 $pattern: '[a-z_]\\w*!?',
20 /* according to Definition of Standard ML 97 */
21 'abstype and andalso as case datatype do else end eqtype '
22 + 'exception fn fun functor handle if in include infix infixr '
23 + 'let local nonfix of op open orelse raise rec sharing sig '
24 + 'signature struct structure then type val with withtype where while',
26 /* built-in types according to basis library */
27 'array bool char exn int list option order real ref string substring vector unit word',
29 'true false NONE SOME LESS EQUAL GREATER nil'
35 begin: /\[(\|\|)?\]|\(\)/,
41 { contains: [ 'self' ] }
45 begin: '\'[A-Za-z_](?!\')[\\w\']*'
46 /* the grammar is ambiguous on how 'a'b should be interpreted but not the compiler */
48 { /* polymorphic variant */
50 begin: '`[A-Z][\\w\']*'
52 { /* module or constructor */
54 begin: '\\b[A-Z][\\w\']*',
57 { /* don't color identifiers, but safely catch all identifiers with ' */
58 begin: '[a-z_]\\w*\'[\\w\']*' },
59 hljs
.inherit(hljs
.APOS_STRING_MODE
, {
63 hljs
.inherit(hljs
.QUOTE_STRING_MODE
, { illegal: null }),
67 '\\b(0[xX][a-fA-F0-9_]+[Lln]?|'
68 + '0[oO][0-7_]+[Lln]?|'
69 + '0[bB][01_]+[Lln]?|'
70 + '[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)',
73 { begin: /[-=]>/ // relevance booster
83 export default hljsGrammar
;