完成世界书、骰子、apiconfig页面处理
This commit is contained in:
+62
File diff suppressed because one or more lines are too long
+66
@@ -0,0 +1,66 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
abnf.displayName = 'abnf'
|
||||
abnf.aliases = []
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function abnf(Prism) {
|
||||
;(function (Prism) {
|
||||
var coreRules =
|
||||
'(?:ALPHA|BIT|CHAR|CR|CRLF|CTL|DIGIT|DQUOTE|HEXDIG|HTAB|LF|LWSP|OCTET|SP|VCHAR|WSP)'
|
||||
Prism.languages.abnf = {
|
||||
comment: /;.*/,
|
||||
string: {
|
||||
pattern: /(?:%[is])?"[^"\n\r]*"/,
|
||||
greedy: true,
|
||||
inside: {
|
||||
punctuation: /^%[is]/
|
||||
}
|
||||
},
|
||||
range: {
|
||||
pattern: /%(?:b[01]+-[01]+|d\d+-\d+|x[A-F\d]+-[A-F\d]+)/i,
|
||||
alias: 'number'
|
||||
},
|
||||
terminal: {
|
||||
pattern:
|
||||
/%(?:b[01]+(?:\.[01]+)*|d\d+(?:\.\d+)*|x[A-F\d]+(?:\.[A-F\d]+)*)/i,
|
||||
alias: 'number'
|
||||
},
|
||||
repetition: {
|
||||
pattern: /(^|[^\w-])(?:\d*\*\d*|\d+)/,
|
||||
lookbehind: true,
|
||||
alias: 'operator'
|
||||
},
|
||||
definition: {
|
||||
pattern: /(^[ \t]*)(?:[a-z][\w-]*|<[^<>\r\n]*>)(?=\s*=)/m,
|
||||
lookbehind: true,
|
||||
alias: 'keyword',
|
||||
inside: {
|
||||
punctuation: /<|>/
|
||||
}
|
||||
},
|
||||
'core-rule': {
|
||||
pattern: RegExp(
|
||||
'(?:(^|[^<\\w-])' + coreRules + '|<' + coreRules + '>)(?![\\w-])',
|
||||
'i'
|
||||
),
|
||||
lookbehind: true,
|
||||
alias: ['rule', 'constant'],
|
||||
inside: {
|
||||
punctuation: /<|>/
|
||||
}
|
||||
},
|
||||
rule: {
|
||||
pattern: /(^|[^<\w-])[a-z][\w-]*|<[^<>\r\n]*>/i,
|
||||
lookbehind: true,
|
||||
inside: {
|
||||
punctuation: /<|>/
|
||||
}
|
||||
},
|
||||
operator: /=\/?|\//,
|
||||
punctuation: /[()\[\]]/
|
||||
}
|
||||
})(Prism)
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/** @type {import('../core.js').Syntax} */
|
||||
declare function actionscript(Prism: any): void;
|
||||
declare namespace actionscript {
|
||||
let displayName: string;
|
||||
let aliases: any[];
|
||||
}
|
||||
export default actionscript;
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/** @type {import('../core.js').Syntax} */
|
||||
declare function al(Prism: any): void;
|
||||
declare namespace al {
|
||||
let displayName: string;
|
||||
let aliases: any[];
|
||||
}
|
||||
export default al;
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/** @type {import('../core.js').Syntax} */
|
||||
declare function apacheconf(Prism: any): void;
|
||||
declare namespace apacheconf {
|
||||
let displayName: string;
|
||||
let aliases: any[];
|
||||
}
|
||||
export default apacheconf;
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/** @type {import('../core.js').Syntax} */
|
||||
declare function apex(Prism: any): void;
|
||||
declare namespace apex {
|
||||
let displayName: string;
|
||||
let aliases: any[];
|
||||
}
|
||||
export default apex;
|
||||
+88
@@ -0,0 +1,88 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
import refractorClike from './clike.js'
|
||||
import refractorSql from './sql.js'
|
||||
apex.displayName = 'apex'
|
||||
apex.aliases = []
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function apex(Prism) {
|
||||
Prism.register(refractorClike)
|
||||
Prism.register(refractorSql)
|
||||
;(function (Prism) {
|
||||
var keywords =
|
||||
/\b(?:(?:after|before)(?=\s+[a-z])|abstract|activate|and|any|array|as|asc|autonomous|begin|bigdecimal|blob|boolean|break|bulk|by|byte|case|cast|catch|char|class|collect|commit|const|continue|currency|date|datetime|decimal|default|delete|desc|do|double|else|end|enum|exception|exit|export|extends|final|finally|float|for|from|get(?=\s*[{};])|global|goto|group|having|hint|if|implements|import|in|inner|insert|instanceof|int|integer|interface|into|join|like|limit|list|long|loop|map|merge|new|not|null|nulls|number|object|of|on|or|outer|override|package|parallel|pragma|private|protected|public|retrieve|return|rollback|select|set|short|sObject|sort|static|string|super|switch|synchronized|system|testmethod|then|this|throw|time|transaction|transient|trigger|try|undelete|update|upsert|using|virtual|void|webservice|when|where|while|(?:inherited|with|without)\s+sharing)\b/i
|
||||
var className =
|
||||
/\b(?:(?=[a-z_]\w*\s*[<\[])|(?!<keyword>))[A-Z_]\w*(?:\s*\.\s*[A-Z_]\w*)*\b(?:\s*(?:\[\s*\]|<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>))*/.source.replace(
|
||||
/<keyword>/g,
|
||||
function () {
|
||||
return keywords.source
|
||||
}
|
||||
)
|
||||
/** @param {string} pattern */
|
||||
function insertClassName(pattern) {
|
||||
return RegExp(
|
||||
pattern.replace(/<CLASS-NAME>/g, function () {
|
||||
return className
|
||||
}),
|
||||
'i'
|
||||
)
|
||||
}
|
||||
var classNameInside = {
|
||||
keyword: keywords,
|
||||
punctuation: /[()\[\]{};,:.<>]/
|
||||
}
|
||||
Prism.languages.apex = {
|
||||
comment: Prism.languages.clike.comment,
|
||||
string: Prism.languages.clike.string,
|
||||
sql: {
|
||||
pattern: /((?:[=,({:]|\breturn)\s*)\[[^\[\]]*\]/i,
|
||||
lookbehind: true,
|
||||
greedy: true,
|
||||
alias: 'language-sql',
|
||||
inside: Prism.languages.sql
|
||||
},
|
||||
annotation: {
|
||||
pattern: /@\w+\b/,
|
||||
alias: 'punctuation'
|
||||
},
|
||||
'class-name': [
|
||||
{
|
||||
pattern: insertClassName(
|
||||
/(\b(?:class|enum|extends|implements|instanceof|interface|new|trigger\s+\w+\s+on)\s+)<CLASS-NAME>/
|
||||
.source
|
||||
),
|
||||
lookbehind: true,
|
||||
inside: classNameInside
|
||||
},
|
||||
{
|
||||
// cast
|
||||
pattern: insertClassName(
|
||||
/(\(\s*)<CLASS-NAME>(?=\s*\)\s*[\w(])/.source
|
||||
),
|
||||
lookbehind: true,
|
||||
inside: classNameInside
|
||||
},
|
||||
{
|
||||
// variable/parameter declaration and return types
|
||||
pattern: insertClassName(/<CLASS-NAME>(?=\s*\w+\s*[;=,(){:])/.source),
|
||||
inside: classNameInside
|
||||
}
|
||||
],
|
||||
trigger: {
|
||||
pattern: /(\btrigger\s+)\w+\b/i,
|
||||
lookbehind: true,
|
||||
alias: 'class-name'
|
||||
},
|
||||
keyword: keywords,
|
||||
function: /\b[a-z_]\w*(?=\s*\()/i,
|
||||
boolean: /\b(?:false|true)\b/i,
|
||||
number: /(?:\B\.\d+|\b\d+(?:\.\d+|L)?)\b/i,
|
||||
operator:
|
||||
/[!=](?:==?)?|\?\.?|&&|\|\||--|\+\+|[-+*/^&|]=?|:|<<?=?|>{1,3}=?/,
|
||||
punctuation: /[()\[\]{};,.]/
|
||||
}
|
||||
})(Prism)
|
||||
}
|
||||
+44
@@ -0,0 +1,44 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
apl.displayName = 'apl'
|
||||
apl.aliases = []
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function apl(Prism) {
|
||||
Prism.languages.apl = {
|
||||
comment: /(?:⍝|#[! ]).*$/m,
|
||||
string: {
|
||||
pattern: /'(?:[^'\r\n]|'')*'/,
|
||||
greedy: true
|
||||
},
|
||||
number:
|
||||
/¯?(?:\d*\.?\b\d+(?:e[+¯]?\d+)?|¯|∞)(?:j¯?(?:(?:\d+(?:\.\d+)?|\.\d+)(?:e[+¯]?\d+)?|¯|∞))?/i,
|
||||
statement: /:[A-Z][a-z][A-Za-z]*\b/,
|
||||
'system-function': {
|
||||
pattern: /⎕[A-Z]+/i,
|
||||
alias: 'function'
|
||||
},
|
||||
constant: /[⍬⌾#⎕⍞]/,
|
||||
function:
|
||||
/[-+×÷⌈⌊∣|⍳⍸?*⍟○!⌹<≤=>≥≠≡≢∊⍷∪∩~∨∧⍱⍲⍴,⍪⌽⊖⍉↑↓⊂⊃⊆⊇⌷⍋⍒⊤⊥⍕⍎⊣⊢⍁⍂≈⍯↗¤→]/,
|
||||
'monadic-operator': {
|
||||
pattern: /[\\\/⌿⍀¨⍨⌶&∥]/,
|
||||
alias: 'operator'
|
||||
},
|
||||
'dyadic-operator': {
|
||||
pattern: /[.⍣⍠⍤∘⌸@⌺⍥]/,
|
||||
alias: 'operator'
|
||||
},
|
||||
assignment: {
|
||||
pattern: /←/,
|
||||
alias: 'keyword'
|
||||
},
|
||||
punctuation: /[\[;\]()◇⋄]/,
|
||||
dfn: {
|
||||
pattern: /[{}⍺⍵⍶⍹∇⍫:]/,
|
||||
alias: 'builtin'
|
||||
}
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/** @type {import('../core.js').Syntax} */
|
||||
declare function applescript(Prism: any): void;
|
||||
declare namespace applescript {
|
||||
let displayName: string;
|
||||
let aliases: any[];
|
||||
}
|
||||
export default applescript;
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
applescript.displayName = 'applescript'
|
||||
applescript.aliases = []
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function applescript(Prism) {
|
||||
Prism.languages.applescript = {
|
||||
comment: [
|
||||
// Allow one level of nesting
|
||||
/\(\*(?:\(\*(?:[^*]|\*(?!\)))*\*\)|(?!\(\*)[\s\S])*?\*\)/,
|
||||
/--.+/,
|
||||
/#.+/
|
||||
],
|
||||
string: /"(?:\\.|[^"\\\r\n])*"/,
|
||||
number: /(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e-?\d+)?\b/i,
|
||||
operator: [
|
||||
/[&=≠≤≥*+\-\/÷^]|[<>]=?/,
|
||||
/\b(?:(?:begin|end|start)s? with|(?:contains?|(?:does not|doesn't) contain)|(?:is|isn't|is not) (?:contained by|in)|(?:(?:is|isn't|is not) )?(?:greater|less) than(?: or equal)?(?: to)?|(?:comes|(?:does not|doesn't) come) (?:after|before)|(?:is|isn't|is not) equal(?: to)?|(?:(?:does not|doesn't) equal|equal to|equals|is not|isn't)|(?:a )?(?:ref(?: to)?|reference to)|(?:and|as|div|mod|not|or))\b/
|
||||
],
|
||||
keyword:
|
||||
/\b(?:about|above|after|against|apart from|around|aside from|at|back|before|beginning|behind|below|beneath|beside|between|but|by|considering|continue|copy|does|eighth|else|end|equal|error|every|exit|false|fifth|first|for|fourth|from|front|get|given|global|if|ignoring|in|instead of|into|is|it|its|last|local|me|middle|my|ninth|of|on|onto|out of|over|prop|property|put|repeat|return|returning|second|set|seventh|since|sixth|some|tell|tenth|that|the|then|third|through|thru|timeout|times|to|transaction|true|try|until|where|while|whose|with|without)\b/,
|
||||
'class-name':
|
||||
/\b(?:POSIX file|RGB color|alias|application|boolean|centimeters|centimetres|class|constant|cubic centimeters|cubic centimetres|cubic feet|cubic inches|cubic meters|cubic metres|cubic yards|date|degrees Celsius|degrees Fahrenheit|degrees Kelvin|feet|file|gallons|grams|inches|integer|kilograms|kilometers|kilometres|list|liters|litres|meters|metres|miles|number|ounces|pounds|quarts|real|record|reference|script|square feet|square kilometers|square kilometres|square meters|square metres|square miles|square yards|text|yards)\b/,
|
||||
punctuation: /[{}():,¬«»《》]/
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/** @type {import('../core.js').Syntax} */
|
||||
declare function aql(Prism: any): void;
|
||||
declare namespace aql {
|
||||
let displayName: string;
|
||||
let aliases: any[];
|
||||
}
|
||||
export default aql;
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/** @type {import('../core.js').Syntax} */
|
||||
declare function arduino(Prism: any): void;
|
||||
declare namespace arduino {
|
||||
let displayName: string;
|
||||
let aliases: string[];
|
||||
}
|
||||
export default arduino;
|
||||
+21
@@ -0,0 +1,21 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
import refractorCpp from './cpp.js'
|
||||
arduino.displayName = 'arduino'
|
||||
arduino.aliases = ['ino']
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function arduino(Prism) {
|
||||
Prism.register(refractorCpp)
|
||||
Prism.languages.arduino = Prism.languages.extend('cpp', {
|
||||
keyword:
|
||||
/\b(?:String|array|bool|boolean|break|byte|case|catch|continue|default|do|double|else|finally|for|function|goto|if|in|instanceof|int|integer|long|loop|new|null|return|setup|string|switch|throw|try|void|while|word)\b/,
|
||||
constant:
|
||||
/\b(?:ANALOG_MESSAGE|DEFAULT|DIGITAL_MESSAGE|EXTERNAL|FIRMATA_STRING|HIGH|INPUT|INPUT_PULLUP|INTERNAL|INTERNAL1V1|INTERNAL2V56|LED_BUILTIN|LOW|OUTPUT|REPORT_ANALOG|REPORT_DIGITAL|SET_PIN_MODE|SYSEX_START|SYSTEM_RESET)\b/,
|
||||
builtin:
|
||||
/\b(?:Audio|BSSID|Bridge|Client|Console|EEPROM|Esplora|EsploraTFT|Ethernet|EthernetClient|EthernetServer|EthernetUDP|File|FileIO|FileSystem|Firmata|GPRS|GSM|GSMBand|GSMClient|GSMModem|GSMPIN|GSMScanner|GSMServer|GSMVoiceCall|GSM_SMS|HttpClient|IPAddress|IRread|Keyboard|KeyboardController|LiquidCrystal|LiquidCrystal_I2C|Mailbox|Mouse|MouseController|PImage|Process|RSSI|RobotControl|RobotMotor|SD|SPI|SSID|Scheduler|Serial|Server|Servo|SoftwareSerial|Stepper|Stream|TFT|Task|USBHost|WiFi|WiFiClient|WiFiServer|WiFiUDP|Wire|YunClient|YunServer|abs|addParameter|analogRead|analogReadResolution|analogReference|analogWrite|analogWriteResolution|answerCall|attach|attachGPRS|attachInterrupt|attached|autoscroll|available|background|beep|begin|beginPacket|beginSD|beginSMS|beginSpeaker|beginTFT|beginTransmission|beginWrite|bit|bitClear|bitRead|bitSet|bitWrite|blink|blinkVersion|buffer|changePIN|checkPIN|checkPUK|checkReg|circle|cityNameRead|cityNameWrite|clear|clearScreen|click|close|compassRead|config|connect|connected|constrain|cos|countryNameRead|countryNameWrite|createChar|cursor|debugPrint|delay|delayMicroseconds|detach|detachInterrupt|digitalRead|digitalWrite|disconnect|display|displayLogos|drawBMP|drawCompass|encryptionType|end|endPacket|endSMS|endTransmission|endWrite|exists|exitValue|fill|find|findUntil|flush|gatewayIP|get|getAsynchronously|getBand|getButton|getCurrentCarrier|getIMEI|getKey|getModifiers|getOemKey|getPINUsed|getResult|getSignalStrength|getSocket|getVoiceCallStatus|getXChange|getYChange|hangCall|height|highByte|home|image|interrupts|isActionDone|isDirectory|isListening|isPIN|isPressed|isValid|keyPressed|keyReleased|keyboardRead|knobRead|leftToRight|line|lineFollowConfig|listen|listenOnLocalhost|loadImage|localIP|lowByte|macAddress|maintain|map|max|messageAvailable|micros|millis|min|mkdir|motorsStop|motorsWrite|mouseDragged|mouseMoved|mousePressed|mouseReleased|move|noAutoscroll|noBlink|noBuffer|noCursor|noDisplay|noFill|noInterrupts|noListenOnLocalhost|noStroke|noTone|onReceive|onRequest|open|openNextFile|overflow|parseCommand|parseFloat|parseInt|parsePacket|pauseMode|peek|pinMode|playFile|playMelody|point|pointTo|position|pow|prepare|press|print|printFirmwareVersion|printVersion|println|process|processInput|pulseIn|put|random|randomSeed|read|readAccelerometer|readBlue|readButton|readBytes|readBytesUntil|readGreen|readJoystickButton|readJoystickSwitch|readJoystickX|readJoystickY|readLightSensor|readMessage|readMicrophone|readNetworks|readRed|readSlider|readString|readStringUntil|readTemperature|ready|rect|release|releaseAll|remoteIP|remoteNumber|remotePort|remove|requestFrom|retrieveCallingNumber|rewindDirectory|rightToLeft|rmdir|robotNameRead|robotNameWrite|run|runAsynchronously|runShellCommand|runShellCommandAsynchronously|running|scanNetworks|scrollDisplayLeft|scrollDisplayRight|seek|sendAnalog|sendDigitalPortPair|sendDigitalPorts|sendString|sendSysex|serialEvent|setBand|setBitOrder|setClockDivider|setCursor|setDNS|setDataMode|setFirmwareVersion|setMode|setPINUsed|setSpeed|setTextSize|setTimeout|shiftIn|shiftOut|shutdown|sin|size|sqrt|startLoop|step|stop|stroke|subnetMask|switchPIN|tan|tempoWrite|text|tone|transfer|tuneWrite|turn|updateIR|userNameRead|userNameWrite|voiceCall|waitContinue|width|write|writeBlue|writeGreen|writeJSON|writeMessage|writeMicroseconds|writeRGB|writeRed|yield)\b/
|
||||
})
|
||||
Prism.languages.ino = Prism.languages.arduino
|
||||
}
|
||||
+102
@@ -0,0 +1,102 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
arturo.displayName = 'arturo'
|
||||
arturo.aliases = ['art']
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function arturo(Prism) {
|
||||
;(function (Prism) {
|
||||
/**
|
||||
* @param {string} lang
|
||||
* @param {string} pattern
|
||||
*/
|
||||
var createLanguageString = function (lang, pattern) {
|
||||
return {
|
||||
pattern: RegExp(
|
||||
/\{!/.source + '(?:' + (pattern || lang) + ')' + /$[\s\S]*\}/.source,
|
||||
'm'
|
||||
),
|
||||
greedy: true,
|
||||
inside: {
|
||||
embedded: {
|
||||
pattern: /(^\{!\w+\b)[\s\S]+(?=\}$)/,
|
||||
lookbehind: true,
|
||||
alias: 'language-' + lang,
|
||||
inside: Prism.languages[lang]
|
||||
},
|
||||
string: /[\s\S]+/
|
||||
}
|
||||
}
|
||||
}
|
||||
Prism.languages.arturo = {
|
||||
comment: {
|
||||
pattern: /;.*/,
|
||||
greedy: true
|
||||
},
|
||||
character: {
|
||||
pattern: /`.`/,
|
||||
alias: 'char',
|
||||
greedy: true
|
||||
},
|
||||
number: {
|
||||
pattern: /\b\d+(?:\.\d+(?:\.\d+(?:-[\w+-]+)?)?)?\b/
|
||||
},
|
||||
string: {
|
||||
pattern: /"(?:[^"\\\r\n]|\\.)*"/,
|
||||
greedy: true
|
||||
},
|
||||
regex: {
|
||||
pattern: /\{\/.*?\/\}/,
|
||||
greedy: true
|
||||
},
|
||||
'html-string': createLanguageString('html'),
|
||||
'css-string': createLanguageString('css'),
|
||||
'js-string': createLanguageString('js'),
|
||||
'md-string': createLanguageString('md'),
|
||||
'sql-string': createLanguageString('sql'),
|
||||
'sh-string': createLanguageString('shell', 'sh'),
|
||||
multistring: {
|
||||
pattern: /».*|\{:[\s\S]*?:\}|\{[\s\S]*?\}|^-{6}$[\s\S]*/m,
|
||||
alias: 'string',
|
||||
greedy: true
|
||||
},
|
||||
label: {
|
||||
pattern: /\w+\b\??:/,
|
||||
alias: 'property'
|
||||
},
|
||||
literal: {
|
||||
pattern: /'(?:\w+\b\??:?)/,
|
||||
alias: 'constant'
|
||||
},
|
||||
type: {
|
||||
pattern: /:(?:\w+\b\??:?)/,
|
||||
alias: 'class-name'
|
||||
},
|
||||
color: /#\w+/,
|
||||
predicate: {
|
||||
pattern:
|
||||
/\b(?:all|and|any|ascii|attr|attribute|attributeLabel|binary|block|char|contains|database|date|dictionary|empty|equal|even|every|exists|false|floating|function|greater|greaterOrEqual|if|in|inline|integer|is|key|label|leap|less|lessOrEqual|literal|logical|lower|nand|negative|nor|not|notEqual|null|numeric|odd|or|path|pathLabel|positive|prefix|prime|regex|same|set|some|sorted|standalone|string|subset|suffix|superset|symbol|symbolLiteral|true|try|type|unless|upper|when|whitespace|word|xnor|xor|zero)\?/,
|
||||
alias: 'keyword'
|
||||
},
|
||||
'builtin-function': {
|
||||
pattern:
|
||||
/\b(?:abs|acos|acosh|acsec|acsech|actan|actanh|add|after|alert|alias|and|angle|append|arg|args|arity|array|as|asec|asech|asin|asinh|atan|atan2|atanh|attr|attrs|average|before|benchmark|blend|break|call|capitalize|case|ceil|chop|clear|clip|close|color|combine|conj|continue|copy|cos|cosh|crc|csec|csech|ctan|ctanh|cursor|darken|dec|decode|define|delete|desaturate|deviation|dialog|dictionary|difference|digest|digits|div|do|download|drop|dup|e|else|empty|encode|ensure|env|escape|execute|exit|exp|extend|extract|factors|fdiv|filter|first|flatten|floor|fold|from|function|gamma|gcd|get|goto|hash|hypot|if|inc|indent|index|infinity|info|input|insert|inspect|intersection|invert|jaro|join|keys|kurtosis|last|let|levenshtein|lighten|list|ln|log|loop|lower|mail|map|match|max|median|min|mod|module|mul|nand|neg|new|nor|normalize|not|now|null|open|or|outdent|pad|palette|panic|path|pause|permissions|permutate|pi|pop|popup|pow|powerset|powmod|prefix|print|prints|process|product|query|random|range|read|relative|remove|rename|render|repeat|replace|request|return|reverse|round|sample|saturate|script|sec|sech|select|serve|set|shl|shr|shuffle|sin|sinh|size|skewness|slice|sort|spin|split|sqrt|squeeze|stack|strip|sub|suffix|sum|switch|symbols|symlink|sys|take|tan|tanh|terminal|terminate|to|truncate|try|type|unclip|union|unique|unless|until|unzip|upper|values|var|variance|volume|webview|while|with|wordwrap|write|xnor|xor|zip)\b/,
|
||||
alias: 'keyword'
|
||||
},
|
||||
sugar: {
|
||||
pattern: /->|=>|\||::/,
|
||||
alias: 'operator'
|
||||
},
|
||||
punctuation: /[()[\],]/,
|
||||
symbol: {
|
||||
pattern: /<:|-:|ø|@|#|\+|\||\*|\$|---|-|%|\/|\.\.|\^|~|=|<|>|\\/
|
||||
},
|
||||
boolean: {
|
||||
pattern: /\b(?:false|maybe|true)\b/
|
||||
}
|
||||
}
|
||||
Prism.languages.art = Prism.languages['arturo']
|
||||
})(Prism)
|
||||
}
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
autohotkey.displayName = 'autohotkey'
|
||||
autohotkey.aliases = []
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function autohotkey(Prism) {
|
||||
// NOTES - follows first-first highlight method, block is locked after highlight, different from SyntaxHl
|
||||
Prism.languages.autohotkey = {
|
||||
comment: [
|
||||
{
|
||||
pattern: /(^|\s);.*/,
|
||||
lookbehind: true
|
||||
},
|
||||
{
|
||||
pattern:
|
||||
/(^[\t ]*)\/\*(?:[\r\n](?![ \t]*\*\/)|[^\r\n])*(?:[\r\n][ \t]*\*\/)?/m,
|
||||
lookbehind: true,
|
||||
greedy: true
|
||||
}
|
||||
],
|
||||
tag: {
|
||||
// labels
|
||||
pattern: /^([ \t]*)[^\s,`":]+(?=:[ \t]*$)/m,
|
||||
lookbehind: true
|
||||
},
|
||||
string: /"(?:[^"\n\r]|"")*"/,
|
||||
variable: /%\w+%/,
|
||||
number: /\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,
|
||||
operator:
|
||||
/\?|\/\/?=?|:=|\|[=|]?|&[=&]?|\+[=+]?|-[=-]?|\*[=*]?|<(?:<=?|>|=)?|>>?=?|[.^!=~]=?|\b(?:AND|NOT|OR)\b/,
|
||||
boolean: /\b(?:false|true)\b/,
|
||||
command: {
|
||||
pattern:
|
||||
/\b(?:AutoTrim|BlockInput|Break|Click|ClipWait|Continue|Control|ControlClick|ControlFocus|ControlGet|ControlGetFocus|ControlGetPos|ControlGetText|ControlMove|ControlSend|ControlSendRaw|ControlSetText|CoordMode|Critical|DetectHiddenText|DetectHiddenWindows|Drive|DriveGet|DriveSpaceFree|EnvAdd|EnvDiv|EnvGet|EnvMult|EnvSet|EnvSub|EnvUpdate|Exit|ExitApp|FileAppend|FileCopy|FileCopyDir|FileCreateDir|FileCreateShortcut|FileDelete|FileEncoding|FileGetAttrib|FileGetShortcut|FileGetSize|FileGetTime|FileGetVersion|FileInstall|FileMove|FileMoveDir|FileRead|FileReadLine|FileRecycle|FileRecycleEmpty|FileRemoveDir|FileSelectFile|FileSelectFolder|FileSetAttrib|FileSetTime|FormatTime|GetKeyState|Gosub|Goto|GroupActivate|GroupAdd|GroupClose|GroupDeactivate|Gui|GuiControl|GuiControlGet|Hotkey|ImageSearch|IniDelete|IniRead|IniWrite|Input|InputBox|KeyWait|ListHotkeys|ListLines|ListVars|Loop|Menu|MouseClick|MouseClickDrag|MouseGetPos|MouseMove|MsgBox|OnExit|OutputDebug|Pause|PixelGetColor|PixelSearch|PostMessage|Process|Progress|Random|RegDelete|RegRead|RegWrite|Reload|Repeat|Return|Run|RunAs|RunWait|Send|SendEvent|SendInput|SendMessage|SendMode|SendPlay|SendRaw|SetBatchLines|SetCapslockState|SetControlDelay|SetDefaultMouseSpeed|SetEnv|SetFormat|SetKeyDelay|SetMouseDelay|SetNumlockState|SetRegView|SetScrollLockState|SetStoreCapslockMode|SetTimer|SetTitleMatchMode|SetWinDelay|SetWorkingDir|Shutdown|Sleep|Sort|SoundBeep|SoundGet|SoundGetWaveVolume|SoundPlay|SoundSet|SoundSetWaveVolume|SplashImage|SplashTextOff|SplashTextOn|SplitPath|StatusBarGetText|StatusBarWait|StringCaseSense|StringGetPos|StringLeft|StringLen|StringLower|StringMid|StringReplace|StringRight|StringSplit|StringTrimLeft|StringTrimRight|StringUpper|Suspend|SysGet|Thread|ToolTip|Transform|TrayTip|URLDownloadToFile|WinActivate|WinActivateBottom|WinClose|WinGet|WinGetActiveStats|WinGetActiveTitle|WinGetClass|WinGetPos|WinGetText|WinGetTitle|WinHide|WinKill|WinMaximize|WinMenuSelectItem|WinMinimize|WinMinimizeAll|WinMinimizeAllUndo|WinMove|WinRestore|WinSet|WinSetTitle|WinShow|WinWait|WinWaitActive|WinWaitClose|WinWaitNotActive)\b/i,
|
||||
alias: 'selector'
|
||||
},
|
||||
constant:
|
||||
/\b(?:a_ahkpath|a_ahkversion|a_appdata|a_appdatacommon|a_autotrim|a_batchlines|a_caretx|a_carety|a_computername|a_controldelay|a_cursor|a_dd|a_ddd|a_dddd|a_defaultmousespeed|a_desktop|a_desktopcommon|a_detecthiddentext|a_detecthiddenwindows|a_endchar|a_eventinfo|a_exitreason|a_fileencoding|a_formatfloat|a_formatinteger|a_gui|a_guicontrol|a_guicontrolevent|a_guievent|a_guiheight|a_guiwidth|a_guix|a_guiy|a_hour|a_iconfile|a_iconhidden|a_iconnumber|a_icontip|a_index|a_ipaddress1|a_ipaddress2|a_ipaddress3|a_ipaddress4|a_is64bitos|a_isadmin|a_iscompiled|a_iscritical|a_ispaused|a_issuspended|a_isunicode|a_keydelay|a_language|a_lasterror|a_linefile|a_linenumber|a_loopfield|a_loopfileattrib|a_loopfiledir|a_loopfileext|a_loopfilefullpath|a_loopfilelongpath|a_loopfilename|a_loopfileshortname|a_loopfileshortpath|a_loopfilesize|a_loopfilesizekb|a_loopfilesizemb|a_loopfiletimeaccessed|a_loopfiletimecreated|a_loopfiletimemodified|a_loopreadline|a_loopregkey|a_loopregname|a_loopregsubkey|a_loopregtimemodified|a_loopregtype|a_mday|a_min|a_mm|a_mmm|a_mmmm|a_mon|a_mousedelay|a_msec|a_mydocuments|a_now|a_nowutc|a_numbatchlines|a_ostype|a_osversion|a_priorhotkey|a_priorkey|a_programfiles|a_programs|a_programscommon|a_ptrsize|a_regview|a_screendpi|a_screenheight|a_screenwidth|a_scriptdir|a_scriptfullpath|a_scripthwnd|a_scriptname|a_sec|a_space|a_startmenu|a_startmenucommon|a_startup|a_startupcommon|a_stringcasesense|a_tab|a_temp|a_thisfunc|a_thishotkey|a_thislabel|a_thismenu|a_thismenuitem|a_thismenuitempos|a_tickcount|a_timeidle|a_timeidlephysical|a_timesincepriorhotkey|a_timesincethishotkey|a_titlematchmode|a_titlematchmodespeed|a_username|a_wday|a_windelay|a_windir|a_workingdir|a_yday|a_year|a_yweek|a_yyyy|clipboard|clipboardall|comspec|errorlevel|programfiles)\b/i,
|
||||
builtin:
|
||||
/\b(?:abs|acos|asc|asin|atan|ceil|chr|class|comobjactive|comobjarray|comobjconnect|comobjcreate|comobjerror|comobjflags|comobjget|comobjquery|comobjtype|comobjvalue|cos|dllcall|exp|fileexist|Fileopen|floor|format|il_add|il_create|il_destroy|instr|isfunc|islabel|IsObject|ln|log|ltrim|lv_add|lv_delete|lv_deletecol|lv_getcount|lv_getnext|lv_gettext|lv_insert|lv_insertcol|lv_modify|lv_modifycol|lv_setimagelist|mod|numget|numput|onmessage|regexmatch|regexreplace|registercallback|round|rtrim|sb_seticon|sb_setparts|sb_settext|sin|sqrt|strlen|strreplace|strsplit|substr|tan|tv_add|tv_delete|tv_get|tv_getchild|tv_getcount|tv_getnext|tv_getparent|tv_getprev|tv_getselection|tv_gettext|tv_modify|varsetcapacity|winactive|winexist|__Call|__Get|__New|__Set)\b/i,
|
||||
symbol:
|
||||
/\b(?:alt|altdown|altup|appskey|backspace|browser_back|browser_favorites|browser_forward|browser_home|browser_refresh|browser_search|browser_stop|bs|capslock|ctrl|ctrlbreak|ctrldown|ctrlup|del|delete|down|end|enter|esc|escape|f1|f10|f11|f12|f13|f14|f15|f16|f17|f18|f19|f2|f20|f21|f22|f23|f24|f3|f4|f5|f6|f7|f8|f9|home|ins|insert|joy1|joy10|joy11|joy12|joy13|joy14|joy15|joy16|joy17|joy18|joy19|joy2|joy20|joy21|joy22|joy23|joy24|joy25|joy26|joy27|joy28|joy29|joy3|joy30|joy31|joy32|joy4|joy5|joy6|joy7|joy8|joy9|joyaxes|joybuttons|joyinfo|joyname|joypov|joyr|joyu|joyv|joyx|joyy|joyz|lalt|launch_app1|launch_app2|launch_mail|launch_media|lbutton|lcontrol|lctrl|left|lshift|lwin|lwindown|lwinup|mbutton|media_next|media_play_pause|media_prev|media_stop|numlock|numpad0|numpad1|numpad2|numpad3|numpad4|numpad5|numpad6|numpad7|numpad8|numpad9|numpadadd|numpadclear|numpaddel|numpaddiv|numpaddot|numpaddown|numpadend|numpadenter|numpadhome|numpadins|numpadleft|numpadmult|numpadpgdn|numpadpgup|numpadright|numpadsub|numpadup|pgdn|pgup|printscreen|ralt|rbutton|rcontrol|rctrl|right|rshift|rwin|rwindown|rwinup|scrolllock|shift|shiftdown|shiftup|space|tab|up|volume_down|volume_mute|volume_up|wheeldown|wheelleft|wheelright|wheelup|xbutton1|xbutton2)\b/i,
|
||||
directive: {
|
||||
pattern: /#[a-z]+\b/i,
|
||||
alias: 'important'
|
||||
},
|
||||
keyword:
|
||||
/\b(?:Abort|AboveNormal|Add|ahk_class|ahk_exe|ahk_group|ahk_id|ahk_pid|All|Alnum|Alpha|AltSubmit|AltTab|AltTabAndMenu|AltTabMenu|AltTabMenuDismiss|AlwaysOnTop|AutoSize|Background|BackgroundTrans|BelowNormal|between|BitAnd|BitNot|BitOr|BitShiftLeft|BitShiftRight|BitXOr|Bold|Border|Button|ByRef|Catch|Checkbox|Checked|CheckedGray|Choose|ChooseString|Close|Color|ComboBox|Contains|ControlList|Count|Date|DateTime|Days|DDL|Default|DeleteAll|Delimiter|Deref|Destroy|Digit|Disable|Disabled|DropDownList|Edit|Eject|Else|Enable|Enabled|Error|Exist|Expand|ExStyle|FileSystem|Finally|First|Flash|Float|FloatFast|Focus|Font|for|global|Grid|Group|GroupBox|GuiClose|GuiContextMenu|GuiDropFiles|GuiEscape|GuiSize|Hdr|Hidden|Hide|High|HKCC|HKCR|HKCU|HKEY_CLASSES_ROOT|HKEY_CURRENT_CONFIG|HKEY_CURRENT_USER|HKEY_LOCAL_MACHINE|HKEY_USERS|HKLM|HKU|Hours|HScroll|Icon|IconSmall|ID|IDLast|If|IfEqual|IfExist|IfGreater|IfGreaterOrEqual|IfInString|IfLess|IfLessOrEqual|IfMsgBox|IfNotEqual|IfNotExist|IfNotInString|IfWinActive|IfWinExist|IfWinNotActive|IfWinNotExist|Ignore|ImageList|in|Integer|IntegerFast|Interrupt|is|italic|Join|Label|LastFound|LastFoundExist|Limit|Lines|List|ListBox|ListView|local|Lock|Logoff|Low|Lower|Lowercase|MainWindow|Margin|Maximize|MaximizeBox|MaxSize|Minimize|MinimizeBox|MinMax|MinSize|Minutes|MonthCal|Mouse|Move|Multi|NA|No|NoActivate|NoDefault|NoHide|NoIcon|NoMainWindow|norm|Normal|NoSort|NoSortHdr|NoStandard|Not|NoTab|NoTimers|Number|Off|Ok|On|OwnDialogs|Owner|Parse|Password|Picture|Pixel|Pos|Pow|Priority|ProcessName|Radio|Range|Read|ReadOnly|Realtime|Redraw|Region|REG_BINARY|REG_DWORD|REG_EXPAND_SZ|REG_MULTI_SZ|REG_SZ|Relative|Rename|Report|Resize|Restore|Retry|RGB|Screen|Seconds|Section|Serial|SetLabel|ShiftAltTab|Show|Single|Slider|SortDesc|Standard|static|Status|StatusBar|StatusCD|strike|Style|Submit|SysMenu|Tab2|TabStop|Text|Theme|Throw|Tile|ToggleCheck|ToggleEnable|ToolWindow|Top|Topmost|TransColor|Transparent|Tray|TreeView|Try|TryAgain|Type|UnCheck|underline|Unicode|Unlock|Until|UpDown|Upper|Uppercase|UseErrorLevel|Vis|VisFirst|Visible|VScroll|Wait|WaitClose|WantCtrlA|WantF2|WantReturn|While|Wrap|Xdigit|xm|xp|xs|Yes|ym|yp|ys)\b/i,
|
||||
function: /[^(); \t,\n+*\-=?>:\\\/<&%\[\]]+(?=\()/,
|
||||
punctuation: /[{}[\]():,]/
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/** @type {import('../core.js').Syntax} */
|
||||
declare function batch(Prism: any): void;
|
||||
declare namespace batch {
|
||||
let displayName: string;
|
||||
let aliases: any[];
|
||||
}
|
||||
export default batch;
|
||||
+110
@@ -0,0 +1,110 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
batch.displayName = 'batch'
|
||||
batch.aliases = []
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function batch(Prism) {
|
||||
;(function (Prism) {
|
||||
var variable = /%%?[~:\w]+%?|!\S+!/
|
||||
var parameter = {
|
||||
pattern: /\/[a-z?]+(?=[ :]|$):?|-[a-z]\b|--[a-z-]+\b/im,
|
||||
alias: 'attr-name',
|
||||
inside: {
|
||||
punctuation: /:/
|
||||
}
|
||||
}
|
||||
var string = /"(?:[\\"]"|[^"])*"(?!")/
|
||||
var number = /(?:\b|-)\d+\b/
|
||||
Prism.languages.batch = {
|
||||
comment: [
|
||||
/^::.*/m,
|
||||
{
|
||||
pattern: /((?:^|[&(])[ \t]*)rem\b(?:[^^&)\r\n]|\^(?:\r\n|[\s\S]))*/im,
|
||||
lookbehind: true
|
||||
}
|
||||
],
|
||||
label: {
|
||||
pattern: /^:.*/m,
|
||||
alias: 'property'
|
||||
},
|
||||
command: [
|
||||
{
|
||||
// FOR command
|
||||
pattern:
|
||||
/((?:^|[&(])[ \t]*)for(?: \/[a-z?](?:[ :](?:"[^"]*"|[^\s"/]\S*))?)* \S+ in \([^)]+\) do/im,
|
||||
lookbehind: true,
|
||||
inside: {
|
||||
keyword: /\b(?:do|in)\b|^for\b/i,
|
||||
string: string,
|
||||
parameter: parameter,
|
||||
variable: variable,
|
||||
number: number,
|
||||
punctuation: /[()',]/
|
||||
}
|
||||
},
|
||||
{
|
||||
// IF command
|
||||
pattern:
|
||||
/((?:^|[&(])[ \t]*)if(?: \/[a-z?](?:[ :](?:"[^"]*"|[^\s"/]\S*))?)* (?:not )?(?:cmdextversion \d+|defined \w+|errorlevel \d+|exist \S+|(?:"[^"]*"|(?!")(?:(?!==)\S)+)?(?:==| (?:equ|geq|gtr|leq|lss|neq) )(?:"[^"]*"|[^\s"]\S*))/im,
|
||||
lookbehind: true,
|
||||
inside: {
|
||||
keyword:
|
||||
/\b(?:cmdextversion|defined|errorlevel|exist|not)\b|^if\b/i,
|
||||
string: string,
|
||||
parameter: parameter,
|
||||
variable: variable,
|
||||
number: number,
|
||||
operator: /\^|==|\b(?:equ|geq|gtr|leq|lss|neq)\b/i
|
||||
}
|
||||
},
|
||||
{
|
||||
// ELSE command
|
||||
pattern: /((?:^|[&()])[ \t]*)else\b/im,
|
||||
lookbehind: true,
|
||||
inside: {
|
||||
keyword: /^else\b/i
|
||||
}
|
||||
},
|
||||
{
|
||||
// SET command
|
||||
pattern:
|
||||
/((?:^|[&(])[ \t]*)set(?: \/[a-z](?:[ :](?:"[^"]*"|[^\s"/]\S*))?)* (?:[^^&)\r\n]|\^(?:\r\n|[\s\S]))*/im,
|
||||
lookbehind: true,
|
||||
inside: {
|
||||
keyword: /^set\b/i,
|
||||
string: string,
|
||||
parameter: parameter,
|
||||
variable: [variable, /\w+(?=(?:[*\/%+\-&^|]|<<|>>)?=)/],
|
||||
number: number,
|
||||
operator: /[*\/%+\-&^|]=?|<<=?|>>=?|[!~_=]/,
|
||||
punctuation: /[()',]/
|
||||
}
|
||||
},
|
||||
{
|
||||
// Other commands
|
||||
pattern:
|
||||
/((?:^|[&(])[ \t]*@?)\w+\b(?:"(?:[\\"]"|[^"])*"(?!")|[^"^&)\r\n]|\^(?:\r\n|[\s\S]))*/m,
|
||||
lookbehind: true,
|
||||
inside: {
|
||||
keyword: /^\w+\b/,
|
||||
string: string,
|
||||
parameter: parameter,
|
||||
label: {
|
||||
pattern: /(^\s*):\S+/m,
|
||||
lookbehind: true,
|
||||
alias: 'property'
|
||||
},
|
||||
variable: variable,
|
||||
number: number,
|
||||
operator: /\^/
|
||||
}
|
||||
}
|
||||
],
|
||||
operator: /[&@]/,
|
||||
punctuation: /[()']/
|
||||
}
|
||||
})(Prism)
|
||||
}
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
import refractorClike from './clike.js'
|
||||
birb.displayName = 'birb'
|
||||
birb.aliases = []
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function birb(Prism) {
|
||||
Prism.register(refractorClike)
|
||||
Prism.languages.birb = Prism.languages.extend('clike', {
|
||||
string: {
|
||||
pattern: /r?("|')(?:\\.|(?!\1)[^\\])*\1/,
|
||||
greedy: true
|
||||
},
|
||||
'class-name': [
|
||||
/\b[A-Z](?:[\d_]*[a-zA-Z]\w*)?\b/,
|
||||
// matches variable and function return types (parameters as well).
|
||||
/\b(?:[A-Z]\w*|(?!(?:var|void)\b)[a-z]\w*)(?=\s+\w+\s*[;,=()])/
|
||||
],
|
||||
keyword:
|
||||
/\b(?:assert|break|case|class|const|default|else|enum|final|follows|for|grab|if|nest|new|next|noSeeb|return|static|switch|throw|var|void|while)\b/,
|
||||
operator: /\+\+|--|&&|\|\||<<=?|>>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?|:/,
|
||||
variable: /\b[a-z_]\w*\b/
|
||||
})
|
||||
Prism.languages.insertBefore('birb', 'function', {
|
||||
metadata: {
|
||||
pattern: /<\w+>/,
|
||||
greedy: true,
|
||||
alias: 'symbol'
|
||||
}
|
||||
})
|
||||
}
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
bqn.displayName = 'bqn'
|
||||
bqn.aliases = []
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function bqn(Prism) {
|
||||
Prism.languages.bqn = {
|
||||
shebang: {
|
||||
pattern: /^#![ \t]*\/.*/,
|
||||
alias: 'important',
|
||||
greedy: true
|
||||
},
|
||||
comment: {
|
||||
pattern: /#.*/,
|
||||
greedy: true
|
||||
},
|
||||
'string-literal': {
|
||||
pattern: /"(?:[^"]|"")*"/,
|
||||
greedy: true,
|
||||
alias: 'string'
|
||||
},
|
||||
'character-literal': {
|
||||
pattern: /'(?:[\s\S]|[\uD800-\uDBFF][\uDC00-\uDFFF])'/,
|
||||
greedy: true,
|
||||
alias: 'char'
|
||||
},
|
||||
function: /•[\w¯.∞π]+[\w¯.∞π]*/,
|
||||
'dot-notation-on-brackets': {
|
||||
pattern: /\{(?=.*\}\.)|\}\./,
|
||||
alias: 'namespace'
|
||||
},
|
||||
'special-name': {
|
||||
pattern: /(?:𝕨|𝕩|𝕗|𝕘|𝕤|𝕣|𝕎|𝕏|𝔽|𝔾|𝕊|_𝕣_|_𝕣)/,
|
||||
alias: 'keyword'
|
||||
},
|
||||
'dot-notation-on-name': {
|
||||
pattern: /[A-Za-z_][\w¯∞π]*\./,
|
||||
alias: 'namespace'
|
||||
},
|
||||
'word-number-scientific': {
|
||||
pattern: /\d+(?:\.\d+)?[eE]¯?\d+/,
|
||||
alias: 'number'
|
||||
},
|
||||
'word-name': {
|
||||
pattern: /[A-Za-z_][\w¯∞π]*/,
|
||||
alias: 'symbol'
|
||||
},
|
||||
'word-number': {
|
||||
pattern:
|
||||
/[¯∞π]?(?:\d*\.?\b\d+(?:e[+¯]?\d+|E[+¯]?\d+)?|¯|∞|π)(?:j¯?(?:(?:\d+(?:\.\d+)?|\.\d+)(?:e[+¯]?\d+|E[+¯]?\d+)?|¯|∞|π))?/,
|
||||
alias: 'number'
|
||||
},
|
||||
'null-literal': {
|
||||
pattern: /@/,
|
||||
alias: 'char'
|
||||
},
|
||||
'primitive-functions': {
|
||||
pattern: /[-+×÷⋆√⌊⌈|¬∧∨<>≠=≤≥≡≢⊣⊢⥊∾≍⋈↑↓↕«»⌽⍉/⍋⍒⊏⊑⊐⊒∊⍷⊔!]/,
|
||||
alias: 'operator'
|
||||
},
|
||||
'primitive-1-operators': {
|
||||
pattern: /[`˜˘¨⁼⌜´˝˙]/,
|
||||
alias: 'operator'
|
||||
},
|
||||
'primitive-2-operators': {
|
||||
pattern: /[∘⊸⟜○⌾⎉⚇⍟⊘◶⎊]/,
|
||||
alias: 'operator'
|
||||
},
|
||||
punctuation: /[←⇐↩(){}⟨⟩[\]‿·⋄,.;:?]/
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/** @type {import('../core.js').Syntax} */
|
||||
declare function brainfuck(Prism: any): void;
|
||||
declare namespace brainfuck {
|
||||
let displayName: string;
|
||||
let aliases: any[];
|
||||
}
|
||||
export default brainfuck;
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/** @type {import('../core.js').Syntax} */
|
||||
declare function brightscript(Prism: any): void;
|
||||
declare namespace brightscript {
|
||||
let displayName: string;
|
||||
let aliases: any[];
|
||||
}
|
||||
export default brightscript;
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
bro.displayName = 'bro'
|
||||
bro.aliases = []
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function bro(Prism) {
|
||||
Prism.languages.bro = {
|
||||
comment: {
|
||||
pattern: /(^|[^\\$])#.*/,
|
||||
lookbehind: true,
|
||||
inside: {
|
||||
italic: /\b(?:FIXME|TODO|XXX)\b/
|
||||
}
|
||||
},
|
||||
string: {
|
||||
pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
|
||||
greedy: true
|
||||
},
|
||||
boolean: /\b[TF]\b/,
|
||||
function: {
|
||||
pattern: /(\b(?:event|function|hook)[ \t]+)\w+(?:::\w+)?/,
|
||||
lookbehind: true
|
||||
},
|
||||
builtin:
|
||||
/(?:@(?:load(?:-(?:plugin|sigs))?|unload|prefixes|ifn?def|else|(?:end)?if|DIR|FILENAME))|(?:&?(?:add_func|create_expire|default|delete_func|encrypt|error_handler|expire_func|group|log|mergeable|optional|persistent|priority|raw_output|read_expire|redef|rotate_interval|rotate_size|synchronized|type_column|write_expire))/,
|
||||
constant: {
|
||||
pattern: /(\bconst[ \t]+)\w+/i,
|
||||
lookbehind: true
|
||||
},
|
||||
keyword:
|
||||
/\b(?:add|addr|alarm|any|bool|break|const|continue|count|delete|double|else|enum|event|export|file|for|function|global|hook|if|in|int|interval|local|module|next|of|opaque|pattern|port|print|record|return|schedule|set|string|subnet|table|time|timeout|using|vector|when)\b/,
|
||||
operator: /--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&|\|\|?|\?|\*|\/|~|\^|%/,
|
||||
number: /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
|
||||
punctuation: /[{}[\];(),.:]/
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/** @type {import('../core.js').Syntax} */
|
||||
declare function bsl(Prism: any): void;
|
||||
declare namespace bsl {
|
||||
let displayName: string;
|
||||
let aliases: string[];
|
||||
}
|
||||
export default bsl;
|
||||
+88
@@ -0,0 +1,88 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
bsl.displayName = 'bsl'
|
||||
bsl.aliases = ['oscript']
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function bsl(Prism) {
|
||||
/* eslint-disable no-misleading-character-class */
|
||||
|
||||
// 1C:Enterprise
|
||||
// https://github.com/Diversus23/
|
||||
//
|
||||
Prism.languages.bsl = {
|
||||
comment: /\/\/.*/,
|
||||
string: [
|
||||
// Строки
|
||||
// Strings
|
||||
{
|
||||
pattern: /"(?:[^"]|"")*"(?!")/,
|
||||
greedy: true
|
||||
},
|
||||
// Дата и время
|
||||
// Date & time
|
||||
{
|
||||
pattern: /'(?:[^'\r\n\\]|\\.)*'/
|
||||
}
|
||||
],
|
||||
keyword: [
|
||||
{
|
||||
// RU
|
||||
pattern:
|
||||
/(^|[^\w\u0400-\u0484\u0487-\u052f\u1d2b\u1d78\u2de0-\u2dff\ua640-\ua69f\ufe2e\ufe2f])(?:пока|для|новый|прервать|попытка|исключение|вызватьисключение|иначе|конецпопытки|неопределено|функция|перем|возврат|конецфункции|если|иначеесли|процедура|конецпроцедуры|тогда|знач|экспорт|конецесли|из|каждого|истина|ложь|по|цикл|конеццикла|выполнить)(?![\w\u0400-\u0484\u0487-\u052f\u1d2b\u1d78\u2de0-\u2dff\ua640-\ua69f\ufe2e\ufe2f])/i,
|
||||
lookbehind: true
|
||||
},
|
||||
{
|
||||
// EN
|
||||
pattern:
|
||||
/\b(?:break|do|each|else|elseif|enddo|endfunction|endif|endprocedure|endtry|except|execute|export|false|for|function|if|in|new|null|procedure|raise|return|then|to|true|try|undefined|val|var|while)\b/i
|
||||
}
|
||||
],
|
||||
number: {
|
||||
pattern:
|
||||
/(^(?=\d)|[^\w\u0400-\u0484\u0487-\u052f\u1d2b\u1d78\u2de0-\u2dff\ua640-\ua69f\ufe2e\ufe2f])(?:\d+(?:\.\d*)?|\.\d+)(?:E[+-]?\d+)?/i,
|
||||
lookbehind: true
|
||||
},
|
||||
operator: [
|
||||
/[<>+\-*/]=?|[%=]/,
|
||||
// RU
|
||||
{
|
||||
pattern:
|
||||
/(^|[^\w\u0400-\u0484\u0487-\u052f\u1d2b\u1d78\u2de0-\u2dff\ua640-\ua69f\ufe2e\ufe2f])(?:и|или|не)(?![\w\u0400-\u0484\u0487-\u052f\u1d2b\u1d78\u2de0-\u2dff\ua640-\ua69f\ufe2e\ufe2f])/i,
|
||||
lookbehind: true
|
||||
},
|
||||
// EN
|
||||
{
|
||||
pattern: /\b(?:and|not|or)\b/i
|
||||
}
|
||||
],
|
||||
punctuation: /\(\.|\.\)|[()\[\]:;,.]/,
|
||||
directive: [
|
||||
// Теги препроцессора вида &Клиент, &Сервер, ...
|
||||
// Preprocessor tags of the type &Client, &Server, ...
|
||||
{
|
||||
pattern: /^([ \t]*)&.*/m,
|
||||
lookbehind: true,
|
||||
greedy: true,
|
||||
alias: 'important'
|
||||
},
|
||||
// Инструкции препроцессора вида:
|
||||
// #Если Сервер Тогда
|
||||
// ...
|
||||
// #КонецЕсли
|
||||
// Preprocessor instructions of the form:
|
||||
// #If Server Then
|
||||
// ...
|
||||
// #EndIf
|
||||
{
|
||||
pattern: /^([ \t]*)#.*/gm,
|
||||
lookbehind: true,
|
||||
greedy: true,
|
||||
alias: 'important'
|
||||
}
|
||||
]
|
||||
}
|
||||
Prism.languages.oscript = Prism.languages['bsl']
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/** @type {import('../core.js').Syntax} */
|
||||
declare function c(Prism: any): void;
|
||||
declare namespace c {
|
||||
let displayName: string;
|
||||
let aliases: any[];
|
||||
}
|
||||
export default c;
|
||||
+58
@@ -0,0 +1,58 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
import refractorClike from './clike.js'
|
||||
cfscript.displayName = 'cfscript'
|
||||
cfscript.aliases = ['cfc']
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function cfscript(Prism) {
|
||||
Prism.register(refractorClike)
|
||||
// https://cfdocs.org/script
|
||||
Prism.languages.cfscript = Prism.languages.extend('clike', {
|
||||
comment: [
|
||||
{
|
||||
pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
|
||||
lookbehind: true,
|
||||
inside: {
|
||||
annotation: {
|
||||
pattern: /(?:^|[^.])@[\w\.]+/,
|
||||
alias: 'punctuation'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
pattern: /(^|[^\\:])\/\/.*/,
|
||||
lookbehind: true,
|
||||
greedy: true
|
||||
}
|
||||
],
|
||||
keyword:
|
||||
/\b(?:abstract|break|catch|component|continue|default|do|else|extends|final|finally|for|function|if|in|include|package|private|property|public|remote|required|rethrow|return|static|switch|throw|try|var|while|xml)\b(?!\s*=)/,
|
||||
operator: [
|
||||
/\+\+|--|&&|\|\||::|=>|[!=]==|[-+*/%&|^!=<>]=?|\?(?:\.|:)?|:/,
|
||||
/\b(?:and|contains|eq|equal|eqv|gt|gte|imp|is|lt|lte|mod|not|or|xor)\b/
|
||||
],
|
||||
scope: {
|
||||
pattern:
|
||||
/\b(?:application|arguments|cgi|client|cookie|local|session|super|this|variables)\b/,
|
||||
alias: 'global'
|
||||
},
|
||||
type: {
|
||||
pattern:
|
||||
/\b(?:any|array|binary|boolean|date|guid|numeric|query|string|struct|uuid|void|xml)\b/,
|
||||
alias: 'builtin'
|
||||
}
|
||||
})
|
||||
Prism.languages.insertBefore('cfscript', 'keyword', {
|
||||
// This must be declared before keyword because we use "function" inside the lookahead
|
||||
'function-variable': {
|
||||
pattern:
|
||||
/[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,
|
||||
alias: 'function'
|
||||
}
|
||||
})
|
||||
delete Prism.languages.cfscript['class-name']
|
||||
Prism.languages.cfc = Prism.languages['cfscript']
|
||||
}
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
import refractorClike from './clike.js'
|
||||
import refractorCpp from './cpp.js'
|
||||
chaiscript.displayName = 'chaiscript'
|
||||
chaiscript.aliases = []
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function chaiscript(Prism) {
|
||||
Prism.register(refractorClike)
|
||||
Prism.register(refractorCpp)
|
||||
Prism.languages.chaiscript = Prism.languages.extend('clike', {
|
||||
string: {
|
||||
pattern: /(^|[^\\])'(?:[^'\\]|\\[\s\S])*'/,
|
||||
lookbehind: true,
|
||||
greedy: true
|
||||
},
|
||||
'class-name': [
|
||||
{
|
||||
// e.g. class Rectangle { ... }
|
||||
pattern: /(\bclass\s+)\w+/,
|
||||
lookbehind: true
|
||||
},
|
||||
{
|
||||
// e.g. attr Rectangle::height, def Rectangle::area() { ... }
|
||||
pattern: /(\b(?:attr|def)\s+)\w+(?=\s*::)/,
|
||||
lookbehind: true
|
||||
}
|
||||
],
|
||||
keyword:
|
||||
/\b(?:attr|auto|break|case|catch|class|continue|def|default|else|finally|for|fun|global|if|return|switch|this|try|var|while)\b/,
|
||||
number: [Prism.languages.cpp.number, /\b(?:Infinity|NaN)\b/],
|
||||
operator:
|
||||
/>>=?|<<=?|\|\||&&|:[:=]?|--|\+\+|[=!<>+\-*/%|&^]=?|[?~]|`[^`\r\n]{1,4}`/
|
||||
})
|
||||
Prism.languages.insertBefore('chaiscript', 'operator', {
|
||||
'parameter-type': {
|
||||
// e.g. def foo(int x, Vector y) {...}
|
||||
pattern: /([,(]\s*)\w+(?=\s+\w)/,
|
||||
lookbehind: true,
|
||||
alias: 'class-name'
|
||||
}
|
||||
})
|
||||
Prism.languages.insertBefore('chaiscript', 'string', {
|
||||
'string-interpolation': {
|
||||
pattern:
|
||||
/(^|[^\\])"(?:[^"$\\]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\})*"/,
|
||||
lookbehind: true,
|
||||
greedy: true,
|
||||
inside: {
|
||||
interpolation: {
|
||||
pattern:
|
||||
/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\}/,
|
||||
lookbehind: true,
|
||||
inside: {
|
||||
'interpolation-expression': {
|
||||
pattern: /(^\$\{)[\s\S]+(?=\}$)/,
|
||||
lookbehind: true,
|
||||
inside: Prism.languages.chaiscript
|
||||
},
|
||||
'interpolation-punctuation': {
|
||||
pattern: /^\$\{|\}$/,
|
||||
alias: 'punctuation'
|
||||
}
|
||||
}
|
||||
},
|
||||
string: /[\s\S]+/
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
import refractorCpp from './cpp.js'
|
||||
cilkcpp.displayName = 'cilkcpp'
|
||||
cilkcpp.aliases = ['cilk', 'cilk-cpp']
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function cilkcpp(Prism) {
|
||||
Prism.register(refractorCpp)
|
||||
Prism.languages.cilkcpp = Prism.languages.insertBefore('cpp', 'function', {
|
||||
'parallel-keyword': {
|
||||
pattern: /\bcilk_(?:for|reducer|s(?:cope|pawn|ync))\b/,
|
||||
alias: 'keyword'
|
||||
}
|
||||
})
|
||||
Prism.languages['cilk-cpp'] = Prism.languages['cilkcpp']
|
||||
Prism.languages['cilk'] = Prism.languages['cilkcpp']
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
clike.displayName = 'clike'
|
||||
clike.aliases = []
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function clike(Prism) {
|
||||
Prism.languages.clike = {
|
||||
comment: [
|
||||
{
|
||||
pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
|
||||
lookbehind: true,
|
||||
greedy: true
|
||||
},
|
||||
{
|
||||
pattern: /(^|[^\\:])\/\/.*/,
|
||||
lookbehind: true,
|
||||
greedy: true
|
||||
}
|
||||
],
|
||||
string: {
|
||||
pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
|
||||
greedy: true
|
||||
},
|
||||
'class-name': {
|
||||
pattern:
|
||||
/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,
|
||||
lookbehind: true,
|
||||
inside: {
|
||||
punctuation: /[.\\]/
|
||||
}
|
||||
},
|
||||
keyword:
|
||||
/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,
|
||||
boolean: /\b(?:false|true)\b/,
|
||||
function: /\b\w+(?=\()/,
|
||||
number: /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
|
||||
operator: /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
|
||||
punctuation: /[{}[\];(),.:]/
|
||||
}
|
||||
}
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
cobol.displayName = 'cobol'
|
||||
cobol.aliases = []
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function cobol(Prism) {
|
||||
Prism.languages.cobol = {
|
||||
comment: {
|
||||
pattern: /\*>.*|(^[ \t]*)\*.*/m,
|
||||
lookbehind: true,
|
||||
greedy: true
|
||||
},
|
||||
string: {
|
||||
pattern: /[xzgn]?(?:"(?:[^\r\n"]|"")*"(?!")|'(?:[^\r\n']|'')*'(?!'))/i,
|
||||
greedy: true
|
||||
},
|
||||
level: {
|
||||
pattern: /(^[ \t]*)\d+\b/m,
|
||||
lookbehind: true,
|
||||
greedy: true,
|
||||
alias: 'number'
|
||||
},
|
||||
'class-name': {
|
||||
// https://github.com/antlr/grammars-v4/blob/42edd5b687d183b5fa679e858a82297bd27141e7/cobol85/Cobol85.g4#L1015
|
||||
pattern:
|
||||
/(\bpic(?:ture)?\s+)(?:(?:[-\w$/,:*+<>]|\.(?!\s|$))(?:\(\d+\))?)+/i,
|
||||
lookbehind: true,
|
||||
inside: {
|
||||
number: {
|
||||
pattern: /(\()\d+/,
|
||||
lookbehind: true
|
||||
},
|
||||
punctuation: /[()]/
|
||||
}
|
||||
},
|
||||
keyword: {
|
||||
pattern:
|
||||
/(^|[^\w-])(?:ABORT|ACCEPT|ACCESS|ADD|ADDRESS|ADVANCING|AFTER|ALIGNED|ALL|ALPHABET|ALPHABETIC|ALPHABETIC-LOWER|ALPHABETIC-UPPER|ALPHANUMERIC|ALPHANUMERIC-EDITED|ALSO|ALTER|ALTERNATE|ANY|ARE|AREA|AREAS|AS|ASCENDING|ASCII|ASSIGN|ASSOCIATED-DATA|ASSOCIATED-DATA-LENGTH|AT|ATTRIBUTE|AUTHOR|AUTO|AUTO-SKIP|BACKGROUND-COLOR|BACKGROUND-COLOUR|BASIS|BEEP|BEFORE|BEGINNING|BELL|BINARY|BIT|BLANK|BLINK|BLOCK|BOTTOM|BOUNDS|BY|BYFUNCTION|BYTITLE|CALL|CANCEL|CAPABLE|CCSVERSION|CD|CF|CH|CHAINING|CHANGED|CHANNEL|CHARACTER|CHARACTERS|CLASS|CLASS-ID|CLOCK-UNITS|CLOSE|CLOSE-DISPOSITION|COBOL|CODE|CODE-SET|COL|COLLATING|COLUMN|COM-REG|COMMA|COMMITMENT|COMMON|COMMUNICATION|COMP|COMP-1|COMP-2|COMP-3|COMP-4|COMP-5|COMPUTATIONAL|COMPUTATIONAL-1|COMPUTATIONAL-2|COMPUTATIONAL-3|COMPUTATIONAL-4|COMPUTATIONAL-5|COMPUTE|CONFIGURATION|CONTAINS|CONTENT|CONTINUE|CONTROL|CONTROL-POINT|CONTROLS|CONVENTION|CONVERTING|COPY|CORR|CORRESPONDING|COUNT|CRUNCH|CURRENCY|CURSOR|DATA|DATA-BASE|DATE|DATE-COMPILED|DATE-WRITTEN|DAY|DAY-OF-WEEK|DBCS|DE|DEBUG-CONTENTS|DEBUG-ITEM|DEBUG-LINE|DEBUG-NAME|DEBUG-SUB-1|DEBUG-SUB-2|DEBUG-SUB-3|DEBUGGING|DECIMAL-POINT|DECLARATIVES|DEFAULT|DEFAULT-DISPLAY|DEFINITION|DELETE|DELIMITED|DELIMITER|DEPENDING|DESCENDING|DESTINATION|DETAIL|DFHRESP|DFHVALUE|DISABLE|DISK|DISPLAY|DISPLAY-1|DIVIDE|DIVISION|DONTCARE|DOUBLE|DOWN|DUPLICATES|DYNAMIC|EBCDIC|EGCS|EGI|ELSE|EMI|EMPTY-CHECK|ENABLE|END|END-ACCEPT|END-ADD|END-CALL|END-COMPUTE|END-DELETE|END-DIVIDE|END-EVALUATE|END-IF|END-MULTIPLY|END-OF-PAGE|END-PERFORM|END-READ|END-RECEIVE|END-RETURN|END-REWRITE|END-SEARCH|END-START|END-STRING|END-SUBTRACT|END-UNSTRING|END-WRITE|ENDING|ENTER|ENTRY|ENTRY-PROCEDURE|ENVIRONMENT|EOL|EOP|EOS|ERASE|ERROR|ESCAPE|ESI|EVALUATE|EVENT|EVERY|EXCEPTION|EXCLUSIVE|EXHIBIT|EXIT|EXPORT|EXTEND|EXTENDED|EXTERNAL|FD|FILE|FILE-CONTROL|FILLER|FINAL|FIRST|FOOTING|FOR|FOREGROUND-COLOR|FOREGROUND-COLOUR|FROM|FULL|FUNCTION|FUNCTION-POINTER|FUNCTIONNAME|GENERATE|GIVING|GLOBAL|GO|GOBACK|GRID|GROUP|HEADING|HIGH-VALUE|HIGH-VALUES|HIGHLIGHT|I-O|I-O-CONTROL|ID|IDENTIFICATION|IF|IMPLICIT|IMPORT|IN|INDEX|INDEXED|INDICATE|INITIAL|INITIALIZE|INITIATE|INPUT|INPUT-OUTPUT|INSPECT|INSTALLATION|INTEGER|INTO|INVALID|INVOKE|IS|JUST|JUSTIFIED|KANJI|KEPT|KEY|KEYBOARD|LABEL|LANGUAGE|LAST|LB|LD|LEADING|LEFT|LEFTLINE|LENGTH|LENGTH-CHECK|LIBACCESS|LIBPARAMETER|LIBRARY|LIMIT|LIMITS|LINAGE|LINAGE-COUNTER|LINE|LINE-COUNTER|LINES|LINKAGE|LIST|LOCAL|LOCAL-STORAGE|LOCK|LONG-DATE|LONG-TIME|LOW-VALUE|LOW-VALUES|LOWER|LOWLIGHT|MEMORY|MERGE|MESSAGE|MMDDYYYY|MODE|MODULES|MORE-LABELS|MOVE|MULTIPLE|MULTIPLY|NAMED|NATIONAL|NATIONAL-EDITED|NATIVE|NEGATIVE|NETWORK|NEXT|NO|NO-ECHO|NULL|NULLS|NUMBER|NUMERIC|NUMERIC-DATE|NUMERIC-EDITED|NUMERIC-TIME|OBJECT-COMPUTER|OCCURS|ODT|OF|OFF|OMITTED|ON|OPEN|OPTIONAL|ORDER|ORDERLY|ORGANIZATION|OTHER|OUTPUT|OVERFLOW|OVERLINE|OWN|PACKED-DECIMAL|PADDING|PAGE|PAGE-COUNTER|PASSWORD|PERFORM|PF|PH|PIC|PICTURE|PLUS|POINTER|PORT|POSITION|POSITIVE|PRINTER|PRINTING|PRIVATE|PROCEDURE|PROCEDURE-POINTER|PROCEDURES|PROCEED|PROCESS|PROGRAM|PROGRAM-ID|PROGRAM-LIBRARY|PROMPT|PURGE|QUEUE|QUOTE|QUOTES|RANDOM|RD|READ|READER|REAL|RECEIVE|RECEIVED|RECORD|RECORDING|RECORDS|RECURSIVE|REDEFINES|REEL|REF|REFERENCE|REFERENCES|RELATIVE|RELEASE|REMAINDER|REMARKS|REMOTE|REMOVAL|REMOVE|RENAMES|REPLACE|REPLACING|REPORT|REPORTING|REPORTS|REQUIRED|RERUN|RESERVE|RESET|RETURN|RETURN-CODE|RETURNING|REVERSE-VIDEO|REVERSED|REWIND|REWRITE|RF|RH|RIGHT|ROUNDED|RUN|SAME|SAVE|SCREEN|SD|SEARCH|SECTION|SECURE|SECURITY|SEGMENT|SEGMENT-LIMIT|SELECT|SEND|SENTENCE|SEPARATE|SEQUENCE|SEQUENTIAL|SET|SHARED|SHAREDBYALL|SHAREDBYRUNUNIT|SHARING|SHIFT-IN|SHIFT-OUT|SHORT-DATE|SIGN|SIZE|SORT|SORT-CONTROL|SORT-CORE-SIZE|SORT-FILE-SIZE|SORT-MERGE|SORT-MESSAGE|SORT-MODE-SIZE|SORT-RETURN|SOURCE|SOURCE-COMPUTER|SPACE|SPACES|SPECIAL-NAMES|STANDARD|STANDARD-1|STANDARD-2|START|STATUS|STOP|STRING|SUB-QUEUE-1|SUB-QUEUE-2|SUB-QUEUE-3|SUBTRACT|SUM|SUPPRESS|SYMBOL|SYMBOLIC|SYNC|SYNCHRONIZED|TABLE|TALLY|TALLYING|TAPE|TASK|TERMINAL|TERMINATE|TEST|TEXT|THEN|THREAD|THREAD-LOCAL|THROUGH|THRU|TIME|TIMER|TIMES|TITLE|TO|TODAYS-DATE|TODAYS-NAME|TOP|TRAILING|TRUNCATED|TYPE|TYPEDEF|UNDERLINE|UNIT|UNSTRING|UNTIL|UP|UPON|USAGE|USE|USING|VALUE|VALUES|VARYING|VIRTUAL|WAIT|WHEN|WHEN-COMPILED|WITH|WORDS|WORKING-STORAGE|WRITE|YEAR|YYYYDDD|YYYYMMDD|ZERO-FILL|ZEROES|ZEROS)(?![\w-])/i,
|
||||
lookbehind: true
|
||||
},
|
||||
boolean: {
|
||||
pattern: /(^|[^\w-])(?:false|true)(?![\w-])/i,
|
||||
lookbehind: true
|
||||
},
|
||||
number: {
|
||||
pattern:
|
||||
/(^|[^\w-])(?:[+-]?(?:(?:\d+(?:[.,]\d+)?|[.,]\d+)(?:e[+-]?\d+)?|zero))(?![\w-])/i,
|
||||
lookbehind: true
|
||||
},
|
||||
operator: [
|
||||
/<>|[<>]=?|[=+*/&]/,
|
||||
{
|
||||
pattern: /(^|[^\w-])(?:-|and|equal|greater|less|not|or|than)(?![\w-])/i,
|
||||
lookbehind: true
|
||||
}
|
||||
],
|
||||
punctuation: /[.:,()]/
|
||||
}
|
||||
}
|
||||
+74
@@ -0,0 +1,74 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
concurnas.displayName = 'concurnas'
|
||||
concurnas.aliases = ['conc']
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function concurnas(Prism) {
|
||||
Prism.languages.concurnas = {
|
||||
comment: {
|
||||
pattern: /(^|[^\\])(?:\/\*[\s\S]*?(?:\*\/|$)|\/\/.*)/,
|
||||
lookbehind: true,
|
||||
greedy: true
|
||||
},
|
||||
langext: {
|
||||
pattern: /\b\w+\s*\|\|[\s\S]+?\|\|/,
|
||||
greedy: true,
|
||||
inside: {
|
||||
'class-name': /^\w+/,
|
||||
string: {
|
||||
pattern: /(^\s*\|\|)[\s\S]+(?=\|\|$)/,
|
||||
lookbehind: true
|
||||
},
|
||||
punctuation: /\|\|/
|
||||
}
|
||||
},
|
||||
function: {
|
||||
pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/,
|
||||
lookbehind: true
|
||||
},
|
||||
keyword:
|
||||
/\b(?:abstract|actor|also|annotation|assert|async|await|bool|boolean|break|byte|case|catch|changed|char|class|closed|constant|continue|def|default|del|double|elif|else|enum|every|extends|false|finally|float|for|from|global|gpudef|gpukernel|if|import|in|init|inject|int|lambda|local|long|loop|match|new|nodefault|null|of|onchange|open|out|override|package|parfor|parforsync|post|pre|private|protected|provide|provider|public|return|shared|short|single|size_t|sizeof|super|sync|this|throw|trait|trans|transient|true|try|typedef|unchecked|using|val|var|void|while|with)\b/,
|
||||
boolean: /\b(?:false|true)\b/,
|
||||
number:
|
||||
/\b0b[01][01_]*L?\b|\b0x(?:[\da-f_]*\.)?[\da-f_p+-]+\b|(?:\b\d[\d_]*(?:\.[\d_]*)?|\B\.\d[\d_]*)(?:e[+-]?\d[\d_]*)?[dfls]?/i,
|
||||
punctuation: /[{}[\];(),.:]/,
|
||||
operator:
|
||||
/<==|>==|=>|->|<-|<>|&==|&<>|\?:?|\.\?|\+\+|--|[-+*/=<>]=?|[!^~]|\b(?:and|as|band|bor|bxor|comp|is|isnot|mod|or)\b=?/,
|
||||
annotation: {
|
||||
pattern: /@(?:\w+:)?(?:\w+|\[[^\]]+\])?/,
|
||||
alias: 'builtin'
|
||||
}
|
||||
}
|
||||
Prism.languages.insertBefore('concurnas', 'langext', {
|
||||
'regex-literal': {
|
||||
pattern: /\br("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,
|
||||
greedy: true,
|
||||
inside: {
|
||||
interpolation: {
|
||||
pattern:
|
||||
/((?:^|[^\\])(?:\\{2})*)\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
|
||||
lookbehind: true,
|
||||
inside: Prism.languages.concurnas
|
||||
},
|
||||
regex: /[\s\S]+/
|
||||
}
|
||||
},
|
||||
'string-literal': {
|
||||
pattern: /(?:\B|\bs)("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,
|
||||
greedy: true,
|
||||
inside: {
|
||||
interpolation: {
|
||||
pattern:
|
||||
/((?:^|[^\\])(?:\\{2})*)\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
|
||||
lookbehind: true,
|
||||
inside: Prism.languages.concurnas
|
||||
},
|
||||
string: /[\s\S]+/
|
||||
}
|
||||
}
|
||||
})
|
||||
Prism.languages.conc = Prism.languages.concurnas
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/** @type {import('../core.js').Syntax} */
|
||||
declare function cpp(Prism: any): void;
|
||||
declare namespace cpp {
|
||||
let displayName: string;
|
||||
let aliases: any[];
|
||||
}
|
||||
export default cpp;
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/** @type {import('../core.js').Syntax} */
|
||||
declare function crystal(Prism: any): void;
|
||||
declare namespace crystal {
|
||||
let displayName: string;
|
||||
let aliases: any[];
|
||||
}
|
||||
export default crystal;
|
||||
+129
@@ -0,0 +1,129 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
import refractorCss from './css.js'
|
||||
cssExtras.displayName = 'css-extras'
|
||||
cssExtras.aliases = []
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function cssExtras(Prism) {
|
||||
Prism.register(refractorCss)
|
||||
;(function (Prism) {
|
||||
var string = /("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/
|
||||
var selectorInside
|
||||
Prism.languages.css.selector = {
|
||||
pattern: Prism.languages.css.selector.pattern,
|
||||
lookbehind: true,
|
||||
inside: (selectorInside = {
|
||||
'pseudo-element':
|
||||
/:(?:after|before|first-letter|first-line|selection)|::[-\w]+/,
|
||||
'pseudo-class': /:[-\w]+/,
|
||||
class: /\.[-\w]+/,
|
||||
id: /#[-\w]+/,
|
||||
attribute: {
|
||||
pattern: RegExp('\\[(?:[^[\\]"\']|' + string.source + ')*\\]'),
|
||||
greedy: true,
|
||||
inside: {
|
||||
punctuation: /^\[|\]$/,
|
||||
'case-sensitivity': {
|
||||
pattern: /(\s)[si]$/i,
|
||||
lookbehind: true,
|
||||
alias: 'keyword'
|
||||
},
|
||||
namespace: {
|
||||
pattern: /^(\s*)(?:(?!\s)[-*\w\xA0-\uFFFF])*\|(?!=)/,
|
||||
lookbehind: true,
|
||||
inside: {
|
||||
punctuation: /\|$/
|
||||
}
|
||||
},
|
||||
'attr-name': {
|
||||
pattern: /^(\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+/,
|
||||
lookbehind: true
|
||||
},
|
||||
'attr-value': [
|
||||
string,
|
||||
{
|
||||
pattern: /(=\s*)(?:(?!\s)[-\w\xA0-\uFFFF])+(?=\s*$)/,
|
||||
lookbehind: true
|
||||
}
|
||||
],
|
||||
operator: /[|~*^$]?=/
|
||||
}
|
||||
},
|
||||
'n-th': [
|
||||
{
|
||||
pattern: /(\(\s*)[+-]?\d*[\dn](?:\s*[+-]\s*\d+)?(?=\s*\))/,
|
||||
lookbehind: true,
|
||||
inside: {
|
||||
number: /[\dn]+/,
|
||||
operator: /[+-]/
|
||||
}
|
||||
},
|
||||
{
|
||||
pattern: /(\(\s*)(?:even|odd)(?=\s*\))/i,
|
||||
lookbehind: true
|
||||
}
|
||||
],
|
||||
combinator: />|\+|~|\|\|/,
|
||||
// the `tag` token has been existed and removed.
|
||||
// because we can't find a perfect tokenize to match it.
|
||||
// if you want to add it, please read https://github.com/PrismJS/prism/pull/2373 first.
|
||||
|
||||
punctuation: /[(),]/
|
||||
})
|
||||
}
|
||||
Prism.languages.css['atrule'].inside['selector-function-argument'].inside =
|
||||
selectorInside
|
||||
Prism.languages.insertBefore('css', 'property', {
|
||||
variable: {
|
||||
pattern:
|
||||
/(^|[^-\w\xA0-\uFFFF])--(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*/i,
|
||||
lookbehind: true
|
||||
}
|
||||
})
|
||||
var unit = {
|
||||
pattern: /(\b\d+)(?:%|[a-z]+(?![\w-]))/,
|
||||
lookbehind: true
|
||||
}
|
||||
// 123 -123 .123 -.123 12.3 -12.3
|
||||
var number = {
|
||||
pattern: /(^|[^\w.-])-?(?:\d+(?:\.\d+)?|\.\d+)/,
|
||||
lookbehind: true
|
||||
}
|
||||
Prism.languages.insertBefore('css', 'function', {
|
||||
operator: {
|
||||
pattern: /(\s)[+\-*\/](?=\s)/,
|
||||
lookbehind: true
|
||||
},
|
||||
// CAREFUL!
|
||||
// Previewers and Inline color use hexcode and color.
|
||||
hexcode: {
|
||||
pattern: /\B#[\da-f]{3,8}\b/i,
|
||||
alias: 'color'
|
||||
},
|
||||
color: [
|
||||
{
|
||||
pattern:
|
||||
/(^|[^\w-])(?:AliceBlue|AntiqueWhite|Aqua|Aquamarine|Azure|Beige|Bisque|Black|BlanchedAlmond|Blue|BlueViolet|Brown|BurlyWood|CadetBlue|Chartreuse|Chocolate|Coral|CornflowerBlue|Cornsilk|Crimson|Cyan|DarkBlue|DarkCyan|DarkGoldenRod|DarkGr[ae]y|DarkGreen|DarkKhaki|DarkMagenta|DarkOliveGreen|DarkOrange|DarkOrchid|DarkRed|DarkSalmon|DarkSeaGreen|DarkSlateBlue|DarkSlateGr[ae]y|DarkTurquoise|DarkViolet|DeepPink|DeepSkyBlue|DimGr[ae]y|DodgerBlue|FireBrick|FloralWhite|ForestGreen|Fuchsia|Gainsboro|GhostWhite|Gold|GoldenRod|Gr[ae]y|Green|GreenYellow|HoneyDew|HotPink|IndianRed|Indigo|Ivory|Khaki|Lavender|LavenderBlush|LawnGreen|LemonChiffon|LightBlue|LightCoral|LightCyan|LightGoldenRodYellow|LightGr[ae]y|LightGreen|LightPink|LightSalmon|LightSeaGreen|LightSkyBlue|LightSlateGr[ae]y|LightSteelBlue|LightYellow|Lime|LimeGreen|Linen|Magenta|Maroon|MediumAquaMarine|MediumBlue|MediumOrchid|MediumPurple|MediumSeaGreen|MediumSlateBlue|MediumSpringGreen|MediumTurquoise|MediumVioletRed|MidnightBlue|MintCream|MistyRose|Moccasin|NavajoWhite|Navy|OldLace|Olive|OliveDrab|Orange|OrangeRed|Orchid|PaleGoldenRod|PaleGreen|PaleTurquoise|PaleVioletRed|PapayaWhip|PeachPuff|Peru|Pink|Plum|PowderBlue|Purple|RebeccaPurple|Red|RosyBrown|RoyalBlue|SaddleBrown|Salmon|SandyBrown|SeaGreen|SeaShell|Sienna|Silver|SkyBlue|SlateBlue|SlateGr[ae]y|Snow|SpringGreen|SteelBlue|Tan|Teal|Thistle|Tomato|Transparent|Turquoise|Violet|Wheat|White|WhiteSmoke|Yellow|YellowGreen)(?![\w-])/i,
|
||||
lookbehind: true
|
||||
},
|
||||
{
|
||||
pattern:
|
||||
/\b(?:hsl|rgb)\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*\)\B|\b(?:hsl|rgb)a\(\s*\d{1,3}\s*,\s*\d{1,3}%?\s*,\s*\d{1,3}%?\s*,\s*(?:0|0?\.\d+|1)\s*\)\B/i,
|
||||
inside: {
|
||||
unit: unit,
|
||||
number: number,
|
||||
function: /[\w-]+(?=\()/,
|
||||
punctuation: /[(),]/
|
||||
}
|
||||
}
|
||||
],
|
||||
// it's important that there is no boundary assertion after the hex digits
|
||||
entity: /\\[\da-f]{1,8}/i,
|
||||
unit: unit,
|
||||
number: number
|
||||
})
|
||||
})(Prism)
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/** @type {import('../core.js').Syntax} */
|
||||
declare function css(Prism: any): void;
|
||||
declare namespace css {
|
||||
let displayName: string;
|
||||
let aliases: any[];
|
||||
}
|
||||
export default css;
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
csv.displayName = 'csv'
|
||||
csv.aliases = []
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function csv(Prism) {
|
||||
// https://tools.ietf.org/html/rfc4180
|
||||
|
||||
Prism.languages.csv = {
|
||||
value: /[^\r\n,"]+|"(?:[^"]|"")*"(?!")/,
|
||||
punctuation: /,/
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/** @type {import('../core.js').Syntax} */
|
||||
declare function cypher(Prism: any): void;
|
||||
declare namespace cypher {
|
||||
let displayName: string;
|
||||
let aliases: any[];
|
||||
}
|
||||
export default cypher;
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/** @type {import('../core.js').Syntax} */
|
||||
declare function d(Prism: any): void;
|
||||
declare namespace d {
|
||||
let displayName: string;
|
||||
let aliases: any[];
|
||||
}
|
||||
export default d;
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/** @type {import('../core.js').Syntax} */
|
||||
declare function dart(Prism: any): void;
|
||||
declare namespace dart {
|
||||
let displayName: string;
|
||||
let aliases: any[];
|
||||
}
|
||||
export default dart;
|
||||
+52
@@ -0,0 +1,52 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
dataweave.displayName = 'dataweave'
|
||||
dataweave.aliases = []
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function dataweave(Prism) {
|
||||
;(function (Prism) {
|
||||
Prism.languages.dataweave = {
|
||||
url: /\b[A-Za-z]+:\/\/[\w/:.?=&-]+|\burn:[\w:.?=&-]+/,
|
||||
property: {
|
||||
pattern: /(?:\b\w+#)?(?:"(?:\\.|[^\\"\r\n])*"|\b\w+)(?=\s*[:@])/,
|
||||
greedy: true
|
||||
},
|
||||
string: {
|
||||
pattern: /(["'`])(?:\\[\s\S]|(?!\1)[^\\])*\1/,
|
||||
greedy: true
|
||||
},
|
||||
'mime-type':
|
||||
/\b(?:application|audio|image|multipart|text|video)\/[\w+-]+/,
|
||||
date: {
|
||||
pattern: /\|[\w:+-]+\|/,
|
||||
greedy: true
|
||||
},
|
||||
comment: [
|
||||
{
|
||||
pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
|
||||
lookbehind: true,
|
||||
greedy: true
|
||||
},
|
||||
{
|
||||
pattern: /(^|[^\\:])\/\/.*/,
|
||||
lookbehind: true,
|
||||
greedy: true
|
||||
}
|
||||
],
|
||||
regex: {
|
||||
pattern: /\/(?:[^\\\/\r\n]|\\[^\r\n])+\//,
|
||||
greedy: true
|
||||
},
|
||||
keyword:
|
||||
/\b(?:and|as|at|case|do|else|fun|if|input|is|match|not|ns|null|or|output|type|unless|update|using|var)\b/,
|
||||
function: /\b[A-Z_]\w*(?=\s*\()/i,
|
||||
number: /-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,
|
||||
punctuation: /[{}[\];(),.:@]/,
|
||||
operator: /<<|>>|->|[<>~=]=?|!=|--?-?|\+\+?|!|\?/,
|
||||
boolean: /\b(?:false|true)\b/
|
||||
}
|
||||
})(Prism)
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/** @type {import('../core.js').Syntax} */
|
||||
declare function dax(Prism: any): void;
|
||||
declare namespace dax {
|
||||
let displayName: string;
|
||||
let aliases: any[];
|
||||
}
|
||||
export default dax;
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/** @type {import('../core.js').Syntax} */
|
||||
declare function dhall(Prism: any): void;
|
||||
declare namespace dhall {
|
||||
let displayName: string;
|
||||
let aliases: any[];
|
||||
}
|
||||
export default dhall;
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
dhall.displayName = 'dhall'
|
||||
dhall.aliases = []
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function dhall(Prism) {
|
||||
// ABNF grammar:
|
||||
// https://github.com/dhall-lang/dhall-lang/blob/master/standard/dhall.abnf
|
||||
|
||||
Prism.languages.dhall = {
|
||||
// Multi-line comments can be nested. E.g. {- foo {- bar -} -}
|
||||
// The multi-line pattern is essentially this:
|
||||
// \{-(?:[^-{]|-(?!\})|\{(?!-)|<SELF>)*-\}
|
||||
comment:
|
||||
/--.*|\{-(?:[^-{]|-(?!\})|\{(?!-)|\{-(?:[^-{]|-(?!\})|\{(?!-))*-\})*-\}/,
|
||||
string: {
|
||||
pattern: /"(?:[^"\\]|\\.)*"|''(?:[^']|'(?!')|'''|''\$\{)*''(?!'|\$)/,
|
||||
greedy: true,
|
||||
inside: {
|
||||
interpolation: {
|
||||
pattern: /\$\{[^{}]*\}/,
|
||||
inside: {
|
||||
expression: {
|
||||
pattern: /(^\$\{)[\s\S]+(?=\}$)/,
|
||||
lookbehind: true,
|
||||
alias: 'language-dhall',
|
||||
inside: null // see blow
|
||||
},
|
||||
punctuation: /\$\{|\}/
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
label: {
|
||||
pattern: /`[^`]*`/,
|
||||
greedy: true
|
||||
},
|
||||
url: {
|
||||
// https://github.com/dhall-lang/dhall-lang/blob/5fde8ef1bead6fb4e999d3c1ffe7044cd019d63a/standard/dhall.abnf#L596
|
||||
pattern:
|
||||
/\bhttps?:\/\/[\w.:%!$&'*+;=@~-]+(?:\/[\w.:%!$&'*+;=@~-]*)*(?:\?[/?\w.:%!$&'*+;=@~-]*)?/,
|
||||
greedy: true
|
||||
},
|
||||
env: {
|
||||
// https://github.com/dhall-lang/dhall-lang/blob/5fde8ef1bead6fb4e999d3c1ffe7044cd019d63a/standard/dhall.abnf#L661
|
||||
pattern: /\benv:(?:(?!\d)\w+|"(?:[^"\\=]|\\.)*")/,
|
||||
greedy: true,
|
||||
inside: {
|
||||
function: /^env/,
|
||||
operator: /^:/,
|
||||
variable: /[\s\S]+/
|
||||
}
|
||||
},
|
||||
hash: {
|
||||
// https://github.com/dhall-lang/dhall-lang/blob/5fde8ef1bead6fb4e999d3c1ffe7044cd019d63a/standard/dhall.abnf#L725
|
||||
pattern: /\bsha256:[\da-fA-F]{64}\b/,
|
||||
inside: {
|
||||
function: /sha256/,
|
||||
operator: /:/,
|
||||
number: /[\da-fA-F]{64}/
|
||||
}
|
||||
},
|
||||
// https://github.com/dhall-lang/dhall-lang/blob/5fde8ef1bead6fb4e999d3c1ffe7044cd019d63a/standard/dhall.abnf#L359
|
||||
keyword:
|
||||
/\b(?:as|assert|else|forall|if|in|let|merge|missing|then|toMap|using|with)\b|\u2200/,
|
||||
builtin: /\b(?:None|Some)\b/,
|
||||
boolean: /\b(?:False|True)\b/,
|
||||
number:
|
||||
/\bNaN\b|-?\bInfinity\b|[+-]?\b(?:0x[\da-fA-F]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)\b/,
|
||||
operator:
|
||||
/\/\\|\/\/\\\\|&&|\|\||===|[!=]=|\/\/|->|\+\+|::|[+*#@=:?<>|\\\u2227\u2a53\u2261\u2afd\u03bb\u2192]/,
|
||||
punctuation: /\.\.|[{}\[\](),./]/,
|
||||
// we'll just assume that every capital word left is a type name
|
||||
'class-name': /\b[A-Z]\w*\b/
|
||||
}
|
||||
Prism.languages.dhall.string.inside.interpolation.inside.expression.inside =
|
||||
Prism.languages.dhall
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/** @type {import('../core.js').Syntax} */
|
||||
declare function dnsZoneFile(Prism: any): void;
|
||||
declare namespace dnsZoneFile {
|
||||
let displayName: string;
|
||||
let aliases: string[];
|
||||
}
|
||||
export default dnsZoneFile;
|
||||
+93
@@ -0,0 +1,93 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
dot.displayName = 'dot'
|
||||
dot.aliases = ['gv']
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function dot(Prism) {
|
||||
// https://www.graphviz.org/doc/info/lang.html
|
||||
|
||||
;(function (Prism) {
|
||||
var ID =
|
||||
'(?:' +
|
||||
[
|
||||
// an identifier
|
||||
/[a-zA-Z_\x80-\uFFFF][\w\x80-\uFFFF]*/.source,
|
||||
// a number
|
||||
/-?(?:\.\d+|\d+(?:\.\d*)?)/.source,
|
||||
// a double-quoted string
|
||||
/"[^"\\]*(?:\\[\s\S][^"\\]*)*"/.source,
|
||||
// HTML-like string
|
||||
/<(?:[^<>]|(?!<!--)<(?:[^<>"']|"[^"]*"|'[^']*')+>|<!--(?:[^-]|-(?!->))*-->)*>/
|
||||
.source
|
||||
].join('|') +
|
||||
')'
|
||||
var IDInside = {
|
||||
markup: {
|
||||
pattern: /(^<)[\s\S]+(?=>$)/,
|
||||
lookbehind: true,
|
||||
alias: ['language-markup', 'language-html', 'language-xml'],
|
||||
inside: Prism.languages.markup
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param {string} source
|
||||
* @param {string} flags
|
||||
* @returns {RegExp}
|
||||
*/
|
||||
function withID(source, flags) {
|
||||
return RegExp(
|
||||
source.replace(/<ID>/g, function () {
|
||||
return ID
|
||||
}),
|
||||
flags
|
||||
)
|
||||
}
|
||||
Prism.languages.dot = {
|
||||
comment: {
|
||||
pattern: /\/\/.*|\/\*[\s\S]*?\*\/|^#.*/m,
|
||||
greedy: true
|
||||
},
|
||||
'graph-name': {
|
||||
pattern: withID(
|
||||
/(\b(?:digraph|graph|subgraph)[ \t\r\n]+)<ID>/.source,
|
||||
'i'
|
||||
),
|
||||
lookbehind: true,
|
||||
greedy: true,
|
||||
alias: 'class-name',
|
||||
inside: IDInside
|
||||
},
|
||||
'attr-value': {
|
||||
pattern: withID(/(=[ \t\r\n]*)<ID>/.source),
|
||||
lookbehind: true,
|
||||
greedy: true,
|
||||
inside: IDInside
|
||||
},
|
||||
'attr-name': {
|
||||
pattern: withID(/([\[;, \t\r\n])<ID>(?=[ \t\r\n]*=)/.source),
|
||||
lookbehind: true,
|
||||
greedy: true,
|
||||
inside: IDInside
|
||||
},
|
||||
keyword: /\b(?:digraph|edge|graph|node|strict|subgraph)\b/i,
|
||||
'compass-point': {
|
||||
pattern: /(:[ \t\r\n]*)(?:[ewc_]|[ns][ew]?)(?![\w\x80-\uFFFF])/,
|
||||
lookbehind: true,
|
||||
alias: 'builtin'
|
||||
},
|
||||
node: {
|
||||
pattern: withID(/(^|[^-.\w\x80-\uFFFF\\])<ID>/.source),
|
||||
lookbehind: true,
|
||||
greedy: true,
|
||||
inside: IDInside
|
||||
},
|
||||
operator: /[=:]|-[->]/,
|
||||
punctuation: /[\[\]{};,]/
|
||||
}
|
||||
Prism.languages.gv = Prism.languages.dot
|
||||
})(Prism)
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/** @type {import('../core.js').Syntax} */
|
||||
declare function editorconfig(Prism: any): void;
|
||||
declare namespace editorconfig {
|
||||
let displayName: string;
|
||||
let aliases: any[];
|
||||
}
|
||||
export default editorconfig;
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
editorconfig.displayName = 'editorconfig'
|
||||
editorconfig.aliases = []
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function editorconfig(Prism) {
|
||||
Prism.languages.editorconfig = {
|
||||
// https://editorconfig-specification.readthedocs.io
|
||||
comment: /[;#].*/,
|
||||
section: {
|
||||
pattern: /(^[ \t]*)\[.+\]/m,
|
||||
lookbehind: true,
|
||||
alias: 'selector',
|
||||
inside: {
|
||||
regex: /\\\\[\[\]{},!?.*]/,
|
||||
// Escape special characters with '\\'
|
||||
operator: /[!?]|\.\.|\*{1,2}/,
|
||||
punctuation: /[\[\]{},]/
|
||||
}
|
||||
},
|
||||
key: {
|
||||
pattern: /(^[ \t]*)[^\s=]+(?=[ \t]*=)/m,
|
||||
lookbehind: true,
|
||||
alias: 'attr-name'
|
||||
},
|
||||
value: {
|
||||
pattern: /=.*/,
|
||||
alias: 'attr-value',
|
||||
inside: {
|
||||
punctuation: /^=/
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/** @type {import('../core.js').Syntax} */
|
||||
declare function elixir(Prism: any): void;
|
||||
declare namespace elixir {
|
||||
let displayName: string;
|
||||
let aliases: any[];
|
||||
}
|
||||
export default elixir;
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/** @type {import('../core.js').Syntax} */
|
||||
declare function erb(Prism: any): void;
|
||||
declare namespace erb {
|
||||
let displayName: string;
|
||||
let aliases: any[];
|
||||
}
|
||||
export default erb;
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
import refractorLua from './lua.js'
|
||||
import refractorMarkupTemplating from './markup-templating.js'
|
||||
etlua.displayName = 'etlua'
|
||||
etlua.aliases = []
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function etlua(Prism) {
|
||||
Prism.register(refractorLua)
|
||||
Prism.register(refractorMarkupTemplating)
|
||||
;(function (Prism) {
|
||||
Prism.languages.etlua = {
|
||||
delimiter: {
|
||||
pattern: /^<%[-=]?|-?%>$/,
|
||||
alias: 'punctuation'
|
||||
},
|
||||
'language-lua': {
|
||||
pattern: /[\s\S]+/,
|
||||
inside: Prism.languages.lua
|
||||
}
|
||||
}
|
||||
Prism.hooks.add('before-tokenize', function (env) {
|
||||
var pattern = /<%[\s\S]+?%>/g
|
||||
Prism.languages['markup-templating'].buildPlaceholders(
|
||||
env,
|
||||
'etlua',
|
||||
pattern
|
||||
)
|
||||
})
|
||||
Prism.hooks.add('after-tokenize', function (env) {
|
||||
Prism.languages['markup-templating'].tokenizePlaceholders(env, 'etlua')
|
||||
})
|
||||
})(Prism)
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/** @type {import('../core.js').Syntax} */
|
||||
declare function excelFormula(Prism: any): void;
|
||||
declare namespace excelFormula {
|
||||
let displayName: string;
|
||||
let aliases: string[];
|
||||
}
|
||||
export default excelFormula;
|
||||
+42
@@ -0,0 +1,42 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
$false.displayName = 'false'
|
||||
$false.aliases = []
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function $false(Prism) {
|
||||
;(function (Prism) {
|
||||
/**
|
||||
* Based on the manual by Wouter van Oortmerssen.
|
||||
*
|
||||
* @see {@link https://github.com/PrismJS/prism/issues/2801#issue-829717504}
|
||||
*/
|
||||
Prism.languages['false'] = {
|
||||
comment: {
|
||||
pattern: /\{[^}]*\}/
|
||||
},
|
||||
string: {
|
||||
pattern: /"[^"]*"/,
|
||||
greedy: true
|
||||
},
|
||||
'character-code': {
|
||||
pattern: /'(?:[^\r]|\r\n?)/,
|
||||
alias: 'number'
|
||||
},
|
||||
'assembler-code': {
|
||||
pattern: /\d+`/,
|
||||
alias: 'important'
|
||||
},
|
||||
number: /\d+/,
|
||||
operator: /[-!#$%&'*+,./:;=>?@\\^_`|~ßø]/,
|
||||
punctuation: /\[|\]/,
|
||||
variable: /[a-z]/,
|
||||
'non-standard': {
|
||||
pattern: /[()<BDO®]/,
|
||||
alias: 'bold'
|
||||
}
|
||||
}
|
||||
})(Prism)
|
||||
}
|
||||
+50
@@ -0,0 +1,50 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
import refractorClike from './clike.js'
|
||||
firestoreSecurityRules.displayName = 'firestore-security-rules'
|
||||
firestoreSecurityRules.aliases = []
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function firestoreSecurityRules(Prism) {
|
||||
Prism.register(refractorClike)
|
||||
Prism.languages['firestore-security-rules'] = Prism.languages.extend(
|
||||
'clike',
|
||||
{
|
||||
comment: /\/\/.*/,
|
||||
keyword:
|
||||
/\b(?:allow|function|if|match|null|return|rules_version|service)\b/,
|
||||
operator: /&&|\|\||[<>!=]=?|[-+*/%]|\b(?:in|is)\b/
|
||||
}
|
||||
)
|
||||
delete Prism.languages['firestore-security-rules']['class-name']
|
||||
Prism.languages.insertBefore('firestore-security-rules', 'keyword', {
|
||||
path: {
|
||||
pattern:
|
||||
/(^|[\s(),])(?:\/(?:[\w\xA0-\uFFFF]+|\{[\w\xA0-\uFFFF]+(?:=\*\*)?\}|\$\([\w\xA0-\uFFFF.]+\)))+/,
|
||||
lookbehind: true,
|
||||
greedy: true,
|
||||
inside: {
|
||||
variable: {
|
||||
pattern: /\{[\w\xA0-\uFFFF]+(?:=\*\*)?\}|\$\([\w\xA0-\uFFFF.]+\)/,
|
||||
inside: {
|
||||
operator: /=/,
|
||||
keyword: /\*\*/,
|
||||
punctuation: /[.$(){}]/
|
||||
}
|
||||
},
|
||||
punctuation: /\//
|
||||
}
|
||||
},
|
||||
method: {
|
||||
// to make the pattern shorter, the actual method names are omitted
|
||||
pattern: /(\ballow\s+)[a-z]+(?:\s*,\s*[a-z]+)*(?=\s*[:;])/,
|
||||
lookbehind: true,
|
||||
alias: 'builtin',
|
||||
inside: {
|
||||
punctuation: /,/
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/** @type {import('../core.js').Syntax} */
|
||||
declare function flow(Prism: any): void;
|
||||
declare namespace flow {
|
||||
let displayName: string;
|
||||
let aliases: any[];
|
||||
}
|
||||
export default flow;
|
||||
+47
@@ -0,0 +1,47 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
import refractorJavascript from './javascript.js'
|
||||
flow.displayName = 'flow'
|
||||
flow.aliases = []
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function flow(Prism) {
|
||||
Prism.register(refractorJavascript)
|
||||
;(function (Prism) {
|
||||
Prism.languages.flow = Prism.languages.extend('javascript', {})
|
||||
Prism.languages.insertBefore('flow', 'keyword', {
|
||||
type: [
|
||||
{
|
||||
pattern:
|
||||
/\b(?:[Bb]oolean|Function|[Nn]umber|[Ss]tring|[Ss]ymbol|any|mixed|null|void)\b/,
|
||||
alias: 'class-name'
|
||||
}
|
||||
]
|
||||
})
|
||||
Prism.languages.flow['function-variable'].pattern =
|
||||
/(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=\s*(?:function\b|(?:\([^()]*\)(?:\s*:\s*\w+)?|(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/i
|
||||
delete Prism.languages.flow['parameter']
|
||||
Prism.languages.insertBefore('flow', 'operator', {
|
||||
'flow-punctuation': {
|
||||
pattern: /\{\||\|\}/,
|
||||
alias: 'punctuation'
|
||||
}
|
||||
})
|
||||
if (!Array.isArray(Prism.languages.flow.keyword)) {
|
||||
Prism.languages.flow.keyword = [Prism.languages.flow.keyword]
|
||||
}
|
||||
Prism.languages.flow.keyword.unshift(
|
||||
{
|
||||
pattern: /(^|[^$]\b)(?:Class|declare|opaque|type)\b(?!\$)/,
|
||||
lookbehind: true
|
||||
},
|
||||
{
|
||||
pattern:
|
||||
/(^|[^$]\B)\$(?:Diff|Enum|Exact|Keys|ObjMap|PropertyType|Record|Shape|Subtype|Supertype|await)\b(?!\$)/,
|
||||
lookbehind: true
|
||||
}
|
||||
)
|
||||
})(Prism)
|
||||
}
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
fortran.displayName = 'fortran'
|
||||
fortran.aliases = []
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function fortran(Prism) {
|
||||
Prism.languages.fortran = {
|
||||
'quoted-number': {
|
||||
pattern: /[BOZ](['"])[A-F0-9]+\1/i,
|
||||
alias: 'number'
|
||||
},
|
||||
string: {
|
||||
pattern:
|
||||
/(?:\b\w+_)?(['"])(?:\1\1|&(?:\r\n?|\n)(?:[ \t]*!.*(?:\r\n?|\n)|(?![ \t]*!))|(?!\1).)*(?:\1|&)/,
|
||||
inside: {
|
||||
comment: {
|
||||
pattern: /(&(?:\r\n?|\n)\s*)!.*/,
|
||||
lookbehind: true
|
||||
}
|
||||
}
|
||||
},
|
||||
comment: {
|
||||
pattern: /!.*/,
|
||||
greedy: true
|
||||
},
|
||||
boolean: /\.(?:FALSE|TRUE)\.(?:_\w+)?/i,
|
||||
number: /(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[ED][+-]?\d+)?(?:_\w+)?/i,
|
||||
keyword: [
|
||||
// Types
|
||||
/\b(?:CHARACTER|COMPLEX|DOUBLE ?PRECISION|INTEGER|LOGICAL|REAL)\b/i,
|
||||
// END statements
|
||||
/\b(?:END ?)?(?:BLOCK ?DATA|DO|FILE|FORALL|FUNCTION|IF|INTERFACE|MODULE(?! PROCEDURE)|PROGRAM|SELECT|SUBROUTINE|TYPE|WHERE)\b/i,
|
||||
// Statements
|
||||
/\b(?:ALLOCATABLE|ALLOCATE|BACKSPACE|CALL|CASE|CLOSE|COMMON|CONTAINS|CONTINUE|CYCLE|DATA|DEALLOCATE|DIMENSION|DO|END|EQUIVALENCE|EXIT|EXTERNAL|FORMAT|GO ?TO|IMPLICIT(?: NONE)?|INQUIRE|INTENT|INTRINSIC|MODULE PROCEDURE|NAMELIST|NULLIFY|OPEN|OPTIONAL|PARAMETER|POINTER|PRINT|PRIVATE|PUBLIC|READ|RETURN|REWIND|SAVE|SELECT|STOP|TARGET|WHILE|WRITE)\b/i,
|
||||
// Others
|
||||
/\b(?:ASSIGNMENT|DEFAULT|ELEMENTAL|ELSE|ELSEIF|ELSEWHERE|ENTRY|IN|INCLUDE|INOUT|KIND|NULL|ONLY|OPERATOR|OUT|PURE|RECURSIVE|RESULT|SEQUENCE|STAT|THEN|USE)\b/i
|
||||
],
|
||||
operator: [
|
||||
/\*\*|\/\/|=>|[=\/]=|[<>]=?|::|[+\-*=%]|\.[A-Z]+\./i,
|
||||
{
|
||||
// Use lookbehind to prevent confusion with (/ /)
|
||||
pattern: /(^|(?!\().)\/(?!\))/,
|
||||
lookbehind: true
|
||||
}
|
||||
],
|
||||
punctuation: /\(\/|\/\)|[(),;:&]/
|
||||
}
|
||||
}
|
||||
+134
@@ -0,0 +1,134 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
import refractorMarkupTemplating from './markup-templating.js'
|
||||
ftl.displayName = 'ftl'
|
||||
ftl.aliases = []
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function ftl(Prism) {
|
||||
Prism.register(refractorMarkupTemplating)
|
||||
;(function (Prism) {
|
||||
// https://freemarker.apache.org/docs/dgui_template_exp.html
|
||||
|
||||
// FTL expression with 4 levels of nesting supported
|
||||
var FTL_EXPR =
|
||||
/[^<()"']|\((?:<expr>)*\)|<(?!#--)|<#--(?:[^-]|-(?!->))*-->|"(?:[^\\"]|\\.)*"|'(?:[^\\']|\\.)*'/
|
||||
.source
|
||||
for (var i = 0; i < 2; i++) {
|
||||
FTL_EXPR = FTL_EXPR.replace(/<expr>/g, function () {
|
||||
return FTL_EXPR
|
||||
})
|
||||
}
|
||||
FTL_EXPR = FTL_EXPR.replace(/<expr>/g, /[^\s\S]/.source)
|
||||
var ftl = {
|
||||
comment: /<#--[\s\S]*?-->/,
|
||||
string: [
|
||||
{
|
||||
// raw string
|
||||
pattern: /\br("|')(?:(?!\1)[^\\]|\\.)*\1/,
|
||||
greedy: true
|
||||
},
|
||||
{
|
||||
pattern: RegExp(
|
||||
/("|')(?:(?!\1|\$\{)[^\\]|\\.|\$\{(?:(?!\})(?:<expr>))*\})*\1/.source.replace(
|
||||
/<expr>/g,
|
||||
function () {
|
||||
return FTL_EXPR
|
||||
}
|
||||
)
|
||||
),
|
||||
greedy: true,
|
||||
inside: {
|
||||
interpolation: {
|
||||
pattern: RegExp(
|
||||
/((?:^|[^\\])(?:\\\\)*)\$\{(?:(?!\})(?:<expr>))*\}/.source.replace(
|
||||
/<expr>/g,
|
||||
function () {
|
||||
return FTL_EXPR
|
||||
}
|
||||
)
|
||||
),
|
||||
lookbehind: true,
|
||||
inside: {
|
||||
'interpolation-punctuation': {
|
||||
pattern: /^\$\{|\}$/,
|
||||
alias: 'punctuation'
|
||||
},
|
||||
rest: null
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
keyword: /\b(?:as)\b/,
|
||||
boolean: /\b(?:false|true)\b/,
|
||||
'builtin-function': {
|
||||
pattern: /((?:^|[^?])\?\s*)\w+/,
|
||||
lookbehind: true,
|
||||
alias: 'function'
|
||||
},
|
||||
function: /\b\w+(?=\s*\()/,
|
||||
number: /\b\d+(?:\.\d+)?\b/,
|
||||
operator:
|
||||
/\.\.[<*!]?|->|--|\+\+|&&|\|\||\?{1,2}|[-+*/%!=<>]=?|\b(?:gt|gte|lt|lte)\b/,
|
||||
punctuation: /[,;.:()[\]{}]/
|
||||
}
|
||||
ftl.string[1].inside.interpolation.inside.rest = ftl
|
||||
Prism.languages.ftl = {
|
||||
'ftl-comment': {
|
||||
// the pattern is shortened to be more efficient
|
||||
pattern: /^<#--[\s\S]*/,
|
||||
alias: 'comment'
|
||||
},
|
||||
'ftl-directive': {
|
||||
pattern: /^<[\s\S]+>$/,
|
||||
inside: {
|
||||
directive: {
|
||||
pattern: /(^<\/?)[#@][a-z]\w*/i,
|
||||
lookbehind: true,
|
||||
alias: 'keyword'
|
||||
},
|
||||
punctuation: /^<\/?|\/?>$/,
|
||||
content: {
|
||||
pattern: /\s*\S[\s\S]*/,
|
||||
alias: 'ftl',
|
||||
inside: ftl
|
||||
}
|
||||
}
|
||||
},
|
||||
'ftl-interpolation': {
|
||||
pattern: /^\$\{[\s\S]*\}$/,
|
||||
inside: {
|
||||
punctuation: /^\$\{|\}$/,
|
||||
content: {
|
||||
pattern: /\s*\S[\s\S]*/,
|
||||
alias: 'ftl',
|
||||
inside: ftl
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Prism.hooks.add('before-tokenize', function (env) {
|
||||
// eslint-disable-next-line regexp/no-useless-lazy
|
||||
var pattern = RegExp(
|
||||
/<#--[\s\S]*?-->|<\/?[#@][a-zA-Z](?:<expr>)*?>|\$\{(?:<expr>)*?\}/.source.replace(
|
||||
/<expr>/g,
|
||||
function () {
|
||||
return FTL_EXPR
|
||||
}
|
||||
),
|
||||
'gi'
|
||||
)
|
||||
Prism.languages['markup-templating'].buildPlaceholders(
|
||||
env,
|
||||
'ftl',
|
||||
pattern
|
||||
)
|
||||
})
|
||||
Prism.hooks.add('after-tokenize', function (env) {
|
||||
Prism.languages['markup-templating'].tokenizePlaceholders(env, 'ftl')
|
||||
})
|
||||
})(Prism)
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/** @type {import('../core.js').Syntax} */
|
||||
declare function gap(Prism: any): void;
|
||||
declare namespace gap {
|
||||
let displayName: string;
|
||||
let aliases: any[];
|
||||
}
|
||||
export default gap;
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
gap.displayName = 'gap'
|
||||
gap.aliases = []
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function gap(Prism) {
|
||||
// https://www.gap-system.org/Manuals/doc/ref/chap4.html
|
||||
// https://www.gap-system.org/Manuals/doc/ref/chap27.html
|
||||
|
||||
Prism.languages.gap = {
|
||||
shell: {
|
||||
pattern: /^gap>[\s\S]*?(?=^gap>|$(?![\s\S]))/m,
|
||||
greedy: true,
|
||||
inside: {
|
||||
gap: {
|
||||
pattern: /^(gap>).+(?:(?:\r(?:\n|(?!\n))|\n)>.*)*/,
|
||||
lookbehind: true,
|
||||
inside: null // see below
|
||||
},
|
||||
punctuation: /^gap>/
|
||||
}
|
||||
},
|
||||
comment: {
|
||||
pattern: /#.*/,
|
||||
greedy: true
|
||||
},
|
||||
string: {
|
||||
pattern:
|
||||
/(^|[^\\'"])(?:'(?:[^\r\n\\']|\\.){1,10}'|"(?:[^\r\n\\"]|\\.)*"(?!")|"""[\s\S]*?""")/,
|
||||
lookbehind: true,
|
||||
greedy: true,
|
||||
inside: {
|
||||
continuation: {
|
||||
pattern: /([\r\n])>/,
|
||||
lookbehind: true,
|
||||
alias: 'punctuation'
|
||||
}
|
||||
}
|
||||
},
|
||||
keyword:
|
||||
/\b(?:Assert|Info|IsBound|QUIT|TryNextMethod|Unbind|and|atomic|break|continue|do|elif|else|end|fi|for|function|if|in|local|mod|not|od|or|quit|readonly|readwrite|rec|repeat|return|then|until|while)\b/,
|
||||
boolean: /\b(?:false|true)\b/,
|
||||
function: /\b[a-z_]\w*(?=\s*\()/i,
|
||||
number: {
|
||||
pattern:
|
||||
/(^|[^\w.]|\.\.)(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?(?:_[a-z]?)?(?=$|[^\w.]|\.\.)/,
|
||||
lookbehind: true
|
||||
},
|
||||
continuation: {
|
||||
pattern: /([\r\n])>/,
|
||||
lookbehind: true,
|
||||
alias: 'punctuation'
|
||||
},
|
||||
operator: /->|[-+*/^~=!]|<>|[<>]=?|:=|\.\./,
|
||||
punctuation: /[()[\]{},;.:]/
|
||||
}
|
||||
Prism.languages.gap.shell.inside.gap.inside = Prism.languages.gap
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/** @type {import('../core.js').Syntax} */
|
||||
declare function gcode(Prism: any): void;
|
||||
declare namespace gcode {
|
||||
let displayName: string;
|
||||
let aliases: any[];
|
||||
}
|
||||
export default gcode;
|
||||
+95
@@ -0,0 +1,95 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
gherkin.displayName = 'gherkin'
|
||||
gherkin.aliases = []
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function gherkin(Prism) {
|
||||
;(function (Prism) {
|
||||
var tableRow = /(?:\r?\n|\r)[ \t]*\|.+\|(?:(?!\|).)*/.source
|
||||
Prism.languages.gherkin = {
|
||||
pystring: {
|
||||
pattern: /("""|''')[\s\S]+?\1/,
|
||||
alias: 'string'
|
||||
},
|
||||
comment: {
|
||||
pattern: /(^[ \t]*)#.*/m,
|
||||
lookbehind: true
|
||||
},
|
||||
tag: {
|
||||
pattern: /(^[ \t]*)@\S*/m,
|
||||
lookbehind: true
|
||||
},
|
||||
feature: {
|
||||
pattern:
|
||||
/((?:^|\r?\n|\r)[ \t]*)(?:Ability|Ahoy matey!|Arwedd|Aspekt|Besigheid Behoefte|Business Need|Caracteristica|Característica|Egenskab|Egenskap|Eiginleiki|Feature|Fīča|Fitur|Fonctionnalité|Fonksyonalite|Funcionalidade|Funcionalitat|Functionalitate|Funcţionalitate|Funcționalitate|Functionaliteit|Fungsi|Funkcia|Funkcija|Funkcionalitāte|Funkcionalnost|Funkcja|Funksie|Funktionalität|Funktionalitéit|Funzionalità|Hwaet|Hwæt|Jellemző|Karakteristik|Lastnost|Mak|Mogucnost|laH|Mogućnost|Moznosti|Možnosti|OH HAI|Omadus|Ominaisuus|Osobina|Özellik|Potrzeba biznesowa|perbogh|poQbogh malja'|Požadavek|Požiadavka|Pretty much|Qap|Qu'meH 'ut|Savybė|Tính năng|Trajto|Vermoë|Vlastnosť|Właściwość|Značilnost|Δυνατότητα|Λειτουργία|Могућност|Мөмкинлек|Особина|Свойство|Үзенчәлеклелек|Функционал|Функционалност|Функция|Функціонал|תכונה|خاصية|خصوصیت|صلاحیت|کاروبار کی ضرورت|وِیژگی|रूप लेख|ਖਾਸੀਅਤ|ਨਕਸ਼ ਨੁਹਾਰ|ਮੁਹਾਂਦਰਾ|గుణము|ಹೆಚ್ಚಳ|ความต้องการทางธุรกิจ|ความสามารถ|โครงหลัก|기능|フィーチャ|功能|機能):(?:[^:\r\n]+(?:\r?\n|\r|$))*/,
|
||||
lookbehind: true,
|
||||
inside: {
|
||||
important: {
|
||||
pattern: /(:)[^\r\n]+/,
|
||||
lookbehind: true
|
||||
},
|
||||
keyword: /[^:\r\n]+:/
|
||||
}
|
||||
},
|
||||
scenario: {
|
||||
pattern:
|
||||
/(^[ \t]*)(?:Abstract Scenario|Abstrakt Scenario|Achtergrond|Aer|Ær|Agtergrond|All y'all|Antecedentes|Antecedents|Atburðarás|Atburðarásir|Awww, look mate|B4|Background|Baggrund|Bakgrund|Bakgrunn|Bakgrunnur|Beispiele|Beispiller|Bối cảnh|Cefndir|Cenario|Cenário|Cenario de Fundo|Cenário de Fundo|Cenarios|Cenários|Contesto|Context|Contexte|Contexto|Conto|Contoh|Contone|Dæmi|Dasar|Dead men tell no tales|Delineacao do Cenario|Delineação do Cenário|Dis is what went down|Dữ liệu|Dyagram Senaryo|Dyagram senaryo|Egzanp|Ejemplos|Eksempler|Ekzemploj|Enghreifftiau|Esbozo do escenario|Escenari|Escenario|Esempi|Esquema de l'escenari|Esquema del escenario|Esquema do Cenario|Esquema do Cenário|EXAMPLZ|Examples|Exempel|Exemple|Exemples|Exemplos|First off|Fono|Forgatókönyv|Forgatókönyv vázlat|Fundo|Geçmiş|Grundlage|Hannergrond|ghantoH|Háttér|Heave to|Istorik|Juhtumid|Keadaan|Khung kịch bản|Khung tình huống|Kịch bản|Koncept|Konsep skenario|Kontèks|Kontekst|Kontekstas|Konteksts|Kontext|Konturo de la scenaro|Latar Belakang|lut chovnatlh|lut|lutmey|Lýsing Atburðarásar|Lýsing Dæma|MISHUN SRSLY|MISHUN|Menggariskan Senario|mo'|Náčrt Scenára|Náčrt Scénáře|Náčrt Scenáru|Oris scenarija|Örnekler|Osnova|Osnova Scenára|Osnova scénáře|Osnutek|Ozadje|Paraugs|Pavyzdžiai|Példák|Piemēri|Plan du scénario|Plan du Scénario|Plan Senaryo|Plan senaryo|Plang vum Szenario|Pozadí|Pozadie|Pozadina|Príklady|Příklady|Primer|Primeri|Primjeri|Przykłady|Raamstsenaarium|Reckon it's like|Rerefons|Scenár|Scénář|Scenarie|Scenarij|Scenarijai|Scenarijaus šablonas|Scenariji|Scenārijs|Scenārijs pēc parauga|Scenarijus|Scenario|Scénario|Scenario Amlinellol|Scenario Outline|Scenario Template|Scenariomal|Scenariomall|Scenarios|Scenariu|Scenariusz|Scenaro|Schema dello scenario|Se ðe|Se the|Se þe|Senario|Senaryo Deskripsyon|Senaryo deskripsyon|Senaryo|Senaryo taslağı|Shiver me timbers|Situācija|Situai|Situasie Uiteensetting|Situasie|Skenario konsep|Skenario|Skica|Structura scenariu|Structură scenariu|Struktura scenarija|Stsenaarium|Swa hwaer swa|Swa|Swa hwær swa|Szablon scenariusza|Szenario|Szenariogrundriss|Tapaukset|Tapaus|Tapausaihio|Taust|Tausta|Template Keadaan|Template Senario|Template Situai|The thing of it is|Tình huống|Variantai|Voorbeelde|Voorbeelden|Wharrimean is|Yo-ho-ho|You'll wanna|Założenia|Παραδείγματα|Περιγραφή Σεναρίου|Σενάρια|Σενάριο|Υπόβαθρο|Кереш|Контекст|Концепт|Мисаллар|Мисоллар|Основа|Передумова|Позадина|Предистория|Предыстория|Приклади|Пример|Примери|Примеры|Рамка на сценарий|Скица|Структура сценарија|Структура сценария|Структура сценарію|Сценарий|Сценарий структураси|Сценарийның төзелеше|Сценарији|Сценарио|Сценарій|Тарих|Үрнәкләр|דוגמאות|רקע|תבנית תרחיש|תרחיש|الخلفية|الگوی سناریو|امثلة|پس منظر|زمینه|سناریو|سيناريو|سيناريو مخطط|مثالیں|منظر نامے کا خاکہ|منظرنامہ|نمونه ها|उदाहरण|परिदृश्य|परिदृश्य रूपरेखा|पृष्ठभूमि|ਉਦਾਹਰਨਾਂ|ਪਟਕਥਾ|ਪਟਕਥਾ ਢਾਂਚਾ|ਪਟਕਥਾ ਰੂਪ ਰੇਖਾ|ਪਿਛੋਕੜ|ఉదాహరణలు|కథనం|నేపథ్యం|సన్నివేశం|ಉದಾಹರಣೆಗಳು|ಕಥಾಸಾರಾಂಶ|ವಿವರಣೆ|ಹಿನ್ನೆಲೆ|โครงสร้างของเหตุการณ์|ชุดของตัวอย่าง|ชุดของเหตุการณ์|แนวคิด|สรุปเหตุการณ์|เหตุการณ์|배경|시나리오|시나리오 개요|예|サンプル|シナリオ|シナリオアウトライン|シナリオテンプレ|シナリオテンプレート|テンプレ|例|例子|剧本|剧本大纲|劇本|劇本大綱|场景|场景大纲|場景|場景大綱|背景):[^:\r\n]*/m,
|
||||
lookbehind: true,
|
||||
inside: {
|
||||
important: {
|
||||
pattern: /(:)[^\r\n]*/,
|
||||
lookbehind: true
|
||||
},
|
||||
keyword: /[^:\r\n]+:/
|
||||
}
|
||||
},
|
||||
'table-body': {
|
||||
// Look-behind is used to skip the table head, which has the same format as any table row
|
||||
pattern: RegExp('(' + tableRow + ')(?:' + tableRow + ')+'),
|
||||
lookbehind: true,
|
||||
inside: {
|
||||
outline: {
|
||||
pattern: /<[^>]+>/,
|
||||
alias: 'variable'
|
||||
},
|
||||
td: {
|
||||
pattern: /\s*[^\s|][^|]*/,
|
||||
alias: 'string'
|
||||
},
|
||||
punctuation: /\|/
|
||||
}
|
||||
},
|
||||
'table-head': {
|
||||
pattern: RegExp(tableRow),
|
||||
inside: {
|
||||
th: {
|
||||
pattern: /\s*[^\s|][^|]*/,
|
||||
alias: 'variable'
|
||||
},
|
||||
punctuation: /\|/
|
||||
}
|
||||
},
|
||||
atrule: {
|
||||
pattern:
|
||||
/(^[ \t]+)(?:'a|'ach|'ej|7|a|A také|A taktiež|A tiež|A zároveň|Aber|Ac|Adott|Akkor|Ak|Aleshores|Ale|Ali|Allora|Alors|Als|Ama|Amennyiben|Amikor|Ampak|an|AN|Ananging|And y'all|And|Angenommen|Anrhegedig a|An|Apabila|Atès|Atesa|Atunci|Avast!|Aye|A|awer|Bagi|Banjur|Bet|Biết|Blimey!|Buh|But at the end of the day I reckon|But y'all|But|BUT|Cal|Când|Cand|Cando|Ce|Cuando|Če|Ða ðe|Ða|Dadas|Dada|Dados|Dado|DaH ghu' bejlu'|dann|Dann|Dano|Dan|Dar|Dat fiind|Data|Date fiind|Date|Dati fiind|Dati|Daţi fiind|Dați fiind|DEN|Dato|De|Den youse gotta|Dengan|Diberi|Diyelim ki|Donada|Donat|Donitaĵo|Do|Dun|Duota|Ðurh|Eeldades|Ef|Eğer ki|Entao|Então|Entón|E|En|Entonces|Epi|És|Etant donnée|Etant donné|Et|Étant données|Étant donnée|Étant donné|Etant données|Etant donnés|Étant donnés|Fakat|Gangway!|Gdy|Gegeben seien|Gegeben sei|Gegeven|Gegewe|ghu' noblu'|Gitt|Given y'all|Given|Givet|Givun|Ha|Cho|I CAN HAZ|In|Ir|It's just unbelievable|I|Ja|Jeśli|Jeżeli|Kad|Kada|Kadar|Kai|Kaj|Když|Keď|Kemudian|Ketika|Khi|Kiedy|Ko|Kuid|Kui|Kun|Lan|latlh|Le sa a|Let go and haul|Le|Lè sa a|Lè|Logo|Lorsqu'<|Lorsque|mä|Maar|Mais|Mając|Ma|Majd|Maka|Manawa|Mas|Men|Menawa|Mutta|Nalika|Nalikaning|Nanging|Når|När|Nato|Nhưng|Niin|Njuk|O zaman|Och|Og|Oletetaan|Ond|Onda|Oraz|Pak|Pero|Però|Podano|Pokiaľ|Pokud|Potem|Potom|Privzeto|Pryd|Quan|Quand|Quando|qaSDI'|Så|Sed|Se|Siis|Sipoze ke|Sipoze Ke|Sipoze|Si|Şi|Și|Soit|Stel|Tada|Tad|Takrat|Tak|Tapi|Ter|Tetapi|Tha the|Tha|Then y'all|Then|Thì|Thurh|Toda|Too right|Un|Und|ugeholl|Và|vaj|Vendar|Ve|wann|Wanneer|WEN|Wenn|When y'all|When|Wtedy|Wun|Y'know|Yeah nah|Yna|Youse know like when|Youse know when youse got|Y|Za predpokladu|Za předpokladu|Zadan|Zadani|Zadano|Zadate|Zadato|Zakładając|Zaradi|Zatati|Þa þe|Þa|Þá|Þegar|Þurh|Αλλά|Δεδομένου|Και|Όταν|Τότε|А також|Агар|Але|Али|Аммо|А|Әгәр|Әйтик|Әмма|Бирок|Ва|Вә|Дадено|Дано|Допустим|Если|Задате|Задати|Задато|И|І|К тому же|Када|Кад|Когато|Когда|Коли|Ләкин|Лекин|Нәтиҗәдә|Нехай|Но|Онда|Припустимо, що|Припустимо|Пусть|Также|Та|Тогда|Тоді|То|Унда|Һәм|Якщо|אבל|אזי|אז|בהינתן|וגם|כאשר|آنگاه|اذاً|اگر|اما|اور|با فرض|بالفرض|بفرض|پھر|تب|ثم|جب|عندما|فرض کیا|لكن|لیکن|متى|هنگامی|و|अगर|और|कदा|किन्तु|चूंकि|जब|तथा|तदा|तब|परन्तु|पर|यदि|ਅਤੇ|ਜਦੋਂ|ਜਿਵੇਂ ਕਿ|ਜੇਕਰ|ਤਦ|ਪਰ|అప్పుడు|ఈ పరిస్థితిలో|కాని|చెప్పబడినది|మరియు|ಆದರೆ|ನಂತರ|ನೀಡಿದ|ಮತ್ತು|ಸ್ಥಿತಿಯನ್ನು|กำหนดให้|ดังนั้น|แต่|เมื่อ|และ|그러면<|그리고<|단<|만약<|만일<|먼저<|조건<|하지만<|かつ<|しかし<|ただし<|ならば<|もし<|並且<|但し<|但是<|假如<|假定<|假設<|假设<|前提<|同时<|同時<|并且<|当<|當<|而且<|那么<|那麼<)(?=[ \t])/m,
|
||||
lookbehind: true
|
||||
},
|
||||
string: {
|
||||
pattern: /"(?:\\.|[^"\\\r\n])*"|'(?:\\.|[^'\\\r\n])*'/,
|
||||
inside: {
|
||||
outline: {
|
||||
pattern: /<[^>]+>/,
|
||||
alias: 'variable'
|
||||
}
|
||||
}
|
||||
},
|
||||
outline: {
|
||||
pattern: /<[^>]+>/,
|
||||
alias: 'variable'
|
||||
}
|
||||
}
|
||||
})(Prism)
|
||||
}
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
git.displayName = 'git'
|
||||
git.aliases = []
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function git(Prism) {
|
||||
Prism.languages.git = {
|
||||
/*
|
||||
* A simple one line comment like in a git status command
|
||||
* For instance:
|
||||
* $ git status
|
||||
* # On branch infinite-scroll
|
||||
* # Your branch and 'origin/sharedBranches/frontendTeam/infinite-scroll' have diverged,
|
||||
* # and have 1 and 2 different commits each, respectively.
|
||||
* nothing to commit (working directory clean)
|
||||
*/
|
||||
comment: /^#.*/m,
|
||||
/*
|
||||
* Regexp to match the changed lines in a git diff output. Check the example below.
|
||||
*/
|
||||
deleted: /^[-–].*/m,
|
||||
inserted: /^\+.*/m,
|
||||
/*
|
||||
* a string (double and simple quote)
|
||||
*/
|
||||
string: /("|')(?:\\.|(?!\1)[^\\\r\n])*\1/,
|
||||
/*
|
||||
* a git command. It starts with a random prompt finishing by a $, then "git" then some other parameters
|
||||
* For instance:
|
||||
* $ git add file.txt
|
||||
*/
|
||||
command: {
|
||||
pattern: /^.*\$ git .*$/m,
|
||||
inside: {
|
||||
/*
|
||||
* A git command can contain a parameter starting by a single or a double dash followed by a string
|
||||
* For instance:
|
||||
* $ git diff --cached
|
||||
* $ git log -p
|
||||
*/
|
||||
parameter: /\s--?\w+/
|
||||
}
|
||||
},
|
||||
/*
|
||||
* Coordinates displayed in a git diff command
|
||||
* For instance:
|
||||
* $ git diff
|
||||
* diff --git file.txt file.txt
|
||||
* index 6214953..1d54a52 100644
|
||||
* --- file.txt
|
||||
* +++ file.txt
|
||||
* @@ -1 +1,2 @@
|
||||
* -Here's my tetx file
|
||||
* +Here's my text file
|
||||
* +And this is the second line
|
||||
*/
|
||||
coord: /^@@.*@@$/m,
|
||||
/*
|
||||
* Match a "commit [SHA1]" line in a git log output.
|
||||
* For instance:
|
||||
* $ git log
|
||||
* commit a11a14ef7e26f2ca62d4b35eac455ce636d0dc09
|
||||
* Author: lgiraudel
|
||||
* Date: Mon Feb 17 11:18:34 2014 +0100
|
||||
*
|
||||
* Add of a new line
|
||||
*/
|
||||
'commit-sha1': /^commit \w{40}$/m
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/** @type {import('../core.js').Syntax} */
|
||||
declare function gml(Prism: any): void;
|
||||
declare namespace gml {
|
||||
let displayName: string;
|
||||
let aliases: string[];
|
||||
}
|
||||
export default gml;
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/** @type {import('../core.js').Syntax} */
|
||||
declare function goModule(Prism: any): void;
|
||||
declare namespace goModule {
|
||||
let displayName: string;
|
||||
let aliases: string[];
|
||||
}
|
||||
export default goModule;
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/** @type {import('../core.js').Syntax} */
|
||||
declare function haxe(Prism: any): void;
|
||||
declare namespace haxe {
|
||||
let displayName: string;
|
||||
let aliases: any[];
|
||||
}
|
||||
export default haxe;
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/** @type {import('../core.js').Syntax} */
|
||||
declare function http(Prism: any): void;
|
||||
declare namespace http {
|
||||
let displayName: string;
|
||||
let aliases: any[];
|
||||
}
|
||||
export default http;
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
ichigojam.displayName = 'ichigojam'
|
||||
ichigojam.aliases = []
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function ichigojam(Prism) {
|
||||
// according to the offical reference (EN)
|
||||
// https://ichigojam.net/IchigoJam-en.html
|
||||
Prism.languages.ichigojam = {
|
||||
comment: /(?:\B'|REM)(?:[^\n\r]*)/i,
|
||||
string: {
|
||||
pattern: /"(?:""|[!#$%&'()*,\/:;<=>?^\w +\-.])*"/,
|
||||
greedy: true
|
||||
},
|
||||
number: /\B#[0-9A-F]+|\B`[01]+|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i,
|
||||
keyword:
|
||||
/\b(?:BEEP|BPS|CASE|CLEAR|CLK|CLO|CLP|CLS|CLT|CLV|CONT|COPY|ELSE|END|FILE|FILES|FOR|GOSUB|GOTO|GSB|IF|INPUT|KBD|LED|LET|LIST|LOAD|LOCATE|LRUN|NEW|NEXT|OUT|PLAY|POKE|PRINT|PWM|REM|RENUM|RESET|RETURN|RIGHT|RTN|RUN|SAVE|SCROLL|SLEEP|SRND|STEP|STOP|SUB|TEMPO|THEN|TO|UART|VIDEO|WAIT)(?:\$|\b)/i,
|
||||
function:
|
||||
/\b(?:ABS|ANA|ASC|BIN|BTN|DEC|END|FREE|HELP|HEX|I2CR|I2CW|IN|INKEY|LEN|LINE|PEEK|RND|SCR|SOUND|STR|TICK|USR|VER|VPEEK|ZER)(?:\$|\b)/i,
|
||||
label: /(?:\B@\S+)/,
|
||||
operator: /<[=>]?|>=?|\|\||&&|[+\-*\/=|&^~!]|\b(?:AND|NOT|OR)\b/i,
|
||||
punctuation: /[\[,;:()\]]/
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/** @type {import('../core.js').Syntax} */
|
||||
declare function icuMessageFormat(Prism: any): void;
|
||||
declare namespace icuMessageFormat {
|
||||
let displayName: string;
|
||||
let aliases: any[];
|
||||
}
|
||||
export default icuMessageFormat;
|
||||
+164
@@ -0,0 +1,164 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
icuMessageFormat.displayName = 'icu-message-format'
|
||||
icuMessageFormat.aliases = []
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function icuMessageFormat(Prism) {
|
||||
// https://unicode-org.github.io/icu/userguide/format_parse/messages/
|
||||
// https://unicode-org.github.io/icu-docs/apidoc/released/icu4j/com/ibm/icu/text/MessageFormat.html
|
||||
|
||||
;(function (Prism) {
|
||||
/**
|
||||
* @param {string} source
|
||||
* @param {number} level
|
||||
* @returns {string}
|
||||
*/
|
||||
function nested(source, level) {
|
||||
if (level <= 0) {
|
||||
return /[]/.source
|
||||
} else {
|
||||
return source.replace(/<SELF>/g, function () {
|
||||
return nested(source, level - 1)
|
||||
})
|
||||
}
|
||||
}
|
||||
var stringPattern = /'[{}:=,](?:[^']|'')*'(?!')/
|
||||
var escape = {
|
||||
pattern: /''/,
|
||||
greedy: true,
|
||||
alias: 'operator'
|
||||
}
|
||||
var string = {
|
||||
pattern: stringPattern,
|
||||
greedy: true,
|
||||
inside: {
|
||||
escape: escape
|
||||
}
|
||||
}
|
||||
var argumentSource = nested(
|
||||
/\{(?:[^{}']|'(?![{},'])|''|<STR>|<SELF>)*\}/.source.replace(
|
||||
/<STR>/g,
|
||||
function () {
|
||||
return stringPattern.source
|
||||
}
|
||||
),
|
||||
8
|
||||
)
|
||||
var nestedMessage = {
|
||||
pattern: RegExp(argumentSource),
|
||||
inside: {
|
||||
message: {
|
||||
pattern: /^(\{)[\s\S]+(?=\}$)/,
|
||||
lookbehind: true,
|
||||
inside: null // see below
|
||||
},
|
||||
'message-delimiter': {
|
||||
pattern: /./,
|
||||
alias: 'punctuation'
|
||||
}
|
||||
}
|
||||
}
|
||||
Prism.languages['icu-message-format'] = {
|
||||
argument: {
|
||||
pattern: RegExp(argumentSource),
|
||||
greedy: true,
|
||||
inside: {
|
||||
content: {
|
||||
pattern: /^(\{)[\s\S]+(?=\}$)/,
|
||||
lookbehind: true,
|
||||
inside: {
|
||||
'argument-name': {
|
||||
pattern: /^(\s*)[^{}:=,\s]+/,
|
||||
lookbehind: true
|
||||
},
|
||||
'choice-style': {
|
||||
// https://unicode-org.github.io/icu-docs/apidoc/released/icu4c/classicu_1_1ChoiceFormat.html#details
|
||||
pattern: /^(\s*,\s*choice\s*,\s*)\S(?:[\s\S]*\S)?/,
|
||||
lookbehind: true,
|
||||
inside: {
|
||||
punctuation: /\|/,
|
||||
range: {
|
||||
pattern: /^(\s*)[+-]?(?:\d+(?:\.\d*)?|\u221e)\s*[<#\u2264]/,
|
||||
lookbehind: true,
|
||||
inside: {
|
||||
operator: /[<#\u2264]/,
|
||||
number: /\S+/
|
||||
}
|
||||
},
|
||||
rest: null // see below
|
||||
}
|
||||
},
|
||||
'plural-style': {
|
||||
// https://unicode-org.github.io/icu-docs/apidoc/released/icu4j/com/ibm/icu/text/PluralFormat.html#:~:text=Patterns%20and%20Their%20Interpretation
|
||||
pattern:
|
||||
/^(\s*,\s*(?:plural|selectordinal)\s*,\s*)\S(?:[\s\S]*\S)?/,
|
||||
lookbehind: true,
|
||||
inside: {
|
||||
offset: /^offset:\s*\d+/,
|
||||
'nested-message': nestedMessage,
|
||||
selector: {
|
||||
pattern: /=\d+|[^{}:=,\s]+/,
|
||||
inside: {
|
||||
keyword: /^(?:few|many|one|other|two|zero)$/
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
'select-style': {
|
||||
// https://unicode-org.github.io/icu-docs/apidoc/released/icu4j/com/ibm/icu/text/SelectFormat.html#:~:text=Patterns%20and%20Their%20Interpretation
|
||||
pattern: /^(\s*,\s*select\s*,\s*)\S(?:[\s\S]*\S)?/,
|
||||
lookbehind: true,
|
||||
inside: {
|
||||
'nested-message': nestedMessage,
|
||||
selector: {
|
||||
pattern: /[^{}:=,\s]+/,
|
||||
inside: {
|
||||
keyword: /^other$/
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
keyword: /\b(?:choice|plural|select|selectordinal)\b/,
|
||||
'arg-type': {
|
||||
pattern: /\b(?:date|duration|number|ordinal|spellout|time)\b/,
|
||||
alias: 'keyword'
|
||||
},
|
||||
'arg-skeleton': {
|
||||
pattern: /(,\s*)::[^{}:=,\s]+/,
|
||||
lookbehind: true
|
||||
},
|
||||
'arg-style': {
|
||||
pattern:
|
||||
/(,\s*)(?:currency|full|integer|long|medium|percent|short)(?=\s*$)/,
|
||||
lookbehind: true
|
||||
},
|
||||
'arg-style-text': {
|
||||
pattern: RegExp(
|
||||
/(^\s*,\s*(?=\S))/.source +
|
||||
nested(/(?:[^{}']|'[^']*'|\{(?:<SELF>)?\})+/.source, 8) +
|
||||
'$'
|
||||
),
|
||||
lookbehind: true,
|
||||
alias: 'string'
|
||||
},
|
||||
punctuation: /,/
|
||||
}
|
||||
},
|
||||
'argument-delimiter': {
|
||||
pattern: /./,
|
||||
alias: 'operator'
|
||||
}
|
||||
}
|
||||
},
|
||||
escape: escape,
|
||||
string: string
|
||||
}
|
||||
nestedMessage.inside.message.inside = Prism.languages['icu-message-format']
|
||||
Prism.languages['icu-message-format'].argument.inside.content.inside[
|
||||
'choice-style'
|
||||
].inside.rest = Prism.languages['icu-message-format']
|
||||
})(Prism)
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/** @type {import('../core.js').Syntax} */
|
||||
declare function ini(Prism: any): void;
|
||||
declare namespace ini {
|
||||
let displayName: string;
|
||||
let aliases: any[];
|
||||
}
|
||||
export default ini;
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
j.displayName = 'j'
|
||||
j.aliases = []
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function j(Prism) {
|
||||
Prism.languages.j = {
|
||||
comment: {
|
||||
pattern: /\bNB\..*/,
|
||||
greedy: true
|
||||
},
|
||||
string: {
|
||||
pattern: /'(?:''|[^'\r\n])*'/,
|
||||
greedy: true
|
||||
},
|
||||
keyword:
|
||||
/\b(?:(?:CR|LF|adverb|conjunction|def|define|dyad|monad|noun|verb)\b|(?:assert|break|case|catch[dt]?|continue|do|else|elseif|end|fcase|for|for_\w+|goto_\w+|if|label_\w+|return|select|throw|try|while|whilst)\.)/,
|
||||
verb: {
|
||||
// Negative look-ahead prevents bad highlighting
|
||||
// of ^: ;. =. =: !. !:
|
||||
pattern:
|
||||
/(?!\^:|;\.|[=!][.:])(?:\{(?:\.|::?)?|p(?:\.\.?|:)|[=!\]]|[<>+*\-%$|,#][.:]?|[?^]\.?|[;\[]:?|[~}"i][.:]|[ACeEIjLor]\.|(?:[_\/\\qsux]|_?\d):)/,
|
||||
alias: 'keyword'
|
||||
},
|
||||
number:
|
||||
/\b_?(?:(?!\d:)\d+(?:\.\d+)?(?:(?:ad|ar|[ejpx])_?\d+(?:\.\d+)?)*(?:b_?[\da-z]+(?:\.[\da-z]+)?)?|_\b(?!\.))/,
|
||||
adverb: {
|
||||
pattern: /[~}]|[\/\\]\.?|[bfM]\.|t[.:]/,
|
||||
alias: 'builtin'
|
||||
},
|
||||
operator: /[=a][.:]|_\./,
|
||||
conjunction: {
|
||||
pattern: /&(?:\.:?|:)?|[.:@][.:]?|[!D][.:]|[;dHT]\.|`:?|[\^LS]:|"/,
|
||||
alias: 'variable'
|
||||
},
|
||||
punctuation: /[()]/
|
||||
}
|
||||
}
|
||||
+94
@@ -0,0 +1,94 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
javadoclike.displayName = 'javadoclike'
|
||||
javadoclike.aliases = []
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function javadoclike(Prism) {
|
||||
;(function (Prism) {
|
||||
var javaDocLike = (Prism.languages.javadoclike = {
|
||||
parameter: {
|
||||
pattern:
|
||||
/(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*@(?:arg|arguments|param)\s+)\w+/m,
|
||||
lookbehind: true
|
||||
},
|
||||
keyword: {
|
||||
// keywords are the first word in a line preceded be an `@` or surrounded by curly braces.
|
||||
// @word, {@word}
|
||||
pattern: /(^[\t ]*(?:\/{3}|\*|\/\*\*)\s*|\{)@[a-z][a-zA-Z-]+\b/m,
|
||||
lookbehind: true
|
||||
},
|
||||
punctuation: /[{}]/
|
||||
})
|
||||
|
||||
/**
|
||||
* Adds doc comment support to the given language and calls a given callback on each doc comment pattern.
|
||||
*
|
||||
* @param {string} lang the language add doc comment support to.
|
||||
* @param {(pattern: {inside: {rest: undefined}}) => void} callback the function called with each doc comment pattern as argument.
|
||||
*/
|
||||
function docCommentSupport(lang, callback) {
|
||||
var tokenName = 'doc-comment'
|
||||
var grammar = Prism.languages[lang]
|
||||
if (!grammar) {
|
||||
return
|
||||
}
|
||||
var token = grammar[tokenName]
|
||||
if (!token) {
|
||||
// add doc comment: /** */
|
||||
var definition = {}
|
||||
definition[tokenName] = {
|
||||
pattern: /(^|[^\\])\/\*\*[^/][\s\S]*?(?:\*\/|$)/,
|
||||
lookbehind: true,
|
||||
alias: 'comment'
|
||||
}
|
||||
grammar = Prism.languages.insertBefore(lang, 'comment', definition)
|
||||
token = grammar[tokenName]
|
||||
}
|
||||
if (token instanceof RegExp) {
|
||||
// convert regex to object
|
||||
token = grammar[tokenName] = {
|
||||
pattern: token
|
||||
}
|
||||
}
|
||||
if (Array.isArray(token)) {
|
||||
for (var i = 0, l = token.length; i < l; i++) {
|
||||
if (token[i] instanceof RegExp) {
|
||||
token[i] = {
|
||||
pattern: token[i]
|
||||
}
|
||||
}
|
||||
callback(token[i])
|
||||
}
|
||||
} else {
|
||||
callback(token)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds doc-comment support to the given languages for the given documentation language.
|
||||
*
|
||||
* @param {string[]|string} languages
|
||||
* @param {Object} docLanguage
|
||||
*/
|
||||
function addSupport(languages, docLanguage) {
|
||||
if (typeof languages === 'string') {
|
||||
languages = [languages]
|
||||
}
|
||||
languages.forEach(function (lang) {
|
||||
docCommentSupport(lang, function (pattern) {
|
||||
if (!pattern.inside) {
|
||||
pattern.inside = {}
|
||||
}
|
||||
pattern.inside.rest = docLanguage
|
||||
})
|
||||
})
|
||||
}
|
||||
Object.defineProperty(javaDocLike, 'addSupport', {
|
||||
value: addSupport
|
||||
})
|
||||
javaDocLike.addSupport(['java', 'javascript', 'php'], javaDocLike)
|
||||
})(Prism)
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/** @type {import('../core.js').Syntax} */
|
||||
declare function javastacktrace(Prism: any): void;
|
||||
declare namespace javastacktrace {
|
||||
let displayName: string;
|
||||
let aliases: any[];
|
||||
}
|
||||
export default javastacktrace;
|
||||
+149
@@ -0,0 +1,149 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
javastacktrace.displayName = 'javastacktrace'
|
||||
javastacktrace.aliases = []
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function javastacktrace(Prism) {
|
||||
// Specification:
|
||||
// https://docs.oracle.com/en/java/javase/13/docs/api/java.base/java/lang/Throwable.html#printStackTrace()
|
||||
|
||||
Prism.languages.javastacktrace = {
|
||||
// java.sql.SQLException: Violation of unique constraint MY_ENTITY_UK_1: duplicate value(s) for column(s) MY_COLUMN in statement [...]
|
||||
// Caused by: java.sql.SQLException: Violation of unique constraint MY_ENTITY_UK_1: duplicate value(s) for column(s) MY_COLUMN in statement [...]
|
||||
// Caused by: com.example.myproject.MyProjectServletException
|
||||
// Caused by: MidLevelException: LowLevelException
|
||||
// Suppressed: Resource$CloseFailException: Resource ID = 0
|
||||
summary: {
|
||||
pattern:
|
||||
/^([\t ]*)(?:(?:Caused by:|Suppressed:|Exception in thread "[^"]*")[\t ]+)?[\w$.]+(?::.*)?$/m,
|
||||
lookbehind: true,
|
||||
inside: {
|
||||
keyword: {
|
||||
pattern:
|
||||
/^([\t ]*)(?:(?:Caused by|Suppressed)(?=:)|Exception in thread)/m,
|
||||
lookbehind: true
|
||||
},
|
||||
// the current thread if the summary starts with 'Exception in thread'
|
||||
string: {
|
||||
pattern: /^(\s*)"[^"]*"/,
|
||||
lookbehind: true
|
||||
},
|
||||
exceptions: {
|
||||
pattern: /^(:?\s*)[\w$.]+(?=:|$)/,
|
||||
lookbehind: true,
|
||||
inside: {
|
||||
'class-name': /[\w$]+$/,
|
||||
namespace: /\b[a-z]\w*\b/,
|
||||
punctuation: /\./
|
||||
}
|
||||
},
|
||||
message: {
|
||||
pattern: /(:\s*)\S.*/,
|
||||
lookbehind: true,
|
||||
alias: 'string'
|
||||
},
|
||||
punctuation: /:/
|
||||
}
|
||||
},
|
||||
// at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
|
||||
// at org.hsqldb.jdbc.Util.throwError(Unknown Source) here could be some notes
|
||||
// at java.base/java.lang.Class.forName0(Native Method)
|
||||
// at Util.<init>(Unknown Source)
|
||||
// at com.foo.loader/foo@9.0/com.foo.Main.run(Main.java:101)
|
||||
// at com.foo.loader//com.foo.bar.App.run(App.java:12)
|
||||
// at acme@2.1/org.acme.Lib.test(Lib.java:80)
|
||||
// at MyClass.mash(MyClass.java:9)
|
||||
//
|
||||
// More information:
|
||||
// https://docs.oracle.com/en/java/javase/13/docs/api/java.base/java/lang/StackTraceElement.html#toString()
|
||||
//
|
||||
// A valid Java module name is defined as:
|
||||
// "A module name consists of one or more Java identifiers (§3.8) separated by "." tokens."
|
||||
// https://docs.oracle.com/javase/specs/jls/se9/html/jls-6.html#jls-ModuleName
|
||||
//
|
||||
// A Java module version is defined by this class:
|
||||
// https://docs.oracle.com/javase/9/docs/api/java/lang/module/ModuleDescriptor.Version.html
|
||||
// This is the implementation of the `parse` method in JDK13:
|
||||
// https://github.com/matcdac/jdk/blob/2305df71d1b7710266ae0956d73927a225132c0f/src/java.base/share/classes/java/lang/module/ModuleDescriptor.java#L1108
|
||||
// However, to keep this simple, a version will be matched by the pattern /@[\w$.+-]*/.
|
||||
'stack-frame': {
|
||||
pattern: /^([\t ]*)at (?:[\w$./]|@[\w$.+-]*\/)+(?:<init>)?\([^()]*\)/m,
|
||||
lookbehind: true,
|
||||
inside: {
|
||||
keyword: {
|
||||
pattern: /^(\s*)at(?= )/,
|
||||
lookbehind: true
|
||||
},
|
||||
source: [
|
||||
// (Main.java:15)
|
||||
// (Main.scala:15)
|
||||
{
|
||||
pattern: /(\()\w+\.\w+:\d+(?=\))/,
|
||||
lookbehind: true,
|
||||
inside: {
|
||||
file: /^\w+\.\w+/,
|
||||
punctuation: /:/,
|
||||
'line-number': {
|
||||
pattern: /\b\d+\b/,
|
||||
alias: 'number'
|
||||
}
|
||||
}
|
||||
},
|
||||
// (Unknown Source)
|
||||
// (Native Method)
|
||||
// (...something...)
|
||||
{
|
||||
pattern: /(\()[^()]*(?=\))/,
|
||||
lookbehind: true,
|
||||
inside: {
|
||||
keyword: /^(?:Native Method|Unknown Source)$/
|
||||
}
|
||||
}
|
||||
],
|
||||
'class-name': /[\w$]+(?=\.(?:<init>|[\w$]+)\()/,
|
||||
function: /(?:<init>|[\w$]+)(?=\()/,
|
||||
'class-loader': {
|
||||
pattern: /(\s)[a-z]\w*(?:\.[a-z]\w*)*(?=\/[\w@$.]*\/)/,
|
||||
lookbehind: true,
|
||||
alias: 'namespace',
|
||||
inside: {
|
||||
punctuation: /\./
|
||||
}
|
||||
},
|
||||
module: {
|
||||
pattern: /([\s/])[a-z]\w*(?:\.[a-z]\w*)*(?:@[\w$.+-]*)?(?=\/)/,
|
||||
lookbehind: true,
|
||||
inside: {
|
||||
version: {
|
||||
pattern: /(@)[\s\S]+/,
|
||||
lookbehind: true,
|
||||
alias: 'number'
|
||||
},
|
||||
punctuation: /[@.]/
|
||||
}
|
||||
},
|
||||
namespace: {
|
||||
pattern: /(?:\b[a-z]\w*\.)+/,
|
||||
inside: {
|
||||
punctuation: /\./
|
||||
}
|
||||
},
|
||||
punctuation: /[()/.]/
|
||||
}
|
||||
},
|
||||
// ... 32 more
|
||||
// ... 32 common frames omitted
|
||||
more: {
|
||||
pattern: /^([\t ]*)\.{3} \d+ [a-z]+(?: [a-z]+)*/m,
|
||||
lookbehind: true,
|
||||
inside: {
|
||||
punctuation: /\.{3}/,
|
||||
number: /\d+/,
|
||||
keyword: /\b[a-z]+(?: [a-z]+)*\b/
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
jexl.displayName = 'jexl'
|
||||
jexl.aliases = []
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function jexl(Prism) {
|
||||
Prism.languages.jexl = {
|
||||
string: /(["'])(?:\\[\s\S]|(?!\1)[^\\])*\1/,
|
||||
transform: {
|
||||
pattern:
|
||||
/(\|\s*)[a-zA-Zа-яА-Я_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$][\wа-яА-Я\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$]*/,
|
||||
alias: 'function',
|
||||
lookbehind: true
|
||||
},
|
||||
function:
|
||||
/[a-zA-Zа-яА-Я_\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$][\wа-яА-Я\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF$]*\s*(?=\()/,
|
||||
number: /\b\d+(?:\.\d+)?\b|\B\.\d+\b/,
|
||||
operator: /[<>!]=?|-|\+|&&|==|\|\|?|\/\/?|[?:*^%]/,
|
||||
boolean: /\b(?:false|true)\b/,
|
||||
keyword: /\bin\b/,
|
||||
punctuation: /[{}[\](),.]/
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/** @type {import('../core.js').Syntax} */
|
||||
declare function jolie(Prism: any): void;
|
||||
declare namespace jolie {
|
||||
let displayName: string;
|
||||
let aliases: any[];
|
||||
}
|
||||
export default jolie;
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/** @type {import('../core.js').Syntax} */
|
||||
declare function jq(Prism: any): void;
|
||||
declare namespace jq {
|
||||
let displayName: string;
|
||||
let aliases: any[];
|
||||
}
|
||||
export default jq;
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/** @type {import('../core.js').Syntax} */
|
||||
declare function jsdoc(Prism: any): void;
|
||||
declare namespace jsdoc {
|
||||
let displayName: string;
|
||||
let aliases: any[];
|
||||
}
|
||||
export default jsdoc;
|
||||
+102
@@ -0,0 +1,102 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
import refractorJavadoclike from './javadoclike.js'
|
||||
import refractorJavascript from './javascript.js'
|
||||
import refractorTypescript from './typescript.js'
|
||||
jsdoc.displayName = 'jsdoc'
|
||||
jsdoc.aliases = []
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function jsdoc(Prism) {
|
||||
Prism.register(refractorJavadoclike)
|
||||
Prism.register(refractorJavascript)
|
||||
Prism.register(refractorTypescript)
|
||||
;(function (Prism) {
|
||||
var javascript = Prism.languages.javascript
|
||||
var type = /\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})+\}/.source
|
||||
var parameterPrefix =
|
||||
'(@(?:arg|argument|param|property)\\s+(?:' + type + '\\s+)?)'
|
||||
Prism.languages.jsdoc = Prism.languages.extend('javadoclike', {
|
||||
parameter: {
|
||||
// @param {string} foo - foo bar
|
||||
pattern: RegExp(
|
||||
parameterPrefix + /(?:(?!\s)[$\w\xA0-\uFFFF.])+(?=\s|$)/.source
|
||||
),
|
||||
lookbehind: true,
|
||||
inside: {
|
||||
punctuation: /\./
|
||||
}
|
||||
}
|
||||
})
|
||||
Prism.languages.insertBefore('jsdoc', 'keyword', {
|
||||
'optional-parameter': {
|
||||
// @param {string} [baz.foo="bar"] foo bar
|
||||
pattern: RegExp(
|
||||
parameterPrefix +
|
||||
/\[(?:(?!\s)[$\w\xA0-\uFFFF.])+(?:=[^[\]]+)?\](?=\s|$)/.source
|
||||
),
|
||||
lookbehind: true,
|
||||
inside: {
|
||||
parameter: {
|
||||
pattern: /(^\[)[$\w\xA0-\uFFFF\.]+/,
|
||||
lookbehind: true,
|
||||
inside: {
|
||||
punctuation: /\./
|
||||
}
|
||||
},
|
||||
code: {
|
||||
pattern: /(=)[\s\S]*(?=\]$)/,
|
||||
lookbehind: true,
|
||||
inside: javascript,
|
||||
alias: 'language-javascript'
|
||||
},
|
||||
punctuation: /[=[\]]/
|
||||
}
|
||||
},
|
||||
'class-name': [
|
||||
{
|
||||
pattern: RegExp(
|
||||
/(@(?:augments|class|extends|interface|memberof!?|template|this|typedef)\s+(?:<TYPE>\s+)?)[A-Z]\w*(?:\.[A-Z]\w*)*/.source.replace(
|
||||
/<TYPE>/g,
|
||||
function () {
|
||||
return type
|
||||
}
|
||||
)
|
||||
),
|
||||
lookbehind: true,
|
||||
inside: {
|
||||
punctuation: /\./
|
||||
}
|
||||
},
|
||||
{
|
||||
pattern: RegExp('(@[a-z]+\\s+)' + type),
|
||||
lookbehind: true,
|
||||
inside: {
|
||||
string: javascript.string,
|
||||
number: javascript.number,
|
||||
boolean: javascript.boolean,
|
||||
keyword: Prism.languages.typescript.keyword,
|
||||
operator: /=>|\.\.\.|[&|?:*]/,
|
||||
punctuation: /[.,;=<>{}()[\]]/
|
||||
}
|
||||
}
|
||||
],
|
||||
example: {
|
||||
pattern:
|
||||
/(@example\s+(?!\s))(?:[^@\s]|\s+(?!\s))+?(?=\s*(?:\*\s*)?(?:@\w|\*\/))/,
|
||||
lookbehind: true,
|
||||
inside: {
|
||||
code: {
|
||||
pattern: /^([\t ]*(?:\*\s*)?)\S.*$/m,
|
||||
lookbehind: true,
|
||||
inside: javascript,
|
||||
alias: 'language-javascript'
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
Prism.languages.javadoclike.addSupport('javascript', Prism.languages.jsdoc)
|
||||
})(Prism)
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/** @type {import('../core.js').Syntax} */
|
||||
declare function json5(Prism: any): void;
|
||||
declare namespace json5 {
|
||||
let displayName: string;
|
||||
let aliases: any[];
|
||||
}
|
||||
export default json5;
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
import refractorJson from './json.js'
|
||||
json5.displayName = 'json5'
|
||||
json5.aliases = []
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function json5(Prism) {
|
||||
Prism.register(refractorJson)
|
||||
;(function (Prism) {
|
||||
var string = /("|')(?:\\(?:\r\n?|\n|.)|(?!\1)[^\\\r\n])*\1/
|
||||
Prism.languages.json5 = Prism.languages.extend('json', {
|
||||
property: [
|
||||
{
|
||||
pattern: RegExp(string.source + '(?=\\s*:)'),
|
||||
greedy: true
|
||||
},
|
||||
{
|
||||
pattern:
|
||||
/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/,
|
||||
alias: 'unquoted'
|
||||
}
|
||||
],
|
||||
string: {
|
||||
pattern: string,
|
||||
greedy: true
|
||||
},
|
||||
number:
|
||||
/[+-]?\b(?:NaN|Infinity|0x[a-fA-F\d]+)\b|[+-]?(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[eE][+-]?\d+\b)?/
|
||||
})
|
||||
})(Prism)
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/** @type {import('../core.js').Syntax} */
|
||||
declare function jsx(Prism: any): void;
|
||||
declare namespace jsx {
|
||||
let displayName: string;
|
||||
let aliases: any[];
|
||||
}
|
||||
export default jsx;
|
||||
+63
@@ -0,0 +1,63 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
keepalived.displayName = 'keepalived'
|
||||
keepalived.aliases = []
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function keepalived(Prism) {
|
||||
Prism.languages.keepalived = {
|
||||
comment: {
|
||||
pattern: /[#!].*/,
|
||||
greedy: true
|
||||
},
|
||||
string: {
|
||||
pattern:
|
||||
/(^|[^\\])(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/,
|
||||
lookbehind: true,
|
||||
greedy: true
|
||||
},
|
||||
// support IPv4, IPv6, subnet mask
|
||||
ip: {
|
||||
pattern: RegExp(
|
||||
/\b(?:(?:(?:[\da-f]{1,4}:){7}[\da-f]{1,4}|(?:[\da-f]{1,4}:){6}:[\da-f]{1,4}|(?:[\da-f]{1,4}:){5}:(?:[\da-f]{1,4}:)?[\da-f]{1,4}|(?:[\da-f]{1,4}:){4}:(?:[\da-f]{1,4}:){0,2}[\da-f]{1,4}|(?:[\da-f]{1,4}:){3}:(?:[\da-f]{1,4}:){0,3}[\da-f]{1,4}|(?:[\da-f]{1,4}:){2}:(?:[\da-f]{1,4}:){0,4}[\da-f]{1,4}|(?:[\da-f]{1,4}:){6}<ipv4>|(?:[\da-f]{1,4}:){0,5}:<ipv4>|::(?:[\da-f]{1,4}:){0,5}<ipv4>|[\da-f]{1,4}::(?:[\da-f]{1,4}:){0,5}[\da-f]{1,4}|::(?:[\da-f]{1,4}:){0,6}[\da-f]{1,4}|(?:[\da-f]{1,4}:){1,7}:)(?:\/\d{1,3})?|<ipv4>(?:\/\d{1,2})?)\b/.source.replace(
|
||||
/<ipv4>/g,
|
||||
function () {
|
||||
return /(?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d))/
|
||||
.source
|
||||
}
|
||||
),
|
||||
'i'
|
||||
),
|
||||
alias: 'number'
|
||||
},
|
||||
// support *nix / Windows, directory / file
|
||||
path: {
|
||||
pattern:
|
||||
/(\s)\/(?:[^\/\s]+\/)*[^\/\s]*|\b[a-zA-Z]:\\(?:[^\\\s]+\\)*[^\\\s]*/,
|
||||
lookbehind: true,
|
||||
alias: 'string'
|
||||
},
|
||||
variable: /\$\{?\w+\}?/,
|
||||
email: {
|
||||
pattern: /[\w-]+@[\w-]+(?:\.[\w-]{2,3}){1,2}/,
|
||||
alias: 'string'
|
||||
},
|
||||
'conditional-configuration': {
|
||||
pattern: /@\^?[\w-]+/,
|
||||
alias: 'variable'
|
||||
},
|
||||
operator: /=/,
|
||||
property:
|
||||
/\b(?:BFD_CHECK|DNS_CHECK|FILE_CHECK|HTTP_GET|MISC_CHECK|NAME|PING_CHECK|SCRIPTS|SMTP_CHECK|SSL|SSL_GET|TCP_CHECK|UDP_CHECK|accept|advert_int|alpha|auth_pass|auth_type|authentication|bfd_cpu_affinity|bfd_instance|bfd_no_swap|bfd_priority|bfd_process_name|bfd_rlimit_rttime|bfd_rt_priority|bind_if|bind_port|bindto|ca|certificate|check_unicast_src|checker|checker_cpu_affinity|checker_log_all_failures|checker_no_swap|checker_priority|checker_rlimit_rttime|checker_rt_priority|child_wait_time|connect_ip|connect_port|connect_timeout|dbus_service_name|debug|default_interface|delay|delay_before_retry|delay_loop|digest|dont_track_primary|dynamic|dynamic_interfaces|enable_(?:dbus|script_security|sni|snmp_checker|snmp_rfc|snmp_rfcv2|snmp_rfcv3|snmp_vrrp|traps)|end|fall|fast_recovery|file|flag-[123]|fork_delay|full_command|fwmark|garp_group|garp_interval|garp_lower_prio_delay|garp_lower_prio_repeat|garp_master_delay|garp_master_refresh|garp_master_refresh_repeat|garp_master_repeat|global_defs|global_tracking|gna_interval|group|ha_suspend|hashed|helo_name|higher_prio_send_advert|hoplimit|http_protocol|hysteresis|idle_tx|include|inhibit_on_failure|init_fail|init_file|instance|interface|interfaces|interval|ip_family|ipvs_process_name|keepalived.conf|kernel_rx_buf_size|key|linkbeat_interfaces|linkbeat_use_polling|log_all_failures|log_unknown_vrids|lower_prio_no_advert|lthreshold|lvs_flush|lvs_flush_onstop|lvs_method|lvs_netlink_cmd_rcv_bufs|lvs_netlink_cmd_rcv_bufs_force|lvs_netlink_monitor_rcv_bufs|lvs_netlink_monitor_rcv_bufs_force|lvs_notify_fifo|lvs_notify_fifo_script|lvs_sched|lvs_sync_daemon|max_auto_priority|max_hops|mcast_src_ip|mh-fallback|mh-port|min_auto_priority_delay|min_rx|min_tx|misc_dynamic|misc_path|misc_timeout|multiplier|name|namespace_with_ipsets|native_ipv6|neighbor_ip|net_namespace|net_namespace_ipvs|nftables|nftables_counters|nftables_ifindex|nftables_priority|no_accept|no_checker_emails|no_email_faults|nopreempt|notification_email|notification_email_from|notify|notify_backup|notify_deleted|notify_down|notify_fault|notify_fifo|notify_fifo_script|notify_master|notify_master_rx_lower_pri|notify_priority_changes|notify_stop|notify_up|old_unicast_checksum|omega|ops|param_match|passive|password|path|persistence_engine|persistence_granularity|persistence_timeout|preempt|preempt_delay|priority|process|process_monitor_rcv_bufs|process_monitor_rcv_bufs_force|process_name|process_names|promote_secondaries|protocol|proxy_arp|proxy_arp_pvlan|quorum|quorum_down|quorum_max|quorum_up|random_seed|real_server|regex|regex_max_offset|regex_min_offset|regex_no_match|regex_options|regex_stack|reload_repeat|reload_time_file|require_reply|retry|rise|router_id|rs_init_notifies|script|script_user|sh-fallback|sh-port|shutdown_script|shutdown_script_timeout|skip_check_adv_addr|smtp_alert|smtp_alert_checker|smtp_alert_vrrp|smtp_connect_timeout|smtp_helo_name|smtp_server|snmp_socket|sorry_server|sorry_server_inhibit|sorry_server_lvs_method|source_ip|start|startup_script|startup_script_timeout|state|static_ipaddress|static_routes|static_rules|status_code|step|strict_mode|sync_group_tracking_weight|terminate_delay|timeout|track_bfd|track_file|track_group|track_interface|track_process|track_script|track_src_ip|ttl|type|umask|unicast_peer|unicast_src_ip|unicast_ttl|url|use_ipvlan|use_pid_dir|use_vmac|user|uthreshold|val[123]|version|virtual_ipaddress|virtual_ipaddress_excluded|virtual_router_id|virtual_routes|virtual_rules|virtual_server|virtual_server_group|virtualhost|vmac_xmit_base|vrrp|vrrp_(?:check_unicast_src|cpu_affinity|garp_interval|garp_lower_prio_delay|garp_lower_prio_repeat|garp_master_delay|garp_master_refresh|garp_master_refresh_repeat|garp_master_repeat|gna_interval|higher_prio_send_advert|instance|ipsets|iptables|lower_prio_no_advert|mcast_group4|mcast_group6|min_garp|netlink_cmd_rcv_bufs|netlink_cmd_rcv_bufs_force|netlink_monitor_rcv_bufs|netlink_monitor_rcv_bufs_force|no_swap|notify_fifo|notify_fifo_script|notify_priority_changes|priority|process_name|rlimit_rttime|rt_priority|rx_bufs_multiplier|rx_bufs_policy|script|skip_check_adv_addr|startup_delay|strict|sync_group|track_process|version)|warmup|weight)\b/,
|
||||
constant:
|
||||
/\b(?:A|AAAA|AH|BACKUP|CNAME|DR|MASTER|MX|NAT|NS|PASS|SCTP|SOA|TCP|TUN|TXT|UDP|dh|fo|lblc|lblcr|lc|mh|nq|ovf|rr|sed|sh|wlc|wrr)\b/,
|
||||
number: {
|
||||
pattern: /(^|[^\w.-])-?\d+(?:\.\d+)?/,
|
||||
lookbehind: true
|
||||
},
|
||||
boolean: /\b(?:false|no|off|on|true|yes)\b/,
|
||||
punctuation: /[\{\}]/
|
||||
}
|
||||
}
|
||||
+96
@@ -0,0 +1,96 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
import refractorClike from './clike.js'
|
||||
kotlin.displayName = 'kotlin'
|
||||
kotlin.aliases = ['kt', 'kts']
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function kotlin(Prism) {
|
||||
Prism.register(refractorClike)
|
||||
;(function (Prism) {
|
||||
Prism.languages.kotlin = Prism.languages.extend('clike', {
|
||||
keyword: {
|
||||
// The lookbehind prevents wrong highlighting of e.g. kotlin.properties.get
|
||||
pattern:
|
||||
/(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/,
|
||||
lookbehind: true
|
||||
},
|
||||
function: [
|
||||
{
|
||||
pattern: /(?:`[^\r\n`]+`|\b\w+)(?=\s*\()/,
|
||||
greedy: true
|
||||
},
|
||||
{
|
||||
pattern: /(\.)(?:`[^\r\n`]+`|\w+)(?=\s*\{)/,
|
||||
lookbehind: true,
|
||||
greedy: true
|
||||
}
|
||||
],
|
||||
number:
|
||||
/\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/,
|
||||
operator:
|
||||
/\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/
|
||||
})
|
||||
delete Prism.languages.kotlin['class-name']
|
||||
var interpolationInside = {
|
||||
'interpolation-punctuation': {
|
||||
pattern: /^\$\{?|\}$/,
|
||||
alias: 'punctuation'
|
||||
},
|
||||
expression: {
|
||||
pattern: /[\s\S]+/,
|
||||
inside: Prism.languages.kotlin
|
||||
}
|
||||
}
|
||||
Prism.languages.insertBefore('kotlin', 'string', {
|
||||
// https://kotlinlang.org/spec/expressions.html#string-interpolation-expressions
|
||||
'string-literal': [
|
||||
{
|
||||
pattern: /"""(?:[^$]|\$(?:(?!\{)|\{[^{}]*\}))*?"""/,
|
||||
alias: 'multiline',
|
||||
inside: {
|
||||
interpolation: {
|
||||
pattern: /\$(?:[a-z_]\w*|\{[^{}]*\})/i,
|
||||
inside: interpolationInside
|
||||
},
|
||||
string: /[\s\S]+/
|
||||
}
|
||||
},
|
||||
{
|
||||
pattern: /"(?:[^"\\\r\n$]|\\.|\$(?:(?!\{)|\{[^{}]*\}))*"/,
|
||||
alias: 'singleline',
|
||||
inside: {
|
||||
interpolation: {
|
||||
pattern: /((?:^|[^\\])(?:\\{2})*)\$(?:[a-z_]\w*|\{[^{}]*\})/i,
|
||||
lookbehind: true,
|
||||
inside: interpolationInside
|
||||
},
|
||||
string: /[\s\S]+/
|
||||
}
|
||||
}
|
||||
],
|
||||
char: {
|
||||
// https://kotlinlang.org/spec/expressions.html#character-literals
|
||||
pattern: /'(?:[^'\\\r\n]|\\(?:.|u[a-fA-F0-9]{0,4}))'/,
|
||||
greedy: true
|
||||
}
|
||||
})
|
||||
delete Prism.languages.kotlin['string']
|
||||
Prism.languages.insertBefore('kotlin', 'keyword', {
|
||||
annotation: {
|
||||
pattern: /\B@(?:\w+:)?(?:[A-Z]\w*|\[[^\]]+\])/,
|
||||
alias: 'builtin'
|
||||
}
|
||||
})
|
||||
Prism.languages.insertBefore('kotlin', 'function', {
|
||||
label: {
|
||||
pattern: /\b\w+@|@\w+\b/,
|
||||
alias: 'symbol'
|
||||
}
|
||||
})
|
||||
Prism.languages.kt = Prism.languages.kotlin
|
||||
Prism.languages.kts = Prism.languages.kotlin
|
||||
})(Prism)
|
||||
}
|
||||
+85
@@ -0,0 +1,85 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
import refractorClike from './clike.js'
|
||||
import refractorMarkupTemplating from './markup-templating.js'
|
||||
import refractorPhp from './php.js'
|
||||
latte.displayName = 'latte'
|
||||
latte.aliases = []
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function latte(Prism) {
|
||||
Prism.register(refractorClike)
|
||||
Prism.register(refractorMarkupTemplating)
|
||||
Prism.register(refractorPhp)
|
||||
;(function (Prism) {
|
||||
Prism.languages.latte = {
|
||||
comment: /^\{\*[\s\S]*/,
|
||||
'latte-tag': {
|
||||
// https://latte.nette.org/en/tags
|
||||
pattern: /(^\{(?:\/(?=[a-z]))?)(?:[=_]|[a-z]\w*\b(?!\())/i,
|
||||
lookbehind: true,
|
||||
alias: 'important'
|
||||
},
|
||||
delimiter: {
|
||||
pattern: /^\{\/?|\}$/,
|
||||
alias: 'punctuation'
|
||||
},
|
||||
php: {
|
||||
pattern: /\S(?:[\s\S]*\S)?/,
|
||||
alias: 'language-php',
|
||||
inside: Prism.languages.php
|
||||
}
|
||||
}
|
||||
var markupLatte = Prism.languages.extend('markup', {})
|
||||
Prism.languages.insertBefore(
|
||||
'inside',
|
||||
'attr-value',
|
||||
{
|
||||
'n-attr': {
|
||||
pattern: /n:[\w-]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+))?/,
|
||||
inside: {
|
||||
'attr-name': {
|
||||
pattern: /^[^\s=]+/,
|
||||
alias: 'important'
|
||||
},
|
||||
'attr-value': {
|
||||
pattern: /=[\s\S]+/,
|
||||
inside: {
|
||||
punctuation: [
|
||||
/^=/,
|
||||
{
|
||||
pattern: /^(\s*)["']|["']$/,
|
||||
lookbehind: true
|
||||
}
|
||||
],
|
||||
php: {
|
||||
pattern: /\S(?:[\s\S]*\S)?/,
|
||||
inside: Prism.languages.php
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
markupLatte.tag
|
||||
)
|
||||
Prism.hooks.add('before-tokenize', function (env) {
|
||||
if (env.language !== 'latte') {
|
||||
return
|
||||
}
|
||||
var lattePattern =
|
||||
/\{\*[\s\S]*?\*\}|\{[^'"\s{}*](?:[^"'/{}]|\/(?![*/])|("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|\/\*(?:[^*]|\*(?!\/))*\*\/)*\}/g
|
||||
Prism.languages['markup-templating'].buildPlaceholders(
|
||||
env,
|
||||
'latte',
|
||||
lattePattern
|
||||
)
|
||||
env.grammar = markupLatte
|
||||
})
|
||||
Prism.hooks.add('after-tokenize', function (env) {
|
||||
Prism.languages['markup-templating'].tokenizePlaceholders(env, 'latte')
|
||||
})
|
||||
})(Prism)
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/** @type {import('../core.js').Syntax} */
|
||||
declare function less(Prism: any): void;
|
||||
declare namespace less {
|
||||
let displayName: string;
|
||||
let aliases: any[];
|
||||
}
|
||||
export default less;
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
import refractorCss from './css.js'
|
||||
less.displayName = 'less'
|
||||
less.aliases = []
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function less(Prism) {
|
||||
Prism.register(refractorCss)
|
||||
/* FIXME :
|
||||
:extend() is not handled specifically : its highlighting is buggy.
|
||||
Mixin usage must be inside a ruleset to be highlighted.
|
||||
At-rules (e.g. import) containing interpolations are buggy.
|
||||
Detached rulesets are highlighted as at-rules.
|
||||
A comment before a mixin usage prevents the latter to be properly highlighted.
|
||||
*/
|
||||
|
||||
Prism.languages.less = Prism.languages.extend('css', {
|
||||
comment: [
|
||||
/\/\*[\s\S]*?\*\//,
|
||||
{
|
||||
pattern: /(^|[^\\])\/\/.*/,
|
||||
lookbehind: true
|
||||
}
|
||||
],
|
||||
atrule: {
|
||||
pattern:
|
||||
/@[\w-](?:\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};\s]|\s+(?!\s))*?(?=\s*\{)/,
|
||||
inside: {
|
||||
punctuation: /[:()]/
|
||||
}
|
||||
},
|
||||
// selectors and mixins are considered the same
|
||||
selector: {
|
||||
pattern:
|
||||
/(?:@\{[\w-]+\}|[^{};\s@])(?:@\{[\w-]+\}|\((?:[^(){}]|\([^(){}]*\))*\)|[^(){};@\s]|\s+(?!\s))*?(?=\s*\{)/,
|
||||
inside: {
|
||||
// mixin parameters
|
||||
variable: /@+[\w-]+/
|
||||
}
|
||||
},
|
||||
property: /(?:@\{[\w-]+\}|[\w-])+(?:\+_?)?(?=\s*:)/,
|
||||
operator: /[+\-*\/]/
|
||||
})
|
||||
Prism.languages.insertBefore('less', 'property', {
|
||||
variable: [
|
||||
// Variable declaration (the colon must be consumed!)
|
||||
{
|
||||
pattern: /@[\w-]+\s*:/,
|
||||
inside: {
|
||||
punctuation: /:/
|
||||
}
|
||||
},
|
||||
// Variable usage
|
||||
/@@?[\w-]+/
|
||||
],
|
||||
'mixin-usage': {
|
||||
pattern: /([{;]\s*)[.#](?!\d)[\w-].*?(?=[(;])/,
|
||||
lookbehind: true,
|
||||
alias: 'function'
|
||||
}
|
||||
})
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
linkerScript.displayName = 'linker-script'
|
||||
linkerScript.aliases = ['ld']
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function linkerScript(Prism) {
|
||||
Prism.languages['linker-script'] = {
|
||||
comment: {
|
||||
pattern: /(^|\s)\/\*[\s\S]*?(?:$|\*\/)/,
|
||||
lookbehind: true,
|
||||
greedy: true
|
||||
},
|
||||
identifier: {
|
||||
pattern: /"[^"\r\n]*"/,
|
||||
greedy: true
|
||||
},
|
||||
'location-counter': {
|
||||
pattern: /\B\.\B/,
|
||||
alias: 'important'
|
||||
},
|
||||
section: {
|
||||
pattern: /(^|[^\w*])\.\w+\b/,
|
||||
lookbehind: true,
|
||||
alias: 'keyword'
|
||||
},
|
||||
function: /\b[A-Z][A-Z_]*(?=\s*\()/,
|
||||
number: /\b(?:0[xX][a-fA-F0-9]+|\d+)[KM]?\b/,
|
||||
operator: />>=?|<<=?|->|\+\+|--|&&|\|\||::|[?:~]|[-+*/%&|^!=<>]=?/,
|
||||
punctuation: /[(){},;]/
|
||||
}
|
||||
Prism.languages['ld'] = Prism.languages['linker-script']
|
||||
}
|
||||
+129
@@ -0,0 +1,129 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
log.displayName = 'log'
|
||||
log.aliases = []
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function log(Prism) {
|
||||
// This is a language definition for generic log files.
|
||||
// Since there is no one log format, this language definition has to support all formats to some degree.
|
||||
//
|
||||
// Based on https://github.com/MTDL9/vim-log-highlighting
|
||||
|
||||
Prism.languages.log = {
|
||||
string: {
|
||||
// Single-quoted strings must not be confused with plain text. E.g. Can't isn't Susan's Chris' toy
|
||||
pattern: /"(?:[^"\\\r\n]|\\.)*"|'(?![st] | \w)(?:[^'\\\r\n]|\\.)*'/,
|
||||
greedy: true
|
||||
},
|
||||
exception: {
|
||||
pattern:
|
||||
/(^|[^\w.])[a-z][\w.]*(?:Error|Exception):.*(?:(?:\r\n?|\n)[ \t]*(?:at[ \t].+|\.{3}.*|Caused by:.*))+(?:(?:\r\n?|\n)[ \t]*\.\.\. .*)?/,
|
||||
lookbehind: true,
|
||||
greedy: true,
|
||||
alias: ['javastacktrace', 'language-javastacktrace'],
|
||||
inside: Prism.languages['javastacktrace'] || {
|
||||
keyword: /\bat\b/,
|
||||
function: /[a-z_][\w$]*(?=\()/,
|
||||
punctuation: /[.:()]/
|
||||
}
|
||||
},
|
||||
level: [
|
||||
{
|
||||
pattern:
|
||||
/\b(?:ALERT|CRIT|CRITICAL|EMERG|EMERGENCY|ERR|ERROR|FAILURE|FATAL|SEVERE)\b/,
|
||||
alias: ['error', 'important']
|
||||
},
|
||||
{
|
||||
pattern: /\b(?:WARN|WARNING|WRN)\b/,
|
||||
alias: ['warning', 'important']
|
||||
},
|
||||
{
|
||||
pattern: /\b(?:DISPLAY|INF|INFO|NOTICE|STATUS)\b/,
|
||||
alias: ['info', 'keyword']
|
||||
},
|
||||
{
|
||||
pattern: /\b(?:DBG|DEBUG|FINE)\b/,
|
||||
alias: ['debug', 'keyword']
|
||||
},
|
||||
{
|
||||
pattern: /\b(?:FINER|FINEST|TRACE|TRC|VERBOSE|VRB)\b/,
|
||||
alias: ['trace', 'comment']
|
||||
}
|
||||
],
|
||||
property: {
|
||||
pattern:
|
||||
/((?:^|[\]|])[ \t]*)[a-z_](?:[\w-]|\b\/\b)*(?:[. ]\(?\w(?:[\w-]|\b\/\b)*\)?)*:(?=\s)/im,
|
||||
lookbehind: true
|
||||
},
|
||||
separator: {
|
||||
pattern: /(^|[^-+])-{3,}|={3,}|\*{3,}|- - /m,
|
||||
lookbehind: true,
|
||||
alias: 'comment'
|
||||
},
|
||||
url: /\b(?:file|ftp|https?):\/\/[^\s|,;'"]*[^\s|,;'">.]/,
|
||||
email: {
|
||||
pattern: /(^|\s)[-\w+.]+@[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)+(?=\s)/,
|
||||
lookbehind: true,
|
||||
alias: 'url'
|
||||
},
|
||||
'ip-address': {
|
||||
pattern: /\b(?:\d{1,3}(?:\.\d{1,3}){3})\b/,
|
||||
alias: 'constant'
|
||||
},
|
||||
'mac-address': {
|
||||
pattern: /\b[a-f0-9]{2}(?::[a-f0-9]{2}){5}\b/i,
|
||||
alias: 'constant'
|
||||
},
|
||||
domain: {
|
||||
pattern:
|
||||
/(^|\s)[a-z][a-z0-9-]*(?:\.[a-z][a-z0-9-]*)*\.[a-z][a-z0-9-]+(?=\s)/,
|
||||
lookbehind: true,
|
||||
alias: 'constant'
|
||||
},
|
||||
uuid: {
|
||||
pattern:
|
||||
/\b[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}\b/i,
|
||||
alias: 'constant'
|
||||
},
|
||||
hash: {
|
||||
pattern: /\b(?:[a-f0-9]{32}){1,2}\b/i,
|
||||
alias: 'constant'
|
||||
},
|
||||
'file-path': {
|
||||
pattern:
|
||||
/\b[a-z]:[\\/][^\s|,;:(){}\[\]"']+|(^|[\s:\[\](>|])\.{0,2}\/\w[^\s|,;:(){}\[\]"']*/i,
|
||||
lookbehind: true,
|
||||
greedy: true,
|
||||
alias: 'string'
|
||||
},
|
||||
date: {
|
||||
pattern: RegExp(
|
||||
/\b\d{4}[-/]\d{2}[-/]\d{2}(?:T(?=\d{1,2}:)|(?=\s\d{1,2}:))/.source +
|
||||
'|' +
|
||||
/\b\d{1,4}[-/ ](?:\d{1,2}|Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep)[-/ ]\d{2,4}T?\b/
|
||||
.source +
|
||||
'|' +
|
||||
/\b(?:(?:Fri|Mon|Sat|Sun|Thu|Tue|Wed)(?:\s{1,2}(?:Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep))?|Apr|Aug|Dec|Feb|Jan|Jul|Jun|Mar|May|Nov|Oct|Sep)\s{1,2}\d{1,2}\b/
|
||||
.source,
|
||||
'i'
|
||||
),
|
||||
alias: 'number'
|
||||
},
|
||||
time: {
|
||||
pattern:
|
||||
/\b\d{1,2}:\d{1,2}:\d{1,2}(?:[.,:]\d+)?(?:\s?[+-]\d{2}:?\d{2}|Z)?\b/,
|
||||
alias: 'number'
|
||||
},
|
||||
boolean: /\b(?:false|null|true)\b/i,
|
||||
number: {
|
||||
pattern:
|
||||
/(^|[^.\w])(?:0x[a-f0-9]+|0o[0-7]+|0b[01]+|v?\d[\da-f]*(?:\.\d+)*(?:e[+-]?\d+)?[a-z]{0,3}\b)\b(?!\.\w)/i,
|
||||
lookbehind: true
|
||||
},
|
||||
operator: /[;:?<=>~/@!$%&+\-|^(){}*#]/,
|
||||
punctuation: /[\[\].,]/
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/** @type {import('../core.js').Syntax} */
|
||||
declare function lolcode(Prism: any): void;
|
||||
declare namespace lolcode {
|
||||
let displayName: string;
|
||||
let aliases: any[];
|
||||
}
|
||||
export default lolcode;
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
lolcode.displayName = 'lolcode'
|
||||
lolcode.aliases = []
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function lolcode(Prism) {
|
||||
Prism.languages.lolcode = {
|
||||
comment: [/\bOBTW\s[\s\S]*?\sTLDR\b/, /\bBTW.+/],
|
||||
string: {
|
||||
pattern: /"(?::.|[^":])*"/,
|
||||
inside: {
|
||||
variable: /:\{[^}]+\}/,
|
||||
symbol: [/:\([a-f\d]+\)/i, /:\[[^\]]+\]/, /:[)>o":]/]
|
||||
},
|
||||
greedy: true
|
||||
},
|
||||
number: /(?:\B-)?(?:\b\d+(?:\.\d*)?|\B\.\d+)/,
|
||||
symbol: {
|
||||
pattern: /(^|\s)(?:A )?(?:BUKKIT|NOOB|NUMBAR|NUMBR|TROOF|YARN)(?=\s|,|$)/,
|
||||
lookbehind: true,
|
||||
inside: {
|
||||
keyword: /A(?=\s)/
|
||||
}
|
||||
},
|
||||
label: {
|
||||
pattern: /((?:^|\s)(?:IM IN YR|IM OUTTA YR) )[a-zA-Z]\w*/,
|
||||
lookbehind: true,
|
||||
alias: 'string'
|
||||
},
|
||||
function: {
|
||||
pattern: /((?:^|\s)(?:HOW IZ I|I IZ|IZ) )[a-zA-Z]\w*/,
|
||||
lookbehind: true
|
||||
},
|
||||
keyword: [
|
||||
{
|
||||
pattern:
|
||||
/(^|\s)(?:AN|FOUND YR|GIMMEH|GTFO|HAI|HAS A|HOW IZ I|I HAS A|I IZ|IF U SAY SO|IM IN YR|IM OUTTA YR|IS NOW(?: A)?|ITZ(?: A)?|IZ|KTHX|KTHXBYE|LIEK(?: A)?|MAEK|MEBBE|MKAY|NERFIN|NO WAI|O HAI IM|O RLY\?|OIC|OMG|OMGWTF|R|SMOOSH|SRS|TIL|UPPIN|VISIBLE|WILE|WTF\?|YA RLY|YR)(?=\s|,|$)/,
|
||||
lookbehind: true
|
||||
},
|
||||
/'Z(?=\s|,|$)/
|
||||
],
|
||||
boolean: {
|
||||
pattern: /(^|\s)(?:FAIL|WIN)(?=\s|,|$)/,
|
||||
lookbehind: true
|
||||
},
|
||||
variable: {
|
||||
pattern: /(^|\s)IT(?=\s|,|$)/,
|
||||
lookbehind: true
|
||||
},
|
||||
operator: {
|
||||
pattern:
|
||||
/(^|\s)(?:NOT|BOTH SAEM|DIFFRINT|(?:ALL|ANY|BIGGR|BOTH|DIFF|EITHER|MOD|PRODUKT|QUOSHUNT|SMALLR|SUM|WON) OF)(?=\s|,|$)/,
|
||||
lookbehind: true
|
||||
},
|
||||
punctuation: /\.{3}|…|,|!/
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/** @type {import('../core.js').Syntax} */
|
||||
declare function makefile(Prism: any): void;
|
||||
declare namespace makefile {
|
||||
let displayName: string;
|
||||
let aliases: any[];
|
||||
}
|
||||
export default makefile;
|
||||
+449
@@ -0,0 +1,449 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
import refractorMarkup from './markup.js'
|
||||
markdown.displayName = 'markdown'
|
||||
markdown.aliases = ['md']
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function markdown(Prism) {
|
||||
Prism.register(refractorMarkup)
|
||||
;(function (Prism) {
|
||||
// Allow only one line break
|
||||
var inner = /(?:\\.|[^\\\n\r]|(?:\n|\r\n?)(?![\r\n]))/.source
|
||||
|
||||
/**
|
||||
* This function is intended for the creation of the bold or italic pattern.
|
||||
*
|
||||
* This also adds a lookbehind group to the given pattern to ensure that the pattern is not backslash-escaped.
|
||||
*
|
||||
* _Note:_ Keep in mind that this adds a capturing group.
|
||||
*
|
||||
* @param {string} pattern
|
||||
* @returns {RegExp}
|
||||
*/
|
||||
function createInline(pattern) {
|
||||
pattern = pattern.replace(/<inner>/g, function () {
|
||||
return inner
|
||||
})
|
||||
return RegExp(/((?:^|[^\\])(?:\\{2})*)/.source + '(?:' + pattern + ')')
|
||||
}
|
||||
var tableCell = /(?:\\.|``(?:[^`\r\n]|`(?!`))+``|`[^`\r\n]+`|[^\\|\r\n`])+/
|
||||
.source
|
||||
var tableRow =
|
||||
/\|?__(?:\|__)+\|?(?:(?:\n|\r\n?)|(?![\s\S]))/.source.replace(
|
||||
/__/g,
|
||||
function () {
|
||||
return tableCell
|
||||
}
|
||||
)
|
||||
var tableLine =
|
||||
/\|?[ \t]*:?-{3,}:?[ \t]*(?:\|[ \t]*:?-{3,}:?[ \t]*)+\|?(?:\n|\r\n?)/
|
||||
.source
|
||||
Prism.languages.markdown = Prism.languages.extend('markup', {})
|
||||
Prism.languages.insertBefore('markdown', 'prolog', {
|
||||
'front-matter-block': {
|
||||
pattern: /(^(?:\s*[\r\n])?)---(?!.)[\s\S]*?[\r\n]---(?!.)/,
|
||||
lookbehind: true,
|
||||
greedy: true,
|
||||
inside: {
|
||||
punctuation: /^---|---$/,
|
||||
'front-matter': {
|
||||
pattern: /\S+(?:\s+\S+)*/,
|
||||
alias: ['yaml', 'language-yaml'],
|
||||
inside: Prism.languages.yaml
|
||||
}
|
||||
}
|
||||
},
|
||||
blockquote: {
|
||||
// > ...
|
||||
pattern: /^>(?:[\t ]*>)*/m,
|
||||
alias: 'punctuation'
|
||||
},
|
||||
table: {
|
||||
pattern: RegExp(
|
||||
'^' + tableRow + tableLine + '(?:' + tableRow + ')*',
|
||||
'm'
|
||||
),
|
||||
inside: {
|
||||
'table-data-rows': {
|
||||
pattern: RegExp(
|
||||
'^(' + tableRow + tableLine + ')(?:' + tableRow + ')*$'
|
||||
),
|
||||
lookbehind: true,
|
||||
inside: {
|
||||
'table-data': {
|
||||
pattern: RegExp(tableCell),
|
||||
inside: Prism.languages.markdown
|
||||
},
|
||||
punctuation: /\|/
|
||||
}
|
||||
},
|
||||
'table-line': {
|
||||
pattern: RegExp('^(' + tableRow + ')' + tableLine + '$'),
|
||||
lookbehind: true,
|
||||
inside: {
|
||||
punctuation: /\||:?-{3,}:?/
|
||||
}
|
||||
},
|
||||
'table-header-row': {
|
||||
pattern: RegExp('^' + tableRow + '$'),
|
||||
inside: {
|
||||
'table-header': {
|
||||
pattern: RegExp(tableCell),
|
||||
alias: 'important',
|
||||
inside: Prism.languages.markdown
|
||||
},
|
||||
punctuation: /\|/
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
code: [
|
||||
{
|
||||
// Prefixed by 4 spaces or 1 tab and preceded by an empty line
|
||||
pattern:
|
||||
/((?:^|\n)[ \t]*\n|(?:^|\r\n?)[ \t]*\r\n?)(?: {4}|\t).+(?:(?:\n|\r\n?)(?: {4}|\t).+)*/,
|
||||
lookbehind: true,
|
||||
alias: 'keyword'
|
||||
},
|
||||
{
|
||||
// ```optional language
|
||||
// code block
|
||||
// ```
|
||||
pattern: /^```[\s\S]*?^```$/m,
|
||||
greedy: true,
|
||||
inside: {
|
||||
'code-block': {
|
||||
pattern: /^(```.*(?:\n|\r\n?))[\s\S]+?(?=(?:\n|\r\n?)^```$)/m,
|
||||
lookbehind: true
|
||||
},
|
||||
'code-language': {
|
||||
pattern: /^(```).+/,
|
||||
lookbehind: true
|
||||
},
|
||||
punctuation: /```/
|
||||
}
|
||||
}
|
||||
],
|
||||
title: [
|
||||
{
|
||||
// title 1
|
||||
// =======
|
||||
|
||||
// title 2
|
||||
// -------
|
||||
pattern: /\S.*(?:\n|\r\n?)(?:==+|--+)(?=[ \t]*$)/m,
|
||||
alias: 'important',
|
||||
inside: {
|
||||
punctuation: /==+$|--+$/
|
||||
}
|
||||
},
|
||||
{
|
||||
// # title 1
|
||||
// ###### title 6
|
||||
pattern: /(^\s*)#.+/m,
|
||||
lookbehind: true,
|
||||
alias: 'important',
|
||||
inside: {
|
||||
punctuation: /^#+|#+$/
|
||||
}
|
||||
}
|
||||
],
|
||||
hr: {
|
||||
// ***
|
||||
// ---
|
||||
// * * *
|
||||
// -----------
|
||||
pattern: /(^\s*)([*-])(?:[\t ]*\2){2,}(?=\s*$)/m,
|
||||
lookbehind: true,
|
||||
alias: 'punctuation'
|
||||
},
|
||||
list: {
|
||||
// * item
|
||||
// + item
|
||||
// - item
|
||||
// 1. item
|
||||
pattern: /(^\s*)(?:[*+-]|\d+\.)(?=[\t ].)/m,
|
||||
lookbehind: true,
|
||||
alias: 'punctuation'
|
||||
},
|
||||
'url-reference': {
|
||||
// [id]: http://example.com "Optional title"
|
||||
// [id]: http://example.com 'Optional title'
|
||||
// [id]: http://example.com (Optional title)
|
||||
// [id]: <http://example.com> "Optional title"
|
||||
pattern:
|
||||
/!?\[[^\]]+\]:[\t ]+(?:\S+|<(?:\\.|[^>\\])+>)(?:[\t ]+(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\)))?/,
|
||||
inside: {
|
||||
variable: {
|
||||
pattern: /^(!?\[)[^\]]+/,
|
||||
lookbehind: true
|
||||
},
|
||||
string:
|
||||
/(?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\((?:\\.|[^)\\])*\))$/,
|
||||
punctuation: /^[\[\]!:]|[<>]/
|
||||
},
|
||||
alias: 'url'
|
||||
},
|
||||
bold: {
|
||||
// **strong**
|
||||
// __strong__
|
||||
|
||||
// allow one nested instance of italic text using the same delimiter
|
||||
pattern: createInline(
|
||||
/\b__(?:(?!_)<inner>|_(?:(?!_)<inner>)+_)+__\b|\*\*(?:(?!\*)<inner>|\*(?:(?!\*)<inner>)+\*)+\*\*/
|
||||
.source
|
||||
),
|
||||
lookbehind: true,
|
||||
greedy: true,
|
||||
inside: {
|
||||
content: {
|
||||
pattern: /(^..)[\s\S]+(?=..$)/,
|
||||
lookbehind: true,
|
||||
inside: {} // see below
|
||||
},
|
||||
punctuation: /\*\*|__/
|
||||
}
|
||||
},
|
||||
italic: {
|
||||
// *em*
|
||||
// _em_
|
||||
|
||||
// allow one nested instance of bold text using the same delimiter
|
||||
pattern: createInline(
|
||||
/\b_(?:(?!_)<inner>|__(?:(?!_)<inner>)+__)+_\b|\*(?:(?!\*)<inner>|\*\*(?:(?!\*)<inner>)+\*\*)+\*/
|
||||
.source
|
||||
),
|
||||
lookbehind: true,
|
||||
greedy: true,
|
||||
inside: {
|
||||
content: {
|
||||
pattern: /(^.)[\s\S]+(?=.$)/,
|
||||
lookbehind: true,
|
||||
inside: {} // see below
|
||||
},
|
||||
punctuation: /[*_]/
|
||||
}
|
||||
},
|
||||
strike: {
|
||||
// ~~strike through~~
|
||||
// ~strike~
|
||||
// eslint-disable-next-line regexp/strict
|
||||
pattern: createInline(/(~~?)(?:(?!~)<inner>)+\2/.source),
|
||||
lookbehind: true,
|
||||
greedy: true,
|
||||
inside: {
|
||||
content: {
|
||||
pattern: /(^~~?)[\s\S]+(?=\1$)/,
|
||||
lookbehind: true,
|
||||
inside: {} // see below
|
||||
},
|
||||
punctuation: /~~?/
|
||||
}
|
||||
},
|
||||
'code-snippet': {
|
||||
// `code`
|
||||
// ``code``
|
||||
pattern:
|
||||
/(^|[^\\`])(?:``[^`\r\n]+(?:`[^`\r\n]+)*``(?!`)|`[^`\r\n]+`(?!`))/,
|
||||
lookbehind: true,
|
||||
greedy: true,
|
||||
alias: ['code', 'keyword']
|
||||
},
|
||||
url: {
|
||||
// [example](http://example.com "Optional title")
|
||||
// [example][id]
|
||||
// [example] [id]
|
||||
pattern: createInline(
|
||||
/!?\[(?:(?!\])<inner>)+\](?:\([^\s)]+(?:[\t ]+"(?:\\.|[^"\\])*")?\)|[ \t]?\[(?:(?!\])<inner>)+\])/
|
||||
.source
|
||||
),
|
||||
lookbehind: true,
|
||||
greedy: true,
|
||||
inside: {
|
||||
operator: /^!/,
|
||||
content: {
|
||||
pattern: /(^\[)[^\]]+(?=\])/,
|
||||
lookbehind: true,
|
||||
inside: {} // see below
|
||||
},
|
||||
variable: {
|
||||
pattern: /(^\][ \t]?\[)[^\]]+(?=\]$)/,
|
||||
lookbehind: true
|
||||
},
|
||||
url: {
|
||||
pattern: /(^\]\()[^\s)]+/,
|
||||
lookbehind: true
|
||||
},
|
||||
string: {
|
||||
pattern: /(^[ \t]+)"(?:\\.|[^"\\])*"(?=\)$)/,
|
||||
lookbehind: true
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
;['url', 'bold', 'italic', 'strike'].forEach(function (token) {
|
||||
;['url', 'bold', 'italic', 'strike', 'code-snippet'].forEach(
|
||||
function (inside) {
|
||||
if (token !== inside) {
|
||||
Prism.languages.markdown[token].inside.content.inside[inside] =
|
||||
Prism.languages.markdown[inside]
|
||||
}
|
||||
}
|
||||
)
|
||||
})
|
||||
Prism.hooks.add('after-tokenize', function (env) {
|
||||
if (env.language !== 'markdown' && env.language !== 'md') {
|
||||
return
|
||||
}
|
||||
function walkTokens(tokens) {
|
||||
if (!tokens || typeof tokens === 'string') {
|
||||
return
|
||||
}
|
||||
for (var i = 0, l = tokens.length; i < l; i++) {
|
||||
var token = tokens[i]
|
||||
if (token.type !== 'code') {
|
||||
walkTokens(token.content)
|
||||
continue
|
||||
}
|
||||
|
||||
/*
|
||||
* Add the correct `language-xxxx` class to this code block. Keep in mind that the `code-language` token
|
||||
* is optional. But the grammar is defined so that there is only one case we have to handle:
|
||||
*
|
||||
* token.content = [
|
||||
* <span class="punctuation">```</span>,
|
||||
* <span class="code-language">xxxx</span>,
|
||||
* '\n', // exactly one new lines (\r or \n or \r\n)
|
||||
* <span class="code-block">...</span>,
|
||||
* '\n', // exactly one new lines again
|
||||
* <span class="punctuation">```</span>
|
||||
* ];
|
||||
*/
|
||||
|
||||
var codeLang = token.content[1]
|
||||
var codeBlock = token.content[3]
|
||||
if (
|
||||
codeLang &&
|
||||
codeBlock &&
|
||||
codeLang.type === 'code-language' &&
|
||||
codeBlock.type === 'code-block' &&
|
||||
typeof codeLang.content === 'string'
|
||||
) {
|
||||
// this might be a language that Prism does not support
|
||||
|
||||
// do some replacements to support C++, C#, and F#
|
||||
var lang = codeLang.content
|
||||
.replace(/\b#/g, 'sharp')
|
||||
.replace(/\b\+\+/g, 'pp')
|
||||
// only use the first word
|
||||
lang = (/[a-z][\w-]*/i.exec(lang) || [''])[0].toLowerCase()
|
||||
var alias = 'language-' + lang
|
||||
|
||||
// add alias
|
||||
if (!codeBlock.alias) {
|
||||
codeBlock.alias = [alias]
|
||||
} else if (typeof codeBlock.alias === 'string') {
|
||||
codeBlock.alias = [codeBlock.alias, alias]
|
||||
} else {
|
||||
codeBlock.alias.push(alias)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
walkTokens(env.tokens)
|
||||
})
|
||||
Prism.hooks.add('wrap', function (env) {
|
||||
if (env.type !== 'code-block') {
|
||||
return
|
||||
}
|
||||
var codeLang = ''
|
||||
for (var i = 0, l = env.classes.length; i < l; i++) {
|
||||
var cls = env.classes[i]
|
||||
var match = /language-(.+)/.exec(cls)
|
||||
if (match) {
|
||||
codeLang = match[1]
|
||||
break
|
||||
}
|
||||
}
|
||||
var grammar = Prism.languages[codeLang]
|
||||
if (!grammar) {
|
||||
if (codeLang && codeLang !== 'none' && Prism.plugins.autoloader) {
|
||||
var id =
|
||||
'md-' +
|
||||
new Date().valueOf() +
|
||||
'-' +
|
||||
Math.floor(Math.random() * 1e16)
|
||||
env.attributes['id'] = id
|
||||
Prism.plugins.autoloader.loadLanguages(codeLang, function () {
|
||||
var ele = document.getElementById(id)
|
||||
if (ele) {
|
||||
ele.innerHTML = Prism.highlight(
|
||||
ele.textContent,
|
||||
Prism.languages[codeLang],
|
||||
codeLang
|
||||
)
|
||||
}
|
||||
})
|
||||
}
|
||||
} else {
|
||||
env.content = Prism.highlight(env.content.value, grammar, codeLang)
|
||||
}
|
||||
})
|
||||
var tagPattern = RegExp(Prism.languages.markup.tag.pattern.source, 'gi')
|
||||
|
||||
/**
|
||||
* A list of known entity names.
|
||||
*
|
||||
* This will always be incomplete to save space. The current list is the one used by lowdash's unescape function.
|
||||
*
|
||||
* @see {@link https://github.com/lodash/lodash/blob/2da024c3b4f9947a48517639de7560457cd4ec6c/unescape.js#L2}
|
||||
*/
|
||||
var KNOWN_ENTITY_NAMES = {
|
||||
amp: '&',
|
||||
lt: '<',
|
||||
gt: '>',
|
||||
quot: '"'
|
||||
}
|
||||
|
||||
// IE 11 doesn't support `String.fromCodePoint`
|
||||
var fromCodePoint = String.fromCodePoint || String.fromCharCode
|
||||
|
||||
/**
|
||||
* Returns the text content of a given HTML source code string.
|
||||
*
|
||||
* @param {string} html
|
||||
* @returns {string}
|
||||
*/
|
||||
function textContent(html) {
|
||||
// remove all tags
|
||||
var text = html.replace(tagPattern, '')
|
||||
|
||||
// decode known entities
|
||||
text = text.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi, function (m, code) {
|
||||
code = code.toLowerCase()
|
||||
if (code[0] === '#') {
|
||||
var value
|
||||
if (code[1] === 'x') {
|
||||
value = parseInt(code.slice(2), 16)
|
||||
} else {
|
||||
value = Number(code.slice(1))
|
||||
}
|
||||
return fromCodePoint(value)
|
||||
} else {
|
||||
var known = KNOWN_ENTITY_NAMES[code]
|
||||
if (known) {
|
||||
return known
|
||||
}
|
||||
|
||||
// unable to decode
|
||||
return m
|
||||
}
|
||||
})
|
||||
return text
|
||||
}
|
||||
Prism.languages.md = Prism.languages.markdown
|
||||
})(Prism)
|
||||
}
|
||||
+98
@@ -0,0 +1,98 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
maxscript.displayName = 'maxscript'
|
||||
maxscript.aliases = []
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function maxscript(Prism) {
|
||||
;(function (Prism) {
|
||||
var keywords =
|
||||
/\b(?:about|and|animate|as|at|attributes|by|case|catch|collect|continue|coordsys|do|else|exit|fn|for|from|function|global|if|in|local|macroscript|mapped|max|not|of|off|on|or|parameters|persistent|plugin|rcmenu|return|rollout|set|struct|then|throw|to|tool|try|undo|utility|when|where|while|with)\b/i
|
||||
Prism.languages.maxscript = {
|
||||
comment: {
|
||||
pattern: /\/\*[\s\S]*?(?:\*\/|$)|--.*/,
|
||||
greedy: true
|
||||
},
|
||||
string: {
|
||||
pattern: /(^|[^"\\@])(?:"(?:[^"\\]|\\[\s\S])*"|@"[^"]*")/,
|
||||
lookbehind: true,
|
||||
greedy: true
|
||||
},
|
||||
path: {
|
||||
pattern: /\$(?:[\w/\\.*?]|'[^']*')*/,
|
||||
greedy: true,
|
||||
alias: 'string'
|
||||
},
|
||||
'function-call': {
|
||||
pattern: RegExp(
|
||||
'((?:' +
|
||||
// start of line
|
||||
(/^/.source +
|
||||
'|' +
|
||||
// operators and other language constructs
|
||||
/[;=<>+\-*/^({\[]/.source +
|
||||
'|' +
|
||||
// keywords as part of statements
|
||||
/\b(?:and|by|case|catch|collect|do|else|if|in|not|or|return|then|to|try|where|while|with)\b/
|
||||
.source) +
|
||||
')[ \t]*)' +
|
||||
'(?!' +
|
||||
keywords.source +
|
||||
')' +
|
||||
/[a-z_]\w*\b/.source +
|
||||
'(?=[ \t]*(?:' +
|
||||
// variable
|
||||
('(?!' +
|
||||
keywords.source +
|
||||
')' +
|
||||
/[a-z_]/.source +
|
||||
'|' +
|
||||
// number
|
||||
/\d|-\.?\d/.source +
|
||||
'|' +
|
||||
// other expressions or literals
|
||||
/[({'"$@#?]/.source) +
|
||||
'))',
|
||||
'im'
|
||||
),
|
||||
lookbehind: true,
|
||||
greedy: true,
|
||||
alias: 'function'
|
||||
},
|
||||
'function-definition': {
|
||||
pattern: /(\b(?:fn|function)\s+)\w+\b/i,
|
||||
lookbehind: true,
|
||||
alias: 'function'
|
||||
},
|
||||
argument: {
|
||||
pattern: /\b[a-z_]\w*(?=:)/i,
|
||||
alias: 'attr-name'
|
||||
},
|
||||
keyword: keywords,
|
||||
boolean: /\b(?:false|true)\b/,
|
||||
time: {
|
||||
pattern:
|
||||
/(^|[^\w.])(?:(?:(?:\d+(?:\.\d*)?|\.\d+)(?:[eEdD][+-]\d+|[LP])?[msft])+|\d+:\d+(?:\.\d*)?)(?![\w.:])/,
|
||||
lookbehind: true,
|
||||
alias: 'number'
|
||||
},
|
||||
number: [
|
||||
{
|
||||
pattern:
|
||||
/(^|[^\w.])(?:(?:\d+(?:\.\d*)?|\.\d+)(?:[eEdD][+-]\d+|[LP])?|0x[a-fA-F0-9]+)(?![\w.:])/,
|
||||
lookbehind: true
|
||||
},
|
||||
/\b(?:e|pi)\b/
|
||||
],
|
||||
constant: /\b(?:dontcollect|ok|silentValue|undefined|unsupplied)\b/,
|
||||
color: {
|
||||
pattern: /\b(?:black|blue|brown|gray|green|orange|red|white|yellow)\b/i,
|
||||
alias: 'constant'
|
||||
},
|
||||
operator: /[-+*/<>=!]=?|[&^?]|#(?!\()/,
|
||||
punctuation: /[()\[\]{}.:,;]|#(?=\()|\\$/m
|
||||
}
|
||||
})(Prism)
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/** @type {import('../core.js').Syntax} */
|
||||
declare function mel(Prism: any): void;
|
||||
declare namespace mel {
|
||||
let displayName: string;
|
||||
let aliases: any[];
|
||||
}
|
||||
export default mel;
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
mel.displayName = 'mel'
|
||||
mel.aliases = []
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function mel(Prism) {
|
||||
Prism.languages.mel = {
|
||||
comment: {
|
||||
pattern: /\/\/.*|\/\*[\s\S]*?\*\//,
|
||||
greedy: true
|
||||
},
|
||||
code: {
|
||||
pattern: /`(?:\\.|[^\\`])*`/,
|
||||
greedy: true,
|
||||
alias: 'italic',
|
||||
inside: {
|
||||
delimiter: {
|
||||
pattern: /^`|`$/,
|
||||
alias: 'punctuation'
|
||||
},
|
||||
statement: {
|
||||
pattern: /[\s\S]+/,
|
||||
inside: null // see below
|
||||
}
|
||||
}
|
||||
},
|
||||
string: {
|
||||
pattern: /"(?:\\.|[^\\"\r\n])*"/,
|
||||
greedy: true
|
||||
},
|
||||
variable: /\$\w+/,
|
||||
number: /\b0x[\da-fA-F]+\b|\b\d+(?:\.\d*)?|\B\.\d+/,
|
||||
flag: {
|
||||
pattern: /-[^\d\W]\w*/,
|
||||
alias: 'operator'
|
||||
},
|
||||
keyword:
|
||||
/\b(?:break|case|continue|default|do|else|float|for|global|if|in|int|matrix|proc|return|string|switch|vector|while)\b/,
|
||||
function: {
|
||||
pattern:
|
||||
/((?:^|[{;])[ \t]*)[a-z_]\w*\b(?!\s*(?:\.(?!\.)|[[{=]))|\b[a-z_]\w*(?=[ \t]*\()/im,
|
||||
lookbehind: true,
|
||||
greedy: true
|
||||
},
|
||||
'tensor-punctuation': {
|
||||
pattern: /<<|>>/,
|
||||
alias: 'punctuation'
|
||||
},
|
||||
operator: /\+[+=]?|-[-=]?|&&|\|\||[<>]=?|[*\/!=]=?|[%^]/,
|
||||
punctuation: /[.,:;?\[\](){}]/
|
||||
}
|
||||
Prism.languages.mel['code'].inside['statement'].inside = Prism.languages.mel
|
||||
}
|
||||
+122
@@ -0,0 +1,122 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
mermaid.displayName = 'mermaid'
|
||||
mermaid.aliases = []
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function mermaid(Prism) {
|
||||
Prism.languages.mermaid = {
|
||||
comment: {
|
||||
pattern: /%%.*/,
|
||||
greedy: true
|
||||
},
|
||||
style: {
|
||||
pattern:
|
||||
/^([ \t]*(?:classDef|linkStyle|style)[ \t]+[\w$-]+[ \t]+)\w.*[^\s;]/m,
|
||||
lookbehind: true,
|
||||
inside: {
|
||||
property: /\b\w[\w-]*(?=[ \t]*:)/,
|
||||
operator: /:/,
|
||||
punctuation: /,/
|
||||
}
|
||||
},
|
||||
'inter-arrow-label': {
|
||||
pattern:
|
||||
/([^<>ox.=-])(?:-[-.]|==)(?![<>ox.=-])[ \t]*(?:"[^"\r\n]*"|[^\s".=-](?:[^\r\n.=-]*[^\s.=-])?)[ \t]*(?:\.+->?|--+[->]|==+[=>])(?![<>ox.=-])/,
|
||||
lookbehind: true,
|
||||
greedy: true,
|
||||
inside: {
|
||||
arrow: {
|
||||
pattern: /(?:\.+->?|--+[->]|==+[=>])$/,
|
||||
alias: 'operator'
|
||||
},
|
||||
label: {
|
||||
pattern: /^([\s\S]{2}[ \t]*)\S(?:[\s\S]*\S)?/,
|
||||
lookbehind: true,
|
||||
alias: 'property'
|
||||
},
|
||||
'arrow-head': {
|
||||
pattern: /^\S+/,
|
||||
alias: ['arrow', 'operator']
|
||||
}
|
||||
}
|
||||
},
|
||||
arrow: [
|
||||
// This might look complex but it really isn't.
|
||||
// There are many possible arrows (see tests) and it's impossible to fit all of them into one pattern. The
|
||||
// problem is that we only have one lookbehind per pattern. However, we cannot disallow too many arrow
|
||||
// characters in the one lookbehind because that would create too many false negatives. So we have to split the
|
||||
// arrows into different patterns.
|
||||
{
|
||||
// ER diagram
|
||||
pattern: /(^|[^{}|o.-])[|}][|o](?:--|\.\.)[|o][|{](?![{}|o.-])/,
|
||||
lookbehind: true,
|
||||
alias: 'operator'
|
||||
},
|
||||
{
|
||||
// flow chart
|
||||
// (?:==+|--+|-\.*-)
|
||||
pattern:
|
||||
/(^|[^<>ox.=-])(?:[<ox](?:==+|--+|-\.*-)[>ox]?|(?:==+|--+|-\.*-)[>ox]|===+|---+|-\.+-)(?![<>ox.=-])/,
|
||||
lookbehind: true,
|
||||
alias: 'operator'
|
||||
},
|
||||
{
|
||||
// sequence diagram
|
||||
pattern:
|
||||
/(^|[^<>()x-])(?:--?(?:>>|[x>)])(?![<>()x])|(?:<<|[x<(])--?(?!-))/,
|
||||
lookbehind: true,
|
||||
alias: 'operator'
|
||||
},
|
||||
{
|
||||
// class diagram
|
||||
pattern:
|
||||
/(^|[^<>|*o.-])(?:[*o]--|--[*o]|<\|?(?:--|\.\.)|(?:--|\.\.)\|?>|--|\.\.)(?![<>|*o.-])/,
|
||||
lookbehind: true,
|
||||
alias: 'operator'
|
||||
}
|
||||
],
|
||||
label: {
|
||||
pattern: /(^|[^|<])\|(?:[^\r\n"|]|"[^"\r\n]*")+\|/,
|
||||
lookbehind: true,
|
||||
greedy: true,
|
||||
alias: 'property'
|
||||
},
|
||||
text: {
|
||||
pattern: /(?:[(\[{]+|\b>)(?:[^\r\n"()\[\]{}]|"[^"\r\n]*")+(?:[)\]}]+|>)/,
|
||||
alias: 'string'
|
||||
},
|
||||
string: {
|
||||
pattern: /"[^"\r\n]*"/,
|
||||
greedy: true
|
||||
},
|
||||
annotation: {
|
||||
pattern:
|
||||
/<<(?:abstract|choice|enumeration|fork|interface|join|service)>>|\[\[(?:choice|fork|join)\]\]/i,
|
||||
alias: 'important'
|
||||
},
|
||||
keyword: [
|
||||
// This language has both case-sensitive and case-insensitive keywords
|
||||
{
|
||||
pattern:
|
||||
/(^[ \t]*)(?:action|callback|class|classDef|classDiagram|click|direction|erDiagram|flowchart|gantt|gitGraph|graph|journey|link|linkStyle|pie|requirementDiagram|sequenceDiagram|stateDiagram|stateDiagram-v2|style|subgraph)(?![\w$-])/m,
|
||||
lookbehind: true,
|
||||
greedy: true
|
||||
},
|
||||
{
|
||||
pattern:
|
||||
/(^[ \t]*)(?:activate|alt|and|as|autonumber|deactivate|else|end(?:[ \t]+note)?|loop|opt|par|participant|rect|state|note[ \t]+(?:over|(?:left|right)[ \t]+of))(?![\w$-])/im,
|
||||
lookbehind: true,
|
||||
greedy: true
|
||||
}
|
||||
],
|
||||
entity: /#[a-z0-9]+;/,
|
||||
operator: {
|
||||
pattern: /(\w[ \t]*)&(?=[ \t]*\w)|:::|:/,
|
||||
lookbehind: true
|
||||
},
|
||||
punctuation: /[(){};]/
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/** @type {import('../core.js').Syntax} */
|
||||
declare function metafont(Prism: any): void;
|
||||
declare namespace metafont {
|
||||
let displayName: string;
|
||||
let aliases: any[];
|
||||
}
|
||||
export default metafont;
|
||||
+102
@@ -0,0 +1,102 @@
|
||||
// @ts-nocheck
|
||||
/**
|
||||
* @import {Refractor} from '../lib/core.js'
|
||||
*/
|
||||
metafont.displayName = 'metafont'
|
||||
metafont.aliases = []
|
||||
|
||||
/** @param {Refractor} Prism */
|
||||
export default function metafont(Prism) {
|
||||
Prism.languages.metafont = {
|
||||
// Syntax of METAFONT with the added (public) elements of PlainMETAFONT. Except for internal quantities they are expected to be rarely redefined. Freely inspired by the syntax of Christophe Grandsire for the Crimson Editor.
|
||||
comment: {
|
||||
pattern: /%.*/,
|
||||
greedy: true
|
||||
},
|
||||
string: {
|
||||
pattern: /"[^\r\n"]*"/,
|
||||
greedy: true
|
||||
},
|
||||
number: /\d*\.?\d+/,
|
||||
boolean: /\b(?:false|true)\b/,
|
||||
punctuation: [
|
||||
/[,;()]/,
|
||||
{
|
||||
pattern: /(^|[^{}])(?:\{|\})(?![{}])/,
|
||||
lookbehind: true
|
||||
},
|
||||
{
|
||||
pattern: /(^|[^[])\[(?!\[)/,
|
||||
lookbehind: true
|
||||
},
|
||||
{
|
||||
pattern: /(^|[^\]])\](?!\])/,
|
||||
lookbehind: true
|
||||
}
|
||||
],
|
||||
constant: [
|
||||
{
|
||||
pattern: /(^|[^!?])\?\?\?(?![!?])/,
|
||||
lookbehind: true
|
||||
},
|
||||
{
|
||||
pattern: /(^|[^/*\\])(?:\\|\\\\)(?![/*\\])/,
|
||||
lookbehind: true
|
||||
},
|
||||
/\b(?:_|blankpicture|bp|cc|cm|dd|ditto|down|eps|epsilon|fullcircle|halfcircle|identity|in|infinity|left|mm|nullpen|nullpicture|origin|pc|penrazor|penspeck|pensquare|penstroke|proof|pt|quartercircle|relax|right|smoke|unitpixel|unitsquare|up)\b/
|
||||
],
|
||||
quantity: {
|
||||
pattern:
|
||||
/\b(?:autorounding|blacker|boundarychar|charcode|chardp|chardx|chardy|charext|charht|charic|charwd|currentwindow|day|designsize|displaying|fillin|fontmaking|granularity|hppp|join_radius|month|o_correction|pausing|pen_(?:bot|lft|rt|top)|pixels_per_inch|proofing|showstopping|smoothing|time|tolerance|tracingcapsules|tracingchoices|tracingcommands|tracingedges|tracingequations|tracingmacros|tracingonline|tracingoutput|tracingpens|tracingrestores|tracingspecs|tracingstats|tracingtitles|turningcheck|vppp|warningcheck|xoffset|year|yoffset)\b/,
|
||||
alias: 'keyword'
|
||||
},
|
||||
command: {
|
||||
pattern:
|
||||
/\b(?:addto|batchmode|charlist|cull|display|errhelp|errmessage|errorstopmode|everyjob|extensible|fontdimen|headerbyte|inner|interim|let|ligtable|message|newinternal|nonstopmode|numspecial|openwindow|outer|randomseed|save|scrollmode|shipout|show|showdependencies|showstats|showtoken|showvariable|special)\b/,
|
||||
alias: 'builtin'
|
||||
},
|
||||
operator: [
|
||||
{
|
||||
pattern:
|
||||
/(^|[^>=<:|])(?:<|<=|=|=:|\|=:|\|=:>|=:\|>|=:\||\|=:\||\|=:\|>|\|=:\|>>|>|>=|:|:=|<>|::|\|\|:)(?![>=<:|])/,
|
||||
lookbehind: true
|
||||
},
|
||||
{
|
||||
pattern: /(^|[^+-])(?:\+|\+\+|-{1,3}|\+-\+)(?![+-])/,
|
||||
lookbehind: true
|
||||
},
|
||||
{
|
||||
pattern: /(^|[^/*\\])(?:\*|\*\*|\/)(?![/*\\])/,
|
||||
lookbehind: true
|
||||
},
|
||||
{
|
||||
pattern: /(^|[^.])(?:\.{2,3})(?!\.)/,
|
||||
lookbehind: true
|
||||
},
|
||||
{
|
||||
pattern: /(^|[^@#&$])&(?![@#&$])/,
|
||||
lookbehind: true
|
||||
},
|
||||
/\b(?:and|not|or)\b/
|
||||
],
|
||||
macro: {
|
||||
pattern:
|
||||
/\b(?:abs|beginchar|bot|byte|capsule_def|ceiling|change_width|clear_pen_memory|clearit|clearpen|clearxy|counterclockwise|cullit|cutdraw|cutoff|decr|define_blacker_pixels|define_corrected_pixels|define_good_x_pixels|define_good_y_pixels|define_horizontal_corrected_pixels|define_pixels|define_whole_blacker_pixels|define_whole_pixels|define_whole_vertical_blacker_pixels|define_whole_vertical_pixels|dir|direction|directionpoint|div|dotprod|downto|draw|drawdot|endchar|erase|fill|filldraw|fix_units|flex|font_coding_scheme|font_extra_space|font_identifier|font_normal_shrink|font_normal_space|font_normal_stretch|font_quad|font_size|font_slant|font_x_height|gfcorners|gobble|gobbled|good\.(?:bot|lft|rt|top|x|y)|grayfont|hide|hround|imagerules|incr|interact|interpath|intersectionpoint|inverse|italcorr|killtext|labelfont|labels|lft|loggingall|lowres_fix|makegrid|makelabel(?:\.(?:bot|lft|rt|top)(?:\.nodot)?)?|max|min|mod|mode_def|mode_setup|nodisplays|notransforms|numtok|openit|penlabels|penpos|pickup|proofoffset|proofrule|proofrulethickness|range|reflectedabout|rotatedabout|rotatedaround|round|rt|savepen|screenchars|screenrule|screenstrokes|shipit|showit|slantfont|softjoin|solve|stop|superellipse|tensepath|thru|titlefont|top|tracingall|tracingnone|undraw|undrawdot|unfill|unfilldraw|upto|vround)\b/,
|
||||
alias: 'function'
|
||||
},
|
||||
builtin:
|
||||
/\b(?:ASCII|angle|char|cosd|decimal|directiontime|floor|hex|intersectiontimes|jobname|known|length|makepath|makepen|mexp|mlog|normaldeviate|oct|odd|pencircle|penoffset|point|postcontrol|precontrol|reverse|rotated|sind|sqrt|str|subpath|substring|totalweight|turningnumber|uniformdeviate|unknown|xpart|xxpart|xypart|ypart|yxpart|yypart)\b/,
|
||||
keyword:
|
||||
/\b(?:also|at|atleast|begingroup|charexists|contour|controls|curl|cycle|def|delimiters|doublepath|dropping|dump|else|elseif|end|enddef|endfor|endgroup|endinput|exitif|exitunless|expandafter|fi|for|forever|forsuffixes|from|if|input|inwindow|keeping|kern|of|primarydef|quote|readstring|scaled|scantokens|secondarydef|shifted|skipto|slanted|step|tension|tertiarydef|to|transformed|until|vardef|withpen|withweight|xscaled|yscaled|zscaled)\b/,
|
||||
type: {
|
||||
pattern:
|
||||
/\b(?:boolean|expr|numeric|pair|path|pen|picture|primary|secondary|string|suffix|tertiary|text|transform)\b/,
|
||||
alias: 'property'
|
||||
},
|
||||
variable: {
|
||||
pattern:
|
||||
/(^|[^@#&$])(?:@#|#@|#|@)(?![@#&$])|\b(?:aspect_ratio|currentpen|currentpicture|currenttransform|d|extra_beginchar|extra_endchar|extra_setup|h|localfont|mag|mode|screen_cols|screen_rows|w|whatever|x|y|z)\b/,
|
||||
lookbehind: true
|
||||
}
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
/** @type {import('../core.js').Syntax} */
|
||||
declare function mizar(Prism: any): void;
|
||||
declare namespace mizar {
|
||||
let displayName: string;
|
||||
let aliases: any[];
|
||||
}
|
||||
export default mizar;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user