basant307/AI_Governance_Project
048
1/*2Language: Monkey3Description: Monkey2 is an easy to use, cross platform, games oriented programming language from Blitz Research.4Author: Arthur Bikmullin <devolonter@gmail.com>5Website: https://blitzresearch.itch.io/monkey26Category: gaming7*/8 9function monkey(hljs) {10 const NUMBER = {11 className: 'number',12 relevance: 0,13 variants: [14 { begin: '[$][a-fA-F0-9]+' },15 hljs.NUMBER_MODE16 ]17 };18 const FUNC_DEFINITION = {19 variants: [20 { match: [21 /(function|method)/,22 /\s+/,23 hljs.UNDERSCORE_IDENT_RE,24 ] },25 ],26 scope: {27 1: "keyword",28 3: "title.function"29 }30 };31 const CLASS_DEFINITION = {32 variants: [33 { match: [34 /(class|interface|extends|implements)/,35 /\s+/,36 hljs.UNDERSCORE_IDENT_RE,37 ] },38 ],39 scope: {40 1: "keyword",41 3: "title.class"42 }43 };44 const BUILT_INS = [45 "DebugLog",46 "DebugStop",47 "Error",48 "Print",49 "ACos",50 "ACosr",51 "ASin",52 "ASinr",53 "ATan",54 "ATan2",55 "ATan2r",56 "ATanr",57 "Abs",58 "Abs",59 "Ceil",60 "Clamp",61 "Clamp",62 "Cos",63 "Cosr",64 "Exp",65 "Floor",66 "Log",67 "Max",68 "Max",69 "Min",70 "Min",71 "Pow",72 "Sgn",73 "Sgn",74 "Sin",75 "Sinr",76 "Sqrt",77 "Tan",78 "Tanr",79 "Seed",80 "PI",81 "HALFPI",82 "TWOPI"83 ];84 const LITERALS = [85 "true",86 "false",87 "null"88 ];89 const KEYWORDS = [90 "public",91 "private",92 "property",93 "continue",94 "exit",95 "extern",96 "new",97 "try",98 "catch",99 "eachin",100 "not",101 "abstract",102 "final",103 "select",104 "case",105 "default",106 "const",107 "local",108 "global",109 "field",110 "end",111 "if",112 "then",113 "else",114 "elseif",115 "endif",116 "while",117 "wend",118 "repeat",119 "until",120 "forever",121 "for",122 "to",123 "step",124 "next",125 "return",126 "module",127 "inline",128 "throw",129 "import",130 // not positive, but these are not literals131 "and",132 "or",133 "shl",134 "shr",135 "mod"136 ];137 138 return {139 name: 'Monkey',140 case_insensitive: true,141 keywords: {142 keyword: KEYWORDS,143 built_in: BUILT_INS,144 literal: LITERALS145 },146 illegal: /\/\*/,147 contains: [148 hljs.COMMENT('#rem', '#end'),149 hljs.COMMENT(150 "'",151 '$',152 { relevance: 0 }153 ),154 FUNC_DEFINITION,155 CLASS_DEFINITION,156 {157 className: 'variable.language',158 begin: /\b(self|super)\b/159 },160 {161 className: 'meta',162 begin: /\s*#/,163 end: '$',164 keywords: { keyword: 'if else elseif endif end then' }165 },166 {167 match: [168 /^\s*/,169 /strict\b/170 ],171 scope: { 2: "meta" }172 },173 {174 beginKeywords: 'alias',175 end: '=',176 contains: [ hljs.UNDERSCORE_TITLE_MODE ]177 },178 hljs.QUOTE_STRING_MODE,179 NUMBER180 ]181 };182}183 184export { monkey as default };185 