basant307/AI_Governance_Project
048
1/*2Language: SML (Standard ML)3Author: Edwin Dalorzo <edwin@dalorzo.org>4Description: SML language definition.5Website: https://www.smlnj.org6Origin: ocaml.js7Category: functional8*/9function sml(hljs) {10 return {11 name: 'SML (Standard ML)',12 aliases: [ 'ml' ],13 keywords: {14 $pattern: '[a-z_]\\w*!?',15 keyword:16 /* according to Definition of Standard ML 97 */17 'abstype and andalso as case datatype do else end eqtype '18 + 'exception fn fun functor handle if in include infix infixr '19 + 'let local nonfix of op open orelse raise rec sharing sig '20 + 'signature struct structure then type val with withtype where while',21 built_in:22 /* built-in types according to basis library */23 'array bool char exn int list option order real ref string substring vector unit word',24 literal:25 'true false NONE SOME LESS EQUAL GREATER nil'26 },27 illegal: /\/\/|>>/,28 contains: [29 {30 className: 'literal',31 begin: /\[(\|\|)?\]|\(\)/,32 relevance: 033 },34 hljs.COMMENT(35 '\\(\\*',36 '\\*\\)',37 { contains: [ 'self' ] }38 ),39 { /* type variable */40 className: 'symbol',41 begin: '\'[A-Za-z_](?!\')[\\w\']*'42 /* the grammar is ambiguous on how 'a'b should be interpreted but not the compiler */43 },44 { /* polymorphic variant */45 className: 'type',46 begin: '`[A-Z][\\w\']*'47 },48 { /* module or constructor */49 className: 'type',50 begin: '\\b[A-Z][\\w\']*',51 relevance: 052 },53 { /* don't color identifiers, but safely catch all identifiers with ' */54 begin: '[a-z_]\\w*\'[\\w\']*' },55 hljs.inherit(hljs.APOS_STRING_MODE, {56 className: 'string',57 relevance: 058 }),59 hljs.inherit(hljs.QUOTE_STRING_MODE, { illegal: null }),60 {61 className: 'number',62 begin:63 '\\b(0[xX][a-fA-F0-9_]+[Lln]?|'64 + '0[oO][0-7_]+[Lln]?|'65 + '0[bB][01_]+[Lln]?|'66 + '[0-9][0-9_]*([Lln]|(\\.[0-9_]*)?([eE][-+]?[0-9_]+)?)?)',67 relevance: 068 },69 { begin: /[-=]>/ // relevance booster70 }71 ]72 };73}74 75export { sml as default };76 