basant307/AI_Governance_Project
048
1/*2Language: Nim3Description: Nim is a statically typed compiled systems programming language.4Website: https://nim-lang.org5Category: system6*/7 8function nim(hljs) {9 const TYPES = [10 "int",11 "int8",12 "int16",13 "int32",14 "int64",15 "uint",16 "uint8",17 "uint16",18 "uint32",19 "uint64",20 "float",21 "float32",22 "float64",23 "bool",24 "char",25 "string",26 "cstring",27 "pointer",28 "expr",29 "stmt",30 "void",31 "auto",32 "any",33 "range",34 "array",35 "openarray",36 "varargs",37 "seq",38 "set",39 "clong",40 "culong",41 "cchar",42 "cschar",43 "cshort",44 "cint",45 "csize",46 "clonglong",47 "cfloat",48 "cdouble",49 "clongdouble",50 "cuchar",51 "cushort",52 "cuint",53 "culonglong",54 "cstringarray",55 "semistatic"56 ];57 const KEYWORDS = [58 "addr",59 "and",60 "as",61 "asm",62 "bind",63 "block",64 "break",65 "case",66 "cast",67 "concept",68 "const",69 "continue",70 "converter",71 "defer",72 "discard",73 "distinct",74 "div",75 "do",76 "elif",77 "else",78 "end",79 "enum",80 "except",81 "export",82 "finally",83 "for",84 "from",85 "func",86 "generic",87 "guarded",88 "if",89 "import",90 "in",91 "include",92 "interface",93 "is",94 "isnot",95 "iterator",96 "let",97 "macro",98 "method",99 "mixin",100 "mod",101 "nil",102 "not",103 "notin",104 "object",105 "of",106 "or",107 "out",108 "proc",109 "ptr",110 "raise",111 "ref",112 "return",113 "shared",114 "shl",115 "shr",116 "static",117 "template",118 "try",119 "tuple",120 "type",121 "using",122 "var",123 "when",124 "while",125 "with",126 "without",127 "xor",128 "yield"129 ];130 const BUILT_INS = [131 "stdin",132 "stdout",133 "stderr",134 "result"135 ];136 const LITERALS = [137 "true",138 "false"139 ];140 return {141 name: 'Nim',142 keywords: {143 keyword: KEYWORDS,144 literal: LITERALS,145 type: TYPES,146 built_in: BUILT_INS147 },148 contains: [149 {150 className: 'meta', // Actually pragma151 begin: /\{\./,152 end: /\.\}/,153 relevance: 10154 },155 {156 className: 'string',157 begin: /[a-zA-Z]\w*"/,158 end: /"/,159 contains: [ { begin: /""/ } ]160 },161 {162 className: 'string',163 begin: /([a-zA-Z]\w*)?"""/,164 end: /"""/165 },166 hljs.QUOTE_STRING_MODE,167 {168 className: 'type',169 begin: /\b[A-Z]\w+\b/,170 relevance: 0171 },172 {173 className: 'number',174 relevance: 0,175 variants: [176 { begin: /\b(0[xX][0-9a-fA-F][_0-9a-fA-F]*)('?[iIuU](8|16|32|64))?/ },177 { begin: /\b(0o[0-7][_0-7]*)('?[iIuUfF](8|16|32|64))?/ },178 { begin: /\b(0(b|B)[01][_01]*)('?[iIuUfF](8|16|32|64))?/ },179 { begin: /\b(\d[_\d]*)('?[iIuUfF](8|16|32|64))?/ }180 ]181 },182 hljs.HASH_COMMENT_MODE183 ]184 };185}186 187export { nim as default };188 