diff --git a/components/prism-monkey.js b/components/prism-monkey.js index 88f9b0b8ce..c5b7f6118a 100644 --- a/components/prism-monkey.js +++ b/components/prism-monkey.js @@ -1,25 +1,23 @@ Prism.languages.monkey = { - 'string': /"[^"\r\n]*"/, - 'comment': [ - { - pattern: /^#Rem\s[\s\S]*?^#End/im, - greedy: true - }, - { - pattern: /'.+/, - greedy: true - } - ], + 'comment': { + pattern: /^#Rem\s[\s\S]*?^#End|'.+/im, + greedy: true + }, + 'string': { + pattern: /"[^"\r\n]*"/, + greedy: true, + }, 'preprocessor': { pattern: /(^[ \t]*)#.+/m, lookbehind: true, - alias: 'comment' + greedy: true, + alias: 'property' }, + 'function': /\b\w+(?=\()/, 'type-char': { - pattern: /(\w)[?%#$]/, - lookbehind: true, - alias: 'variable' + pattern: /\b[?%#$]/, + alias: 'class-name' }, 'number': { pattern: /((?:\.\.)?)(?:(?:\b|\B-\.?|\B\.)\d+(?:(?!\.\.)\.\d*)?|\$[\da-f]+)/i, diff --git a/components/prism-monkey.min.js b/components/prism-monkey.min.js index 00ab56dbba..5908950a50 100644 --- a/components/prism-monkey.min.js +++ b/components/prism-monkey.min.js @@ -1 +1 @@ -Prism.languages.monkey={string:/"[^"\r\n]*"/,comment:[{pattern:/^#Rem\s[\s\S]*?^#End/im,greedy:!0},{pattern:/'.+/,greedy:!0}],preprocessor:{pattern:/(^[ \t]*)#.+/m,lookbehind:!0,alias:"comment"},function:/\b\w+(?=\()/,"type-char":{pattern:/(\w)[?%#$]/,lookbehind:!0,alias:"variable"},number:{pattern:/((?:\.\.)?)(?:(?:\b|\B-\.?|\B\.)\d+(?:(?!\.\.)\.\d*)?|\$[\da-f]+)/i,lookbehind:!0},keyword:/\b(?:Abstract|Array|Bool|Case|Catch|Class|Const|Continue|Default|Eachin|Else|ElseIf|End|EndIf|Exit|Extends|Extern|False|Field|Final|Float|For|Forever|Function|Global|If|Implements|Import|Inline|Int|Interface|Local|Method|Module|New|Next|Null|Object|Private|Property|Public|Repeat|Return|Select|Self|Step|Strict|String|Super|Then|Throw|To|True|Try|Until|Void|Wend|While)\b/i,operator:/\.\.|<[=>]?|>=?|:?=|(?:[+\-*\/&~|]|\b(?:Mod|Shl|Shr)\b)=?|\b(?:And|Not|Or)\b/i,punctuation:/[.,:;()\[\]]/}; \ No newline at end of file +Prism.languages.monkey={comment:{pattern:/^#Rem\s[\s\S]*?^#End|'.+/im,greedy:!0},string:{pattern:/"[^"\r\n]*"/,greedy:!0},preprocessor:{pattern:/(^[ \t]*)#.+/m,lookbehind:!0,greedy:!0,alias:"property"},function:/\b\w+(?=\()/,"type-char":{pattern:/\b[?%#$]/,alias:"class-name"},number:{pattern:/((?:\.\.)?)(?:(?:\b|\B-\.?|\B\.)\d+(?:(?!\.\.)\.\d*)?|\$[\da-f]+)/i,lookbehind:!0},keyword:/\b(?:Abstract|Array|Bool|Case|Catch|Class|Const|Continue|Default|Eachin|Else|ElseIf|End|EndIf|Exit|Extends|Extern|False|Field|Final|Float|For|Forever|Function|Global|If|Implements|Import|Inline|Int|Interface|Local|Method|Module|New|Next|Null|Object|Private|Property|Public|Repeat|Return|Select|Self|Step|Strict|String|Super|Then|Throw|To|True|Try|Until|Void|Wend|While)\b/i,operator:/\.\.|<[=>]?|>=?|:?=|(?:[+\-*\/&~|]|\b(?:Mod|Shl|Shr)\b)=?|\b(?:And|Not|Or)\b/i,punctuation:/[.,:;()\[\]]/}; \ No newline at end of file