mirror of https://github.com/abpframework/abp.git
705 changed files with 36762 additions and 1 deletions
@ -0,0 +1,890 @@ |
|||
/*! |
|||
* clipboard.js v2.0.11 |
|||
* https://clipboardjs.com/
|
|||
* |
|||
* Licensed MIT © Zeno Rocha |
|||
*/ |
|||
(function webpackUniversalModuleDefinition(root, factory) { |
|||
if(typeof exports === 'object' && typeof module === 'object') |
|||
module.exports = factory(); |
|||
else if(typeof define === 'function' && define.amd) |
|||
define([], factory); |
|||
else if(typeof exports === 'object') |
|||
exports["ClipboardJS"] = factory(); |
|||
else |
|||
root["ClipboardJS"] = factory(); |
|||
})(this, function() { |
|||
return /******/ (function() { // webpackBootstrap
|
|||
/******/ var __webpack_modules__ = ({ |
|||
|
|||
/***/ 686: |
|||
/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) { |
|||
|
|||
"use strict"; |
|||
|
|||
// EXPORTS
|
|||
__webpack_require__.d(__webpack_exports__, { |
|||
"default": function() { return /* binding */ clipboard; } |
|||
}); |
|||
|
|||
// EXTERNAL MODULE: ./node_modules/tiny-emitter/index.js
|
|||
var tiny_emitter = __webpack_require__(279); |
|||
var tiny_emitter_default = /*#__PURE__*/__webpack_require__.n(tiny_emitter); |
|||
// EXTERNAL MODULE: ./node_modules/good-listener/src/listen.js
|
|||
var listen = __webpack_require__(370); |
|||
var listen_default = /*#__PURE__*/__webpack_require__.n(listen); |
|||
// EXTERNAL MODULE: ./node_modules/select/src/select.js
|
|||
var src_select = __webpack_require__(817); |
|||
var select_default = /*#__PURE__*/__webpack_require__.n(src_select); |
|||
;// CONCATENATED MODULE: ./src/common/command.js
|
|||
/** |
|||
* Executes a given operation type. |
|||
* @param {String} type |
|||
* @return {Boolean} |
|||
*/ |
|||
function command(type) { |
|||
try { |
|||
return document.execCommand(type); |
|||
} catch (err) { |
|||
return false; |
|||
} |
|||
} |
|||
;// CONCATENATED MODULE: ./src/actions/cut.js
|
|||
|
|||
|
|||
/** |
|||
* Cut action wrapper. |
|||
* @param {String|HTMLElement} target |
|||
* @return {String} |
|||
*/ |
|||
|
|||
var ClipboardActionCut = function ClipboardActionCut(target) { |
|||
var selectedText = select_default()(target); |
|||
command('cut'); |
|||
return selectedText; |
|||
}; |
|||
|
|||
/* harmony default export */ var actions_cut = (ClipboardActionCut); |
|||
;// CONCATENATED MODULE: ./src/common/create-fake-element.js
|
|||
/** |
|||
* Creates a fake textarea element with a value. |
|||
* @param {String} value |
|||
* @return {HTMLElement} |
|||
*/ |
|||
function createFakeElement(value) { |
|||
var isRTL = document.documentElement.getAttribute('dir') === 'rtl'; |
|||
var fakeElement = document.createElement('textarea'); // Prevent zooming on iOS
|
|||
|
|||
fakeElement.style.fontSize = '12pt'; // Reset box model
|
|||
|
|||
fakeElement.style.border = '0'; |
|||
fakeElement.style.padding = '0'; |
|||
fakeElement.style.margin = '0'; // Move element out of screen horizontally
|
|||
|
|||
fakeElement.style.position = 'absolute'; |
|||
fakeElement.style[isRTL ? 'right' : 'left'] = '-9999px'; // Move element to the same position vertically
|
|||
|
|||
var yPosition = window.pageYOffset || document.documentElement.scrollTop; |
|||
fakeElement.style.top = "".concat(yPosition, "px"); |
|||
fakeElement.setAttribute('readonly', ''); |
|||
fakeElement.value = value; |
|||
return fakeElement; |
|||
} |
|||
;// CONCATENATED MODULE: ./src/actions/copy.js
|
|||
|
|||
|
|||
|
|||
/** |
|||
* Create fake copy action wrapper using a fake element. |
|||
* @param {String} target |
|||
* @param {Object} options |
|||
* @return {String} |
|||
*/ |
|||
|
|||
var fakeCopyAction = function fakeCopyAction(value, options) { |
|||
var fakeElement = createFakeElement(value); |
|||
options.container.appendChild(fakeElement); |
|||
var selectedText = select_default()(fakeElement); |
|||
command('copy'); |
|||
fakeElement.remove(); |
|||
return selectedText; |
|||
}; |
|||
/** |
|||
* Copy action wrapper. |
|||
* @param {String|HTMLElement} target |
|||
* @param {Object} options |
|||
* @return {String} |
|||
*/ |
|||
|
|||
|
|||
var ClipboardActionCopy = function ClipboardActionCopy(target) { |
|||
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { |
|||
container: document.body |
|||
}; |
|||
var selectedText = ''; |
|||
|
|||
if (typeof target === 'string') { |
|||
selectedText = fakeCopyAction(target, options); |
|||
} else if (target instanceof HTMLInputElement && !['text', 'search', 'url', 'tel', 'password'].includes(target === null || target === void 0 ? void 0 : target.type)) { |
|||
// If input type doesn't support `setSelectionRange`. Simulate it. https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setSelectionRange
|
|||
selectedText = fakeCopyAction(target.value, options); |
|||
} else { |
|||
selectedText = select_default()(target); |
|||
command('copy'); |
|||
} |
|||
|
|||
return selectedText; |
|||
}; |
|||
|
|||
/* harmony default export */ var actions_copy = (ClipboardActionCopy); |
|||
;// CONCATENATED MODULE: ./src/actions/default.js
|
|||
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); } |
|||
|
|||
|
|||
|
|||
/** |
|||
* Inner function which performs selection from either `text` or `target` |
|||
* properties and then executes copy or cut operations. |
|||
* @param {Object} options |
|||
*/ |
|||
|
|||
var ClipboardActionDefault = function ClipboardActionDefault() { |
|||
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; |
|||
// Defines base properties passed from constructor.
|
|||
var _options$action = options.action, |
|||
action = _options$action === void 0 ? 'copy' : _options$action, |
|||
container = options.container, |
|||
target = options.target, |
|||
text = options.text; // Sets the `action` to be performed which can be either 'copy' or 'cut'.
|
|||
|
|||
if (action !== 'copy' && action !== 'cut') { |
|||
throw new Error('Invalid "action" value, use either "copy" or "cut"'); |
|||
} // Sets the `target` property using an element that will be have its content copied.
|
|||
|
|||
|
|||
if (target !== undefined) { |
|||
if (target && _typeof(target) === 'object' && target.nodeType === 1) { |
|||
if (action === 'copy' && target.hasAttribute('disabled')) { |
|||
throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute'); |
|||
} |
|||
|
|||
if (action === 'cut' && (target.hasAttribute('readonly') || target.hasAttribute('disabled'))) { |
|||
throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes'); |
|||
} |
|||
} else { |
|||
throw new Error('Invalid "target" value, use a valid Element'); |
|||
} |
|||
} // Define selection strategy based on `text` property.
|
|||
|
|||
|
|||
if (text) { |
|||
return actions_copy(text, { |
|||
container: container |
|||
}); |
|||
} // Defines which selection strategy based on `target` property.
|
|||
|
|||
|
|||
if (target) { |
|||
return action === 'cut' ? actions_cut(target) : actions_copy(target, { |
|||
container: container |
|||
}); |
|||
} |
|||
}; |
|||
|
|||
/* harmony default export */ var actions_default = (ClipboardActionDefault); |
|||
;// CONCATENATED MODULE: ./src/clipboard.js
|
|||
function clipboard_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { clipboard_typeof = function _typeof(obj) { return typeof obj; }; } else { clipboard_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return clipboard_typeof(obj); } |
|||
|
|||
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } |
|||
|
|||
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } |
|||
|
|||
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; } |
|||
|
|||
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); } |
|||
|
|||
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); } |
|||
|
|||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; } |
|||
|
|||
function _possibleConstructorReturn(self, call) { if (call && (clipboard_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); } |
|||
|
|||
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; } |
|||
|
|||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } |
|||
|
|||
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); } |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
/** |
|||
* Helper function to retrieve attribute value. |
|||
* @param {String} suffix |
|||
* @param {Element} element |
|||
*/ |
|||
|
|||
function getAttributeValue(suffix, element) { |
|||
var attribute = "data-clipboard-".concat(suffix); |
|||
|
|||
if (!element.hasAttribute(attribute)) { |
|||
return; |
|||
} |
|||
|
|||
return element.getAttribute(attribute); |
|||
} |
|||
/** |
|||
* Base class which takes one or more elements, adds event listeners to them, |
|||
* and instantiates a new `ClipboardAction` on each click. |
|||
*/ |
|||
|
|||
|
|||
var Clipboard = /*#__PURE__*/function (_Emitter) { |
|||
_inherits(Clipboard, _Emitter); |
|||
|
|||
var _super = _createSuper(Clipboard); |
|||
|
|||
/** |
|||
* @param {String|HTMLElement|HTMLCollection|NodeList} trigger |
|||
* @param {Object} options |
|||
*/ |
|||
function Clipboard(trigger, options) { |
|||
var _this; |
|||
|
|||
_classCallCheck(this, Clipboard); |
|||
|
|||
_this = _super.call(this); |
|||
|
|||
_this.resolveOptions(options); |
|||
|
|||
_this.listenClick(trigger); |
|||
|
|||
return _this; |
|||
} |
|||
/** |
|||
* Defines if attributes would be resolved using internal setter functions |
|||
* or custom functions that were passed in the constructor. |
|||
* @param {Object} options |
|||
*/ |
|||
|
|||
|
|||
_createClass(Clipboard, [{ |
|||
key: "resolveOptions", |
|||
value: function resolveOptions() { |
|||
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {}; |
|||
this.action = typeof options.action === 'function' ? options.action : this.defaultAction; |
|||
this.target = typeof options.target === 'function' ? options.target : this.defaultTarget; |
|||
this.text = typeof options.text === 'function' ? options.text : this.defaultText; |
|||
this.container = clipboard_typeof(options.container) === 'object' ? options.container : document.body; |
|||
} |
|||
/** |
|||
* Adds a click event listener to the passed trigger. |
|||
* @param {String|HTMLElement|HTMLCollection|NodeList} trigger |
|||
*/ |
|||
|
|||
}, { |
|||
key: "listenClick", |
|||
value: function listenClick(trigger) { |
|||
var _this2 = this; |
|||
|
|||
this.listener = listen_default()(trigger, 'click', function (e) { |
|||
return _this2.onClick(e); |
|||
}); |
|||
} |
|||
/** |
|||
* Defines a new `ClipboardAction` on each click event. |
|||
* @param {Event} e |
|||
*/ |
|||
|
|||
}, { |
|||
key: "onClick", |
|||
value: function onClick(e) { |
|||
var trigger = e.delegateTarget || e.currentTarget; |
|||
var action = this.action(trigger) || 'copy'; |
|||
var text = actions_default({ |
|||
action: action, |
|||
container: this.container, |
|||
target: this.target(trigger), |
|||
text: this.text(trigger) |
|||
}); // Fires an event based on the copy operation result.
|
|||
|
|||
this.emit(text ? 'success' : 'error', { |
|||
action: action, |
|||
text: text, |
|||
trigger: trigger, |
|||
clearSelection: function clearSelection() { |
|||
if (trigger) { |
|||
trigger.focus(); |
|||
} |
|||
|
|||
window.getSelection().removeAllRanges(); |
|||
} |
|||
}); |
|||
} |
|||
/** |
|||
* Default `action` lookup function. |
|||
* @param {Element} trigger |
|||
*/ |
|||
|
|||
}, { |
|||
key: "defaultAction", |
|||
value: function defaultAction(trigger) { |
|||
return getAttributeValue('action', trigger); |
|||
} |
|||
/** |
|||
* Default `target` lookup function. |
|||
* @param {Element} trigger |
|||
*/ |
|||
|
|||
}, { |
|||
key: "defaultTarget", |
|||
value: function defaultTarget(trigger) { |
|||
var selector = getAttributeValue('target', trigger); |
|||
|
|||
if (selector) { |
|||
return document.querySelector(selector); |
|||
} |
|||
} |
|||
/** |
|||
* Allow fire programmatically a copy action |
|||
* @param {String|HTMLElement} target |
|||
* @param {Object} options |
|||
* @returns Text copied. |
|||
*/ |
|||
|
|||
}, { |
|||
key: "defaultText", |
|||
|
|||
/** |
|||
* Default `text` lookup function. |
|||
* @param {Element} trigger |
|||
*/ |
|||
value: function defaultText(trigger) { |
|||
return getAttributeValue('text', trigger); |
|||
} |
|||
/** |
|||
* Destroy lifecycle. |
|||
*/ |
|||
|
|||
}, { |
|||
key: "destroy", |
|||
value: function destroy() { |
|||
this.listener.destroy(); |
|||
} |
|||
}], [{ |
|||
key: "copy", |
|||
value: function copy(target) { |
|||
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : { |
|||
container: document.body |
|||
}; |
|||
return actions_copy(target, options); |
|||
} |
|||
/** |
|||
* Allow fire programmatically a cut action |
|||
* @param {String|HTMLElement} target |
|||
* @returns Text cutted. |
|||
*/ |
|||
|
|||
}, { |
|||
key: "cut", |
|||
value: function cut(target) { |
|||
return actions_cut(target); |
|||
} |
|||
/** |
|||
* Returns the support of the given action, or all actions if no action is |
|||
* given. |
|||
* @param {String} [action] |
|||
*/ |
|||
|
|||
}, { |
|||
key: "isSupported", |
|||
value: function isSupported() { |
|||
var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['copy', 'cut']; |
|||
var actions = typeof action === 'string' ? [action] : action; |
|||
var support = !!document.queryCommandSupported; |
|||
actions.forEach(function (action) { |
|||
support = support && !!document.queryCommandSupported(action); |
|||
}); |
|||
return support; |
|||
} |
|||
}]); |
|||
|
|||
return Clipboard; |
|||
}((tiny_emitter_default())); |
|||
|
|||
/* harmony default export */ var clipboard = (Clipboard); |
|||
|
|||
/***/ }), |
|||
|
|||
/***/ 828: |
|||
/***/ (function(module) { |
|||
|
|||
var DOCUMENT_NODE_TYPE = 9; |
|||
|
|||
/** |
|||
* A polyfill for Element.matches() |
|||
*/ |
|||
if (typeof Element !== 'undefined' && !Element.prototype.matches) { |
|||
var proto = Element.prototype; |
|||
|
|||
proto.matches = proto.matchesSelector || |
|||
proto.mozMatchesSelector || |
|||
proto.msMatchesSelector || |
|||
proto.oMatchesSelector || |
|||
proto.webkitMatchesSelector; |
|||
} |
|||
|
|||
/** |
|||
* Finds the closest parent that matches a selector. |
|||
* |
|||
* @param {Element} element |
|||
* @param {String} selector |
|||
* @return {Function} |
|||
*/ |
|||
function closest (element, selector) { |
|||
while (element && element.nodeType !== DOCUMENT_NODE_TYPE) { |
|||
if (typeof element.matches === 'function' && |
|||
element.matches(selector)) { |
|||
return element; |
|||
} |
|||
element = element.parentNode; |
|||
} |
|||
} |
|||
|
|||
module.exports = closest; |
|||
|
|||
|
|||
/***/ }), |
|||
|
|||
/***/ 438: |
|||
/***/ (function(module, __unused_webpack_exports, __webpack_require__) { |
|||
|
|||
var closest = __webpack_require__(828); |
|||
|
|||
/** |
|||
* Delegates event to a selector. |
|||
* |
|||
* @param {Element} element |
|||
* @param {String} selector |
|||
* @param {String} type |
|||
* @param {Function} callback |
|||
* @param {Boolean} useCapture |
|||
* @return {Object} |
|||
*/ |
|||
function _delegate(element, selector, type, callback, useCapture) { |
|||
var listenerFn = listener.apply(this, arguments); |
|||
|
|||
element.addEventListener(type, listenerFn, useCapture); |
|||
|
|||
return { |
|||
destroy: function() { |
|||
element.removeEventListener(type, listenerFn, useCapture); |
|||
} |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* Delegates event to a selector. |
|||
* |
|||
* @param {Element|String|Array} [elements] |
|||
* @param {String} selector |
|||
* @param {String} type |
|||
* @param {Function} callback |
|||
* @param {Boolean} useCapture |
|||
* @return {Object} |
|||
*/ |
|||
function delegate(elements, selector, type, callback, useCapture) { |
|||
// Handle the regular Element usage
|
|||
if (typeof elements.addEventListener === 'function') { |
|||
return _delegate.apply(null, arguments); |
|||
} |
|||
|
|||
// Handle Element-less usage, it defaults to global delegation
|
|||
if (typeof type === 'function') { |
|||
// Use `document` as the first parameter, then apply arguments
|
|||
// This is a short way to .unshift `arguments` without running into deoptimizations
|
|||
return _delegate.bind(null, document).apply(null, arguments); |
|||
} |
|||
|
|||
// Handle Selector-based usage
|
|||
if (typeof elements === 'string') { |
|||
elements = document.querySelectorAll(elements); |
|||
} |
|||
|
|||
// Handle Array-like based usage
|
|||
return Array.prototype.map.call(elements, function (element) { |
|||
return _delegate(element, selector, type, callback, useCapture); |
|||
}); |
|||
} |
|||
|
|||
/** |
|||
* Finds closest match and invokes callback. |
|||
* |
|||
* @param {Element} element |
|||
* @param {String} selector |
|||
* @param {String} type |
|||
* @param {Function} callback |
|||
* @return {Function} |
|||
*/ |
|||
function listener(element, selector, type, callback) { |
|||
return function(e) { |
|||
e.delegateTarget = closest(e.target, selector); |
|||
|
|||
if (e.delegateTarget) { |
|||
callback.call(element, e); |
|||
} |
|||
} |
|||
} |
|||
|
|||
module.exports = delegate; |
|||
|
|||
|
|||
/***/ }), |
|||
|
|||
/***/ 879: |
|||
/***/ (function(__unused_webpack_module, exports) { |
|||
|
|||
/** |
|||
* Check if argument is a HTML element. |
|||
* |
|||
* @param {Object} value |
|||
* @return {Boolean} |
|||
*/ |
|||
exports.node = function(value) { |
|||
return value !== undefined |
|||
&& value instanceof HTMLElement |
|||
&& value.nodeType === 1; |
|||
}; |
|||
|
|||
/** |
|||
* Check if argument is a list of HTML elements. |
|||
* |
|||
* @param {Object} value |
|||
* @return {Boolean} |
|||
*/ |
|||
exports.nodeList = function(value) { |
|||
var type = Object.prototype.toString.call(value); |
|||
|
|||
return value !== undefined |
|||
&& (type === '[object NodeList]' || type === '[object HTMLCollection]') |
|||
&& ('length' in value) |
|||
&& (value.length === 0 || exports.node(value[0])); |
|||
}; |
|||
|
|||
/** |
|||
* Check if argument is a string. |
|||
* |
|||
* @param {Object} value |
|||
* @return {Boolean} |
|||
*/ |
|||
exports.string = function(value) { |
|||
return typeof value === 'string' |
|||
|| value instanceof String; |
|||
}; |
|||
|
|||
/** |
|||
* Check if argument is a function. |
|||
* |
|||
* @param {Object} value |
|||
* @return {Boolean} |
|||
*/ |
|||
exports.fn = function(value) { |
|||
var type = Object.prototype.toString.call(value); |
|||
|
|||
return type === '[object Function]'; |
|||
}; |
|||
|
|||
|
|||
/***/ }), |
|||
|
|||
/***/ 370: |
|||
/***/ (function(module, __unused_webpack_exports, __webpack_require__) { |
|||
|
|||
var is = __webpack_require__(879); |
|||
var delegate = __webpack_require__(438); |
|||
|
|||
/** |
|||
* Validates all params and calls the right |
|||
* listener function based on its target type. |
|||
* |
|||
* @param {String|HTMLElement|HTMLCollection|NodeList} target |
|||
* @param {String} type |
|||
* @param {Function} callback |
|||
* @return {Object} |
|||
*/ |
|||
function listen(target, type, callback) { |
|||
if (!target && !type && !callback) { |
|||
throw new Error('Missing required arguments'); |
|||
} |
|||
|
|||
if (!is.string(type)) { |
|||
throw new TypeError('Second argument must be a String'); |
|||
} |
|||
|
|||
if (!is.fn(callback)) { |
|||
throw new TypeError('Third argument must be a Function'); |
|||
} |
|||
|
|||
if (is.node(target)) { |
|||
return listenNode(target, type, callback); |
|||
} |
|||
else if (is.nodeList(target)) { |
|||
return listenNodeList(target, type, callback); |
|||
} |
|||
else if (is.string(target)) { |
|||
return listenSelector(target, type, callback); |
|||
} |
|||
else { |
|||
throw new TypeError('First argument must be a String, HTMLElement, HTMLCollection, or NodeList'); |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* Adds an event listener to a HTML element |
|||
* and returns a remove listener function. |
|||
* |
|||
* @param {HTMLElement} node |
|||
* @param {String} type |
|||
* @param {Function} callback |
|||
* @return {Object} |
|||
*/ |
|||
function listenNode(node, type, callback) { |
|||
node.addEventListener(type, callback); |
|||
|
|||
return { |
|||
destroy: function() { |
|||
node.removeEventListener(type, callback); |
|||
} |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* Add an event listener to a list of HTML elements |
|||
* and returns a remove listener function. |
|||
* |
|||
* @param {NodeList|HTMLCollection} nodeList |
|||
* @param {String} type |
|||
* @param {Function} callback |
|||
* @return {Object} |
|||
*/ |
|||
function listenNodeList(nodeList, type, callback) { |
|||
Array.prototype.forEach.call(nodeList, function(node) { |
|||
node.addEventListener(type, callback); |
|||
}); |
|||
|
|||
return { |
|||
destroy: function() { |
|||
Array.prototype.forEach.call(nodeList, function(node) { |
|||
node.removeEventListener(type, callback); |
|||
}); |
|||
} |
|||
} |
|||
} |
|||
|
|||
/** |
|||
* Add an event listener to a selector |
|||
* and returns a remove listener function. |
|||
* |
|||
* @param {String} selector |
|||
* @param {String} type |
|||
* @param {Function} callback |
|||
* @return {Object} |
|||
*/ |
|||
function listenSelector(selector, type, callback) { |
|||
return delegate(document.body, selector, type, callback); |
|||
} |
|||
|
|||
module.exports = listen; |
|||
|
|||
|
|||
/***/ }), |
|||
|
|||
/***/ 817: |
|||
/***/ (function(module) { |
|||
|
|||
function select(element) { |
|||
var selectedText; |
|||
|
|||
if (element.nodeName === 'SELECT') { |
|||
element.focus(); |
|||
|
|||
selectedText = element.value; |
|||
} |
|||
else if (element.nodeName === 'INPUT' || element.nodeName === 'TEXTAREA') { |
|||
var isReadOnly = element.hasAttribute('readonly'); |
|||
|
|||
if (!isReadOnly) { |
|||
element.setAttribute('readonly', ''); |
|||
} |
|||
|
|||
element.select(); |
|||
element.setSelectionRange(0, element.value.length); |
|||
|
|||
if (!isReadOnly) { |
|||
element.removeAttribute('readonly'); |
|||
} |
|||
|
|||
selectedText = element.value; |
|||
} |
|||
else { |
|||
if (element.hasAttribute('contenteditable')) { |
|||
element.focus(); |
|||
} |
|||
|
|||
var selection = window.getSelection(); |
|||
var range = document.createRange(); |
|||
|
|||
range.selectNodeContents(element); |
|||
selection.removeAllRanges(); |
|||
selection.addRange(range); |
|||
|
|||
selectedText = selection.toString(); |
|||
} |
|||
|
|||
return selectedText; |
|||
} |
|||
|
|||
module.exports = select; |
|||
|
|||
|
|||
/***/ }), |
|||
|
|||
/***/ 279: |
|||
/***/ (function(module) { |
|||
|
|||
function E () { |
|||
// Keep this empty so it's easier to inherit from
|
|||
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
|
|||
} |
|||
|
|||
E.prototype = { |
|||
on: function (name, callback, ctx) { |
|||
var e = this.e || (this.e = {}); |
|||
|
|||
(e[name] || (e[name] = [])).push({ |
|||
fn: callback, |
|||
ctx: ctx |
|||
}); |
|||
|
|||
return this; |
|||
}, |
|||
|
|||
once: function (name, callback, ctx) { |
|||
var self = this; |
|||
function listener () { |
|||
self.off(name, listener); |
|||
callback.apply(ctx, arguments); |
|||
}; |
|||
|
|||
listener._ = callback |
|||
return this.on(name, listener, ctx); |
|||
}, |
|||
|
|||
emit: function (name) { |
|||
var data = [].slice.call(arguments, 1); |
|||
var evtArr = ((this.e || (this.e = {}))[name] || []).slice(); |
|||
var i = 0; |
|||
var len = evtArr.length; |
|||
|
|||
for (i; i < len; i++) { |
|||
evtArr[i].fn.apply(evtArr[i].ctx, data); |
|||
} |
|||
|
|||
return this; |
|||
}, |
|||
|
|||
off: function (name, callback) { |
|||
var e = this.e || (this.e = {}); |
|||
var evts = e[name]; |
|||
var liveEvents = []; |
|||
|
|||
if (evts && callback) { |
|||
for (var i = 0, len = evts.length; i < len; i++) { |
|||
if (evts[i].fn !== callback && evts[i].fn._ !== callback) |
|||
liveEvents.push(evts[i]); |
|||
} |
|||
} |
|||
|
|||
// Remove event from queue to prevent memory leak
|
|||
// Suggested by https://github.com/lazd
|
|||
// Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
|
|||
|
|||
(liveEvents.length) |
|||
? e[name] = liveEvents |
|||
: delete e[name]; |
|||
|
|||
return this; |
|||
} |
|||
}; |
|||
|
|||
module.exports = E; |
|||
module.exports.TinyEmitter = E; |
|||
|
|||
|
|||
/***/ }) |
|||
|
|||
/******/ }); |
|||
/************************************************************************/ |
|||
/******/ // The module cache
|
|||
/******/ var __webpack_module_cache__ = {}; |
|||
/******/ |
|||
/******/ // The require function
|
|||
/******/ function __webpack_require__(moduleId) { |
|||
/******/ // Check if module is in cache
|
|||
/******/ if(__webpack_module_cache__[moduleId]) { |
|||
/******/ return __webpack_module_cache__[moduleId].exports; |
|||
/******/ } |
|||
/******/ // Create a new module (and put it into the cache)
|
|||
/******/ var module = __webpack_module_cache__[moduleId] = { |
|||
/******/ // no module.id needed
|
|||
/******/ // no module.loaded needed
|
|||
/******/ exports: {} |
|||
/******/ }; |
|||
/******/ |
|||
/******/ // Execute the module function
|
|||
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__); |
|||
/******/ |
|||
/******/ // Return the exports of the module
|
|||
/******/ return module.exports; |
|||
/******/ } |
|||
/******/ |
|||
/************************************************************************/ |
|||
/******/ /* webpack/runtime/compat get default export */ |
|||
/******/ !function() { |
|||
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|||
/******/ __webpack_require__.n = function(module) { |
|||
/******/ var getter = module && module.__esModule ? |
|||
/******/ function() { return module['default']; } : |
|||
/******/ function() { return module; }; |
|||
/******/ __webpack_require__.d(getter, { a: getter }); |
|||
/******/ return getter; |
|||
/******/ }; |
|||
/******/ }(); |
|||
/******/ |
|||
/******/ /* webpack/runtime/define property getters */ |
|||
/******/ !function() { |
|||
/******/ // define getter functions for harmony exports
|
|||
/******/ __webpack_require__.d = function(exports, definition) { |
|||
/******/ for(var key in definition) { |
|||
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) { |
|||
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] }); |
|||
/******/ } |
|||
/******/ } |
|||
/******/ }; |
|||
/******/ }(); |
|||
/******/ |
|||
/******/ /* webpack/runtime/hasOwnProperty shorthand */ |
|||
/******/ !function() { |
|||
/******/ __webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); } |
|||
/******/ }(); |
|||
/******/ |
|||
/************************************************************************/ |
|||
/******/ // module exports must be returned from runtime so entry inlining is disabled
|
|||
/******/ // startup
|
|||
/******/ // Load entry module and return exports
|
|||
/******/ return __webpack_require__(686); |
|||
/******/ })() |
|||
.default; |
|||
}); |
|||
File diff suppressed because one or more lines are too long
@ -0,0 +1,29 @@ |
|||
BSD 3-Clause License |
|||
|
|||
Copyright (c) 2006, Ivan Sagalaev. |
|||
All rights reserved. |
|||
|
|||
Redistribution and use in source and binary forms, with or without |
|||
modification, are permitted provided that the following conditions are met: |
|||
|
|||
* Redistributions of source code must retain the above copyright notice, this |
|||
list of conditions and the following disclaimer. |
|||
|
|||
* Redistributions in binary form must reproduce the above copyright notice, |
|||
this list of conditions and the following disclaimer in the documentation |
|||
and/or other materials provided with the distribution. |
|||
|
|||
* Neither the name of the copyright holder nor the names of its |
|||
contributors may be used to endorse or promote products derived from |
|||
this software without specific prior written permission. |
|||
|
|||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" |
|||
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
|||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
|||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE |
|||
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
|||
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR |
|||
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
|||
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
|||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
|||
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
|||
File diff suppressed because it is too large
@ -0,0 +1,21 @@ |
|||
MIT LICENSE |
|||
|
|||
Copyright (c) 2012 Lea Verou |
|||
|
|||
Permission is hereby granted, free of charge, to any person obtaining a copy |
|||
of this software and associated documentation files (the "Software"), to deal |
|||
in the Software without restriction, including without limitation the rights |
|||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
|||
copies of the Software, and to permit persons to whom the Software is |
|||
furnished to do so, subject to the following conditions: |
|||
|
|||
The above copyright notice and this permission notice shall be included in |
|||
all copies or substantial portions of the Software. |
|||
|
|||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
|||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
|||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
|||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
|||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
|||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
|||
THE SOFTWARE. |
|||
@ -0,0 +1,51 @@ |
|||
# [Prism](https://prismjs.com/) |
|||
|
|||
[](https://github.com/PrismJS/prism/actions) |
|||
[](https://www.npmjs.com/package/prismjs) |
|||
|
|||
Prism is a lightweight, robust, and elegant syntax highlighting library. It's a spin-off project from [Dabblet](https://dabblet.com/). |
|||
|
|||
You can learn more on [prismjs.com](https://prismjs.com/). |
|||
|
|||
[Why another syntax highlighter?](https://lea.verou.me/2012/07/introducing-prism-an-awesome-new-syntax-highlighter/#more-1841) |
|||
|
|||
[More themes for Prism!](https://github.com/PrismJS/prism-themes) |
|||
|
|||
## Contribute to Prism! |
|||
|
|||
### **Important Notice** |
|||
|
|||
We are currently working on [Prism v2](https://github.com/PrismJS/prism/discussions/3531) and will only accept security-relevant PRs for the time being. |
|||
|
|||
Once work on Prism v2 is sufficiently advanced, we will accept PRs again. This will be announced on our [Discussion](https://github.com/PrismJS/prism/discussions) page and mentioned in the [roadmap discussion](https://github.com/PrismJS/prism/discussions/3531). |
|||
|
|||
<details> |
|||
<summary>Prism v1 contributing notes</summary> |
|||
|
|||
Prism depends on community contributions to expand and cover a wider array of use cases. If you like it, consider giving back by sending a pull request. Here are a few tips: |
|||
|
|||
- Read the [documentation](https://prismjs.com/extending.html). Prism was designed to be extensible. |
|||
- Do not edit `prism.js`, it’s just the version of Prism used by the Prism website and is built automatically. Limit your changes to the unminified files in the `components/` folder. `prism.js` and all minified files are generated by our build system (see below). |
|||
- Use `npm ci` to install Prism's dependencies. Do not use `npm install` because it will cause non-deterministic builds. |
|||
- The build system uses [gulp](https://github.com/gulpjs/gulp) to minify the files and build `prism.js`. With all of Prism's dependencies installed, you just need to run the command `npm run build`. |
|||
- Please follow the code conventions used in the files already. For example, I use [tabs for indentation and spaces for alignment](http://lea.verou.me/2012/01/why-tabs-are-clearly-superior/). Opening braces are on the same line, closing braces on their own line regardless of construct. There is a space before the opening brace. etc etc. |
|||
- Please try to err towards more smaller PRs rather than a few huge PRs. If a PR includes changes that I want to merge and also changes that I don't, handling it becomes difficult. |
|||
- My time is very limited these days, so it might take a long time to review bigger PRs (small ones are usually merged very quickly), especially those modifying the Prism Core. This doesn't mean your PR is rejected. |
|||
- If you contribute a new language definition, you will be responsible for handling bug reports about that language definition. |
|||
- If you [add a new language definition](https://prismjs.com/extending.html#creating-a-new-language-definition) or plugin, you need to add it to `components.json` as well and rebuild Prism by running `npm run build`, so that it becomes available to the download build page. For new languages, please also add a few [tests](https://prismjs.com/test-suite.html) and an example in the `examples/` folder. |
|||
- Go to [prism-themes](https://github.com/PrismJS/prism-themes) if you want to add a new theme. |
|||
|
|||
Thank you so much for contributing!! |
|||
|
|||
### Software requirements |
|||
|
|||
Prism will run on [almost any browser](https://prismjs.com/#features-full) and Node.js version but you need the following software to contribute: |
|||
|
|||
- Node.js >= 10.x |
|||
- npm >= 6.x |
|||
|
|||
</details> |
|||
|
|||
## Translations |
|||
|
|||
* [简体中文](https://www.awesomes.cn/repo/PrismJS/prism) (if unavailable, see [here](https://deepmind.t-salon.cc/article/113)) |
|||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
@ -0,0 +1,56 @@ |
|||
const components = require('../components.js'); |
|||
const getLoader = require('../dependencies'); |
|||
|
|||
|
|||
/** |
|||
* The set of all languages which have been loaded using the below function. |
|||
* |
|||
* @type {Set<string>} |
|||
*/ |
|||
const loadedLanguages = new Set(); |
|||
|
|||
/** |
|||
* Loads the given languages and adds them to the current Prism instance. |
|||
* |
|||
* If no languages are provided, __all__ Prism languages will be loaded. |
|||
* |
|||
* @param {string|string[]} [languages] |
|||
* @returns {void} |
|||
*/ |
|||
function loadLanguages(languages) { |
|||
if (languages === undefined) { |
|||
languages = Object.keys(components.languages).filter(l => l != 'meta'); |
|||
} else if (!Array.isArray(languages)) { |
|||
languages = [languages]; |
|||
} |
|||
|
|||
// the user might have loaded languages via some other way or used `prism.js` which already includes some
|
|||
// we don't need to validate the ids because `getLoader` will ignore invalid ones
|
|||
const loaded = [...loadedLanguages, ...Object.keys(Prism.languages)]; |
|||
|
|||
getLoader(components, languages, loaded).load(lang => { |
|||
if (!(lang in components.languages)) { |
|||
if (!loadLanguages.silent) { |
|||
console.warn('Language does not exist: ' + lang); |
|||
} |
|||
return; |
|||
} |
|||
|
|||
const pathToLanguage = './prism-' + lang; |
|||
|
|||
// remove from require cache and from Prism
|
|||
delete require.cache[require.resolve(pathToLanguage)]; |
|||
delete Prism.languages[lang]; |
|||
|
|||
require(pathToLanguage); |
|||
|
|||
loadedLanguages.add(lang); |
|||
}); |
|||
} |
|||
|
|||
/** |
|||
* Set this to `true` to prevent all warning messages `loadLanguages` logs. |
|||
*/ |
|||
loadLanguages.silent = false; |
|||
|
|||
module.exports = loadLanguages; |
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,54 @@ |
|||
(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)); |
|||
@ -0,0 +1 @@ |
|||
!function(n){var i="(?:ALPHA|BIT|CHAR|CR|CRLF|CTL|DIGIT|DQUOTE|HEXDIG|HTAB|LF|LWSP|OCTET|SP|VCHAR|WSP)";n.languages.abnf={comment:/;.*/,string:{pattern:/(?:%[is])?"[^"\n\r]*"/,greedy:!0,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:!0,alias:"operator"},definition:{pattern:/(^[ \t]*)(?:[a-z][\w-]*|<[^<>\r\n]*>)(?=\s*=)/m,lookbehind:!0,alias:"keyword",inside:{punctuation:/<|>/}},"core-rule":{pattern:RegExp("(?:(^|[^<\\w-])"+i+"|<"+i+">)(?![\\w-])","i"),lookbehind:!0,alias:["rule","constant"],inside:{punctuation:/<|>/}},rule:{pattern:/(^|[^<\w-])[a-z][\w-]*|<[^<>\r\n]*>/i,lookbehind:!0,inside:{punctuation:/<|>/}},operator:/=\/?|\//,punctuation:/[()\[\]]/}}(Prism); |
|||
@ -0,0 +1,19 @@ |
|||
Prism.languages.actionscript = Prism.languages.extend('javascript', { |
|||
'keyword': /\b(?:as|break|case|catch|class|const|default|delete|do|dynamic|each|else|extends|final|finally|for|function|get|if|implements|import|in|include|instanceof|interface|internal|is|namespace|native|new|null|override|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|use|var|void|while|with)\b/, |
|||
'operator': /\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/ |
|||
}); |
|||
Prism.languages.actionscript['class-name'].alias = 'function'; |
|||
|
|||
// doesn't work with AS because AS is too complex
|
|||
delete Prism.languages.actionscript['parameter']; |
|||
delete Prism.languages.actionscript['literal-property']; |
|||
|
|||
if (Prism.languages.markup) { |
|||
Prism.languages.insertBefore('actionscript', 'string', { |
|||
'xml': { |
|||
pattern: /(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/, |
|||
lookbehind: true, |
|||
inside: Prism.languages.markup |
|||
} |
|||
}); |
|||
} |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.actionscript=Prism.languages.extend("javascript",{keyword:/\b(?:as|break|case|catch|class|const|default|delete|do|dynamic|each|else|extends|final|finally|for|function|get|if|implements|import|in|include|instanceof|interface|internal|is|namespace|native|new|null|override|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|use|var|void|while|with)\b/,operator:/\+\+|--|(?:[+\-*\/%^]|&&?|\|\|?|<<?|>>?>?|[!=]=?)=?|[~?@]/}),Prism.languages.actionscript["class-name"].alias="function",delete Prism.languages.actionscript.parameter,delete Prism.languages.actionscript["literal-property"],Prism.languages.markup&&Prism.languages.insertBefore("actionscript","string",{xml:{pattern:/(^|[^.])<\/?\w+(?:\s+[^\s>\/=]+=("|')(?:\\[\s\S]|(?!\2)[^\\])*\2)*\s*\/?>/,lookbehind:!0,inside:Prism.languages.markup}}); |
|||
@ -0,0 +1,22 @@ |
|||
Prism.languages.ada = { |
|||
'comment': /--.*/, |
|||
'string': /"(?:""|[^"\r\f\n])*"/, |
|||
'number': [ |
|||
{ |
|||
pattern: /\b\d(?:_?\d)*#[\dA-F](?:_?[\dA-F])*(?:\.[\dA-F](?:_?[\dA-F])*)?#(?:E[+-]?\d(?:_?\d)*)?/i |
|||
}, |
|||
{ |
|||
pattern: /\b\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:E[+-]?\d(?:_?\d)*)?\b/i |
|||
} |
|||
], |
|||
'attribute': { |
|||
pattern: /\b'\w+/, |
|||
alias: 'attr-name' |
|||
}, |
|||
'keyword': /\b(?:abort|abs|abstract|accept|access|aliased|all|and|array|at|begin|body|case|constant|declare|delay|delta|digits|do|else|elsif|end|entry|exception|exit|for|function|generic|goto|if|in|interface|is|limited|loop|mod|new|not|null|of|or|others|out|overriding|package|pragma|private|procedure|protected|raise|range|record|rem|renames|requeue|return|reverse|select|separate|some|subtype|synchronized|tagged|task|terminate|then|type|until|use|when|while|with|xor)\b/i, |
|||
'boolean': /\b(?:false|true)\b/i, |
|||
'operator': /<[=>]?|>=?|=>?|:=|\/=?|\*\*?|[&+-]/, |
|||
'punctuation': /\.\.?|[,;():]/, |
|||
'char': /'.'/, |
|||
'variable': /\b[a-z](?:\w)*\b/i |
|||
}; |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.ada={comment:/--.*/,string:/"(?:""|[^"\r\f\n])*"/,number:[{pattern:/\b\d(?:_?\d)*#[\dA-F](?:_?[\dA-F])*(?:\.[\dA-F](?:_?[\dA-F])*)?#(?:E[+-]?\d(?:_?\d)*)?/i},{pattern:/\b\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:E[+-]?\d(?:_?\d)*)?\b/i}],attribute:{pattern:/\b'\w+/,alias:"attr-name"},keyword:/\b(?:abort|abs|abstract|accept|access|aliased|all|and|array|at|begin|body|case|constant|declare|delay|delta|digits|do|else|elsif|end|entry|exception|exit|for|function|generic|goto|if|in|interface|is|limited|loop|mod|new|not|null|of|or|others|out|overriding|package|pragma|private|procedure|protected|raise|range|record|rem|renames|requeue|return|reverse|select|separate|some|subtype|synchronized|tagged|task|terminate|then|type|until|use|when|while|with|xor)\b/i,boolean:/\b(?:false|true)\b/i,operator:/<[=>]?|>=?|=>?|:=|\/=?|\*\*?|[&+-]/,punctuation:/\.\.?|[,;():]/,char:/'.'/,variable:/\b[a-z](?:\w)*\b/i}; |
|||
@ -0,0 +1,24 @@ |
|||
(function (Prism) { |
|||
|
|||
Prism.languages.agda = { |
|||
'comment': /\{-[\s\S]*?(?:-\}|$)|--.*/, |
|||
'string': { |
|||
pattern: /"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/, |
|||
greedy: true, |
|||
}, |
|||
'punctuation': /[(){}⦃⦄.;@]/, |
|||
'class-name': { |
|||
pattern: /((?:data|record) +)\S+/, |
|||
lookbehind: true, |
|||
}, |
|||
'function': { |
|||
pattern: /(^[ \t]*)(?!\s)[^:\r\n]+(?=:)/m, |
|||
lookbehind: true, |
|||
}, |
|||
'operator': { |
|||
pattern: /(^\s*|\s)(?:[=|:∀→λ\\?_]|->)(?=\s)/, |
|||
lookbehind: true, |
|||
}, |
|||
'keyword': /\b(?:Set|abstract|constructor|data|eta-equality|field|forall|hiding|import|in|inductive|infix|infixl|infixr|instance|let|macro|module|mutual|no-eta-equality|open|overlap|pattern|postulate|primitive|private|public|quote|quoteContext|quoteGoal|quoteTerm|record|renaming|rewrite|syntax|tactic|unquote|unquoteDecl|unquoteDef|using|variable|where|with)\b/, |
|||
}; |
|||
}(Prism)); |
|||
@ -0,0 +1 @@ |
|||
!function(t){t.languages.agda={comment:/\{-[\s\S]*?(?:-\}|$)|--.*/,string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^\\\r\n"])*"/,greedy:!0},punctuation:/[(){}⦃⦄.;@]/,"class-name":{pattern:/((?:data|record) +)\S+/,lookbehind:!0},function:{pattern:/(^[ \t]*)(?!\s)[^:\r\n]+(?=:)/m,lookbehind:!0},operator:{pattern:/(^\s*|\s)(?:[=|:∀→λ\\?_]|->)(?=\s)/,lookbehind:!0},keyword:/\b(?:Set|abstract|constructor|data|eta-equality|field|forall|hiding|import|in|inductive|infix|infixl|infixr|instance|let|macro|module|mutual|no-eta-equality|open|overlap|pattern|postulate|primitive|private|public|quote|quoteContext|quoteGoal|quoteTerm|record|renaming|rewrite|syntax|tactic|unquote|unquoteDecl|unquoteDef|using|variable|where|with)\b/}}(Prism); |
|||
@ -0,0 +1,25 @@ |
|||
// based on https://github.com/microsoft/AL/blob/master/grammar/alsyntax.tmlanguage
|
|||
|
|||
Prism.languages.al = { |
|||
'comment': /\/\/.*|\/\*[\s\S]*?\*\//, |
|||
'string': { |
|||
pattern: /'(?:''|[^'\r\n])*'(?!')|"(?:""|[^"\r\n])*"(?!")/, |
|||
greedy: true |
|||
}, |
|||
'function': { |
|||
pattern: /(\b(?:event|procedure|trigger)\s+|(?:^|[^.])\.\s*)[a-z_]\w*(?=\s*\()/i, |
|||
lookbehind: true |
|||
}, |
|||
'keyword': [ |
|||
// keywords
|
|||
/\b(?:array|asserterror|begin|break|case|do|downto|else|end|event|exit|for|foreach|function|if|implements|in|indataset|interface|internal|local|of|procedure|program|protected|repeat|runonclient|securityfiltering|suppressdispose|temporary|then|to|trigger|until|var|while|with|withevents)\b/i, |
|||
// objects and metadata that are used like keywords
|
|||
/\b(?:action|actions|addafter|addbefore|addfirst|addlast|area|assembly|chartpart|codeunit|column|controladdin|cuegroup|customizes|dataitem|dataset|dotnet|elements|enum|enumextension|extends|field|fieldattribute|fieldelement|fieldgroup|fieldgroups|fields|filter|fixed|grid|group|key|keys|label|labels|layout|modify|moveafter|movebefore|movefirst|movelast|page|pagecustomization|pageextension|part|profile|query|repeater|report|requestpage|schema|separator|systempart|table|tableelement|tableextension|textattribute|textelement|type|usercontrol|value|xmlport)\b/i |
|||
], |
|||
'number': /\b(?:0x[\da-f]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)(?:F|LL?|U(?:LL?)?)?\b/i, |
|||
'boolean': /\b(?:false|true)\b/i, |
|||
'variable': /\b(?:Curr(?:FieldNo|Page|Report)|x?Rec|RequestOptionsPage)\b/, |
|||
'class-name': /\b(?:automation|biginteger|bigtext|blob|boolean|byte|char|clienttype|code|completiontriggererrorlevel|connectiontype|database|dataclassification|datascope|date|dateformula|datetime|decimal|defaultlayout|dialog|dictionary|dotnetassembly|dotnettypedeclaration|duration|errorinfo|errortype|executioncontext|executionmode|fieldclass|fieldref|fieldtype|file|filterpagebuilder|guid|httpclient|httpcontent|httpheaders|httprequestmessage|httpresponsemessage|instream|integer|joker|jsonarray|jsonobject|jsontoken|jsonvalue|keyref|list|moduledependencyinfo|moduleinfo|none|notification|notificationscope|objecttype|option|outstream|pageresult|record|recordid|recordref|reportformat|securityfilter|sessionsettings|tableconnectiontype|tablefilter|testaction|testfield|testfilterfield|testpage|testpermissions|testrequestpage|text|textbuilder|textconst|textencoding|time|transactionmodel|transactiontype|variant|verbosity|version|view|views|webserviceactioncontext|webserviceactionresultcode|xmlattribute|xmlattributecollection|xmlcdata|xmlcomment|xmldeclaration|xmldocument|xmldocumenttype|xmlelement|xmlnamespacemanager|xmlnametable|xmlnode|xmlnodelist|xmlprocessinginstruction|xmlreadoptions|xmltext|xmlwriteoptions)\b/i, |
|||
'operator': /\.\.|:[=:]|[-+*/]=?|<>|[<>]=?|=|\b(?:and|div|mod|not|or|xor)\b/i, |
|||
'punctuation': /[()\[\]{}:.;,]/ |
|||
}; |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.al={comment:/\/\/.*|\/\*[\s\S]*?\*\//,string:{pattern:/'(?:''|[^'\r\n])*'(?!')|"(?:""|[^"\r\n])*"(?!")/,greedy:!0},function:{pattern:/(\b(?:event|procedure|trigger)\s+|(?:^|[^.])\.\s*)[a-z_]\w*(?=\s*\()/i,lookbehind:!0},keyword:[/\b(?:array|asserterror|begin|break|case|do|downto|else|end|event|exit|for|foreach|function|if|implements|in|indataset|interface|internal|local|of|procedure|program|protected|repeat|runonclient|securityfiltering|suppressdispose|temporary|then|to|trigger|until|var|while|with|withevents)\b/i,/\b(?:action|actions|addafter|addbefore|addfirst|addlast|area|assembly|chartpart|codeunit|column|controladdin|cuegroup|customizes|dataitem|dataset|dotnet|elements|enum|enumextension|extends|field|fieldattribute|fieldelement|fieldgroup|fieldgroups|fields|filter|fixed|grid|group|key|keys|label|labels|layout|modify|moveafter|movebefore|movefirst|movelast|page|pagecustomization|pageextension|part|profile|query|repeater|report|requestpage|schema|separator|systempart|table|tableelement|tableextension|textattribute|textelement|type|usercontrol|value|xmlport)\b/i],number:/\b(?:0x[\da-f]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)(?:F|LL?|U(?:LL?)?)?\b/i,boolean:/\b(?:false|true)\b/i,variable:/\b(?:Curr(?:FieldNo|Page|Report)|x?Rec|RequestOptionsPage)\b/,"class-name":/\b(?:automation|biginteger|bigtext|blob|boolean|byte|char|clienttype|code|completiontriggererrorlevel|connectiontype|database|dataclassification|datascope|date|dateformula|datetime|decimal|defaultlayout|dialog|dictionary|dotnetassembly|dotnettypedeclaration|duration|errorinfo|errortype|executioncontext|executionmode|fieldclass|fieldref|fieldtype|file|filterpagebuilder|guid|httpclient|httpcontent|httpheaders|httprequestmessage|httpresponsemessage|instream|integer|joker|jsonarray|jsonobject|jsontoken|jsonvalue|keyref|list|moduledependencyinfo|moduleinfo|none|notification|notificationscope|objecttype|option|outstream|pageresult|record|recordid|recordref|reportformat|securityfilter|sessionsettings|tableconnectiontype|tablefilter|testaction|testfield|testfilterfield|testpage|testpermissions|testrequestpage|text|textbuilder|textconst|textencoding|time|transactionmodel|transactiontype|variant|verbosity|version|view|views|webserviceactioncontext|webserviceactionresultcode|xmlattribute|xmlattributecollection|xmlcdata|xmlcomment|xmldeclaration|xmldocument|xmldocumenttype|xmlelement|xmlnamespacemanager|xmlnametable|xmlnode|xmlnodelist|xmlprocessinginstruction|xmlreadoptions|xmltext|xmlwriteoptions)\b/i,operator:/\.\.|:[=:]|[-+*/]=?|<>|[<>]=?|=|\b(?:and|div|mod|not|or|xor)\b/i,punctuation:/[()\[\]{}:.;,]/}; |
|||
@ -0,0 +1,65 @@ |
|||
Prism.languages.antlr4 = { |
|||
'comment': /\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/, |
|||
'string': { |
|||
pattern: /'(?:\\.|[^\\'\r\n])*'/, |
|||
greedy: true |
|||
}, |
|||
'character-class': { |
|||
pattern: /\[(?:\\.|[^\\\]\r\n])*\]/, |
|||
greedy: true, |
|||
alias: 'regex', |
|||
inside: { |
|||
'range': { |
|||
pattern: /([^[]|(?:^|[^\\])(?:\\\\)*\\\[)-(?!\])/, |
|||
lookbehind: true, |
|||
alias: 'punctuation' |
|||
}, |
|||
'escape': /\\(?:u(?:[a-fA-F\d]{4}|\{[a-fA-F\d]+\})|[pP]\{[=\w-]+\}|[^\r\nupP])/, |
|||
'punctuation': /[\[\]]/ |
|||
} |
|||
}, |
|||
'action': { |
|||
pattern: /\{(?:[^{}]|\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\})*\}/, |
|||
greedy: true, |
|||
inside: { |
|||
'content': { |
|||
// this might be C, C++, Python, Java, C#, or any other language ANTLR4 compiles to
|
|||
pattern: /(\{)[\s\S]+(?=\})/, |
|||
lookbehind: true |
|||
}, |
|||
'punctuation': /[{}]/ |
|||
} |
|||
}, |
|||
'command': { |
|||
pattern: /(->\s*(?!\s))(?:\s*(?:,\s*)?\b[a-z]\w*(?:\s*\([^()\r\n]*\))?)+(?=\s*;)/i, |
|||
lookbehind: true, |
|||
inside: { |
|||
'function': /\b\w+(?=\s*(?:[,(]|$))/, |
|||
'punctuation': /[,()]/ |
|||
} |
|||
}, |
|||
'annotation': { |
|||
pattern: /@\w+(?:::\w+)*/, |
|||
alias: 'keyword' |
|||
}, |
|||
'label': { |
|||
pattern: /#[ \t]*\w+/, |
|||
alias: 'punctuation' |
|||
}, |
|||
'keyword': /\b(?:catch|channels|finally|fragment|grammar|import|lexer|locals|mode|options|parser|returns|throws|tokens)\b/, |
|||
'definition': [ |
|||
{ |
|||
pattern: /\b[a-z]\w*(?=\s*:)/, |
|||
alias: ['rule', 'class-name'] |
|||
}, |
|||
{ |
|||
pattern: /\b[A-Z]\w*(?=\s*:)/, |
|||
alias: ['token', 'constant'] |
|||
}, |
|||
], |
|||
'constant': /\b[A-Z][A-Z_]*\b/, |
|||
'operator': /\.\.|->|[|~]|[*+?]\??/, |
|||
'punctuation': /[;:()=]/ |
|||
}; |
|||
|
|||
Prism.languages.g4 = Prism.languages.antlr4; |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.antlr4={comment:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,string:{pattern:/'(?:\\.|[^\\'\r\n])*'/,greedy:!0},"character-class":{pattern:/\[(?:\\.|[^\\\]\r\n])*\]/,greedy:!0,alias:"regex",inside:{range:{pattern:/([^[]|(?:^|[^\\])(?:\\\\)*\\\[)-(?!\])/,lookbehind:!0,alias:"punctuation"},escape:/\\(?:u(?:[a-fA-F\d]{4}|\{[a-fA-F\d]+\})|[pP]\{[=\w-]+\}|[^\r\nupP])/,punctuation:/[\[\]]/}},action:{pattern:/\{(?:[^{}]|\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\})*\}/,greedy:!0,inside:{content:{pattern:/(\{)[\s\S]+(?=\})/,lookbehind:!0},punctuation:/[{}]/}},command:{pattern:/(->\s*(?!\s))(?:\s*(?:,\s*)?\b[a-z]\w*(?:\s*\([^()\r\n]*\))?)+(?=\s*;)/i,lookbehind:!0,inside:{function:/\b\w+(?=\s*(?:[,(]|$))/,punctuation:/[,()]/}},annotation:{pattern:/@\w+(?:::\w+)*/,alias:"keyword"},label:{pattern:/#[ \t]*\w+/,alias:"punctuation"},keyword:/\b(?:catch|channels|finally|fragment|grammar|import|lexer|locals|mode|options|parser|returns|throws|tokens)\b/,definition:[{pattern:/\b[a-z]\w*(?=\s*:)/,alias:["rule","class-name"]},{pattern:/\b[A-Z]\w*(?=\s*:)/,alias:["token","constant"]}],constant:/\b[A-Z][A-Z_]*\b/,operator:/\.\.|->|[|~]|[*+?]\??/,punctuation:/[;:()=]/},Prism.languages.g4=Prism.languages.antlr4; |
|||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,65 @@ |
|||
(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)); |
|||
@ -0,0 +1 @@ |
|||
!function(e){var t=/\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,n="\\b(?:(?=[a-z_]\\w*\\s*[<\\[])|(?!<keyword>))[A-Z_]\\w*(?:\\s*\\.\\s*[A-Z_]\\w*)*\\b(?:\\s*(?:\\[\\s*\\]|<(?:[^<>]|<(?:[^<>]|<[^<>]*>)*>)*>))*".replace(/<keyword>/g,(function(){return t.source}));function i(e){return RegExp(e.replace(/<CLASS-NAME>/g,(function(){return n})),"i")}var a={keyword:t,punctuation:/[()\[\]{};,:.<>]/};e.languages.apex={comment:e.languages.clike.comment,string:e.languages.clike.string,sql:{pattern:/((?:[=,({:]|\breturn)\s*)\[[^\[\]]*\]/i,lookbehind:!0,greedy:!0,alias:"language-sql",inside:e.languages.sql},annotation:{pattern:/@\w+\b/,alias:"punctuation"},"class-name":[{pattern:i("(\\b(?:class|enum|extends|implements|instanceof|interface|new|trigger\\s+\\w+\\s+on)\\s+)<CLASS-NAME>"),lookbehind:!0,inside:a},{pattern:i("(\\(\\s*)<CLASS-NAME>(?=\\s*\\)\\s*[\\w(])"),lookbehind:!0,inside:a},{pattern:i("<CLASS-NAME>(?=\\s*\\w+\\s*[;=,(){:])"),inside:a}],trigger:{pattern:/(\btrigger\s+)\w+\b/i,lookbehind:!0,alias:"class-name"},keyword:t,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); |
|||
@ -0,0 +1,32 @@ |
|||
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' |
|||
} |
|||
}; |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.apl={comment:/(?:⍝|#[! ]).*$/m,string:{pattern:/'(?:[^'\r\n]|'')*'/,greedy:!0},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"}}; |
|||
@ -0,0 +1,17 @@ |
|||
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': /[{}():,¬«»《》]/ |
|||
}; |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.applescript={comment:[/\(\*(?:\(\*(?:[^*]|\*(?!\)))*\*\)|(?!\(\*)[\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:/[{}():,¬«»《》]/}; |
|||
@ -0,0 +1,49 @@ |
|||
Prism.languages.aql = { |
|||
'comment': /\/\/.*|\/\*[\s\S]*?\*\//, |
|||
'property': { |
|||
pattern: /([{,]\s*)(?:(?!\d)\w+|(["'´`])(?:(?!\2)[^\\\r\n]|\\.)*\2)(?=\s*:)/, |
|||
lookbehind: true, |
|||
greedy: true |
|||
}, |
|||
'string': { |
|||
pattern: /(["'])(?:(?!\1)[^\\\r\n]|\\.)*\1/, |
|||
greedy: true |
|||
}, |
|||
'identifier': { |
|||
pattern: /([´`])(?:(?!\1)[^\\\r\n]|\\.)*\1/, |
|||
greedy: true |
|||
}, |
|||
'variable': /@@?\w+/, |
|||
'keyword': [ |
|||
{ |
|||
pattern: /(\bWITH\s+)COUNT(?=\s+INTO\b)/i, |
|||
lookbehind: true |
|||
}, |
|||
/\b(?:AGGREGATE|ALL|AND|ANY|ASC|COLLECT|DESC|DISTINCT|FILTER|FOR|GRAPH|IN|INBOUND|INSERT|INTO|K_PATHS|K_SHORTEST_PATHS|LET|LIKE|LIMIT|NONE|NOT|NULL|OR|OUTBOUND|REMOVE|REPLACE|RETURN|SHORTEST_PATH|SORT|UPDATE|UPSERT|WINDOW|WITH)\b/i, |
|||
// pseudo keywords get a lookbehind to avoid false positives
|
|||
{ |
|||
pattern: /(^|[^\w.[])(?:KEEP|PRUNE|SEARCH|TO)\b/i, |
|||
lookbehind: true |
|||
}, |
|||
{ |
|||
pattern: /(^|[^\w.[])(?:CURRENT|NEW|OLD)\b/, |
|||
lookbehind: true |
|||
}, |
|||
{ |
|||
pattern: /\bOPTIONS(?=\s*\{)/i |
|||
} |
|||
], |
|||
'function': /\b(?!\d)\w+(?=\s*\()/, |
|||
'boolean': /\b(?:false|true)\b/i, |
|||
'range': { |
|||
pattern: /\.\./, |
|||
alias: 'operator' |
|||
}, |
|||
'number': [ |
|||
/\b0b[01]+/i, |
|||
/\b0x[0-9a-f]+/i, |
|||
/(?:\B\.\d+|\b(?:0|[1-9]\d*)(?:\.\d+)?)(?:e[+-]?\d+)?/i |
|||
], |
|||
'operator': /\*{2,}|[=!]~|[!=<>]=?|&&|\|\||[-+*/%]/, |
|||
'punctuation': /::|[?.:,;()[\]{}]/ |
|||
}; |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.aql={comment:/\/\/.*|\/\*[\s\S]*?\*\//,property:{pattern:/([{,]\s*)(?:(?!\d)\w+|(["'´`])(?:(?!\2)[^\\\r\n]|\\.)*\2)(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(["'])(?:(?!\1)[^\\\r\n]|\\.)*\1/,greedy:!0},identifier:{pattern:/([´`])(?:(?!\1)[^\\\r\n]|\\.)*\1/,greedy:!0},variable:/@@?\w+/,keyword:[{pattern:/(\bWITH\s+)COUNT(?=\s+INTO\b)/i,lookbehind:!0},/\b(?:AGGREGATE|ALL|AND|ANY|ASC|COLLECT|DESC|DISTINCT|FILTER|FOR|GRAPH|IN|INBOUND|INSERT|INTO|K_PATHS|K_SHORTEST_PATHS|LET|LIKE|LIMIT|NONE|NOT|NULL|OR|OUTBOUND|REMOVE|REPLACE|RETURN|SHORTEST_PATH|SORT|UPDATE|UPSERT|WINDOW|WITH)\b/i,{pattern:/(^|[^\w.[])(?:KEEP|PRUNE|SEARCH|TO)\b/i,lookbehind:!0},{pattern:/(^|[^\w.[])(?:CURRENT|NEW|OLD)\b/,lookbehind:!0},{pattern:/\bOPTIONS(?=\s*\{)/i}],function:/\b(?!\d)\w+(?=\s*\()/,boolean:/\b(?:false|true)\b/i,range:{pattern:/\.\./,alias:"operator"},number:[/\b0b[01]+/i,/\b0x[0-9a-f]+/i,/(?:\B\.\d+|\b(?:0|[1-9]\d*)(?:\.\d+)?)(?:e[+-]?\d+)?/i],operator:/\*{2,}|[=!]~|[!=<>]=?|&&|\|\||[-+*/%]/,punctuation:/::|[?.:,;()[\]{}]/}; |
|||
@ -0,0 +1,7 @@ |
|||
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; |
|||
@ -0,0 +1 @@ |
|||
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; |
|||
@ -0,0 +1,10 @@ |
|||
Prism.languages.arff = { |
|||
'comment': /%.*/, |
|||
'string': { |
|||
pattern: /(["'])(?:\\.|(?!\1)[^\\\r\n])*\1/, |
|||
greedy: true |
|||
}, |
|||
'keyword': /@(?:attribute|data|end|relation)\b/i, |
|||
'number': /\b\d+(?:\.\d+)?\b/, |
|||
'punctuation': /[{},]/ |
|||
}; |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.arff={comment:/%.*/,string:{pattern:/(["'])(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},keyword:/@(?:attribute|data|end|relation)\b/i,number:/\b\d+(?:\.\d+)?\b/,punctuation:/[{},]/}; |
|||
@ -0,0 +1,49 @@ |
|||
Prism.languages.armasm = { |
|||
'comment': { |
|||
pattern: /;.*/, |
|||
greedy: true |
|||
}, |
|||
'string': { |
|||
pattern: /"(?:[^"\r\n]|"")*"/, |
|||
greedy: true, |
|||
inside: { |
|||
'variable': { |
|||
pattern: /((?:^|[^$])(?:\${2})*)\$\w+/, |
|||
lookbehind: true |
|||
} |
|||
} |
|||
}, |
|||
'char': { |
|||
pattern: /'(?:[^'\r\n]{0,4}|'')'/, |
|||
greedy: true |
|||
}, |
|||
'version-symbol': { |
|||
pattern: /\|[\w@]+\|/, |
|||
greedy: true, |
|||
alias: 'property' |
|||
}, |
|||
|
|||
'boolean': /\b(?:FALSE|TRUE)\b/, |
|||
'directive': { |
|||
pattern: /\b(?:ALIAS|ALIGN|AREA|ARM|ASSERT|ATTR|CN|CODE|CODE16|CODE32|COMMON|CP|DATA|DCB|DCD|DCDO|DCDU|DCFD|DCFDU|DCI|DCQ|DCQU|DCW|DCWU|DN|ELIF|ELSE|END|ENDFUNC|ENDIF|ENDP|ENTRY|EQU|EXPORT|EXPORTAS|EXTERN|FIELD|FILL|FN|FUNCTION|GBLA|GBLL|GBLS|GET|GLOBAL|IF|IMPORT|INCBIN|INCLUDE|INFO|KEEP|LCLA|LCLL|LCLS|LTORG|MACRO|MAP|MEND|MEXIT|NOFP|OPT|PRESERVE8|PROC|QN|READONLY|RELOC|REQUIRE|REQUIRE8|RLIST|ROUT|SETA|SETL|SETS|SN|SPACE|SUBT|THUMB|THUMBX|TTL|WEND|WHILE)\b/, |
|||
alias: 'property' |
|||
}, |
|||
'instruction': { |
|||
pattern: /((?:^|(?:^|[^\\])(?:\r\n?|\n))[ \t]*(?:(?:[A-Z][A-Z0-9_]*[a-z]\w*|[a-z]\w*|\d+)[ \t]+)?)\b[A-Z.]+\b/, |
|||
lookbehind: true, |
|||
alias: 'keyword' |
|||
}, |
|||
'variable': /\$\w+/, |
|||
|
|||
'number': /(?:\b[2-9]_\d+|(?:\b\d+(?:\.\d+)?|\B\.\d+)(?:e-?\d+)?|\b0(?:[fd]_|x)[0-9a-f]+|&[0-9a-f]+)\b/i, |
|||
|
|||
'register': { |
|||
pattern: /\b(?:r\d|lr)\b/, |
|||
alias: 'symbol' |
|||
}, |
|||
|
|||
'operator': /<>|<<|>>|&&|\|\||[=!<>/]=?|[+\-*%#?&|^]|:[A-Z]+:/, |
|||
'punctuation': /[()[\],]/ |
|||
}; |
|||
|
|||
Prism.languages['arm-asm'] = Prism.languages.armasm; |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.armasm={comment:{pattern:/;.*/,greedy:!0},string:{pattern:/"(?:[^"\r\n]|"")*"/,greedy:!0,inside:{variable:{pattern:/((?:^|[^$])(?:\${2})*)\$\w+/,lookbehind:!0}}},char:{pattern:/'(?:[^'\r\n]{0,4}|'')'/,greedy:!0},"version-symbol":{pattern:/\|[\w@]+\|/,greedy:!0,alias:"property"},boolean:/\b(?:FALSE|TRUE)\b/,directive:{pattern:/\b(?:ALIAS|ALIGN|AREA|ARM|ASSERT|ATTR|CN|CODE|CODE16|CODE32|COMMON|CP|DATA|DCB|DCD|DCDO|DCDU|DCFD|DCFDU|DCI|DCQ|DCQU|DCW|DCWU|DN|ELIF|ELSE|END|ENDFUNC|ENDIF|ENDP|ENTRY|EQU|EXPORT|EXPORTAS|EXTERN|FIELD|FILL|FN|FUNCTION|GBLA|GBLL|GBLS|GET|GLOBAL|IF|IMPORT|INCBIN|INCLUDE|INFO|KEEP|LCLA|LCLL|LCLS|LTORG|MACRO|MAP|MEND|MEXIT|NOFP|OPT|PRESERVE8|PROC|QN|READONLY|RELOC|REQUIRE|REQUIRE8|RLIST|ROUT|SETA|SETL|SETS|SN|SPACE|SUBT|THUMB|THUMBX|TTL|WEND|WHILE)\b/,alias:"property"},instruction:{pattern:/((?:^|(?:^|[^\\])(?:\r\n?|\n))[ \t]*(?:(?:[A-Z][A-Z0-9_]*[a-z]\w*|[a-z]\w*|\d+)[ \t]+)?)\b[A-Z.]+\b/,lookbehind:!0,alias:"keyword"},variable:/\$\w+/,number:/(?:\b[2-9]_\d+|(?:\b\d+(?:\.\d+)?|\B\.\d+)(?:e-?\d+)?|\b0(?:[fd]_|x)[0-9a-f]+|&[0-9a-f]+)\b/i,register:{pattern:/\b(?:r\d|lr)\b/,alias:"symbol"},operator:/<>|<<|>>|&&|\|\||[=!<>/]=?|[+\-*%#?&|^]|:[A-Z]+:/,punctuation:/[()[\],]/},Prism.languages["arm-asm"]=Prism.languages.armasm; |
|||
@ -0,0 +1,105 @@ |
|||
(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)); |
|||
@ -0,0 +1 @@ |
|||
!function(e){var a=function(a,t){return{pattern:RegExp("\\{!(?:"+(t||a)+")$[^]*\\}","m"),greedy:!0,inside:{embedded:{pattern:/(^\{!\w+\b)[\s\S]+(?=\}$)/,lookbehind:!0,alias:"language-"+a,inside:e.languages[a]},string:/[\s\S]+/}}};e.languages.arturo={comment:{pattern:/;.*/,greedy:!0},character:{pattern:/`.`/,alias:"char",greedy:!0},number:{pattern:/\b\d+(?:\.\d+(?:\.\d+(?:-[\w+-]+)?)?)?\b/},string:{pattern:/"(?:[^"\\\r\n]|\\.)*"/,greedy:!0},regex:{pattern:/\{\/.*?\/\}/,greedy:!0},"html-string":a("html"),"css-string":a("css"),"js-string":a("js"),"md-string":a("md"),"sql-string":a("sql"),"sh-string":a("shell","sh"),multistring:{pattern:/».*|\{:[\s\S]*?:\}|\{[\s\S]*?\}|^-{6}$[\s\S]*/m,alias:"string",greedy:!0},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/}},e.languages.art=e.languages.arturo}(Prism); |
|||
@ -0,0 +1,234 @@ |
|||
(function (Prism) { |
|||
|
|||
var attributes = { |
|||
pattern: /(^[ \t]*)\[(?!\[)(?:(["'$`])(?:(?!\2)[^\\]|\\.)*\2|\[(?:[^\[\]\\]|\\.)*\]|[^\[\]\\"'$`]|\\.)*\]/m, |
|||
lookbehind: true, |
|||
inside: { |
|||
'quoted': { |
|||
pattern: /([$`])(?:(?!\1)[^\\]|\\.)*\1/, |
|||
inside: { |
|||
'punctuation': /^[$`]|[$`]$/ |
|||
} |
|||
}, |
|||
'interpreted': { |
|||
pattern: /'(?:[^'\\]|\\.)*'/, |
|||
inside: { |
|||
'punctuation': /^'|'$/ |
|||
// See rest below
|
|||
} |
|||
}, |
|||
'string': /"(?:[^"\\]|\\.)*"/, |
|||
'variable': /\w+(?==)/, |
|||
'punctuation': /^\[|\]$|,/, |
|||
'operator': /=/, |
|||
// The negative look-ahead prevents blank matches
|
|||
'attr-value': /(?!^\s+$).+/ |
|||
} |
|||
}; |
|||
|
|||
var asciidoc = Prism.languages.asciidoc = { |
|||
'comment-block': { |
|||
pattern: /^(\/{4,})$[\s\S]*?^\1/m, |
|||
alias: 'comment' |
|||
}, |
|||
'table': { |
|||
pattern: /^\|={3,}(?:(?:\r?\n|\r(?!\n)).*)*?(?:\r?\n|\r)\|={3,}$/m, |
|||
inside: { |
|||
'specifiers': { |
|||
pattern: /(?:(?:(?:\d+(?:\.\d+)?|\.\d+)[+*](?:[<^>](?:\.[<^>])?|\.[<^>])?|[<^>](?:\.[<^>])?|\.[<^>])[a-z]*|[a-z]+)(?=\|)/, |
|||
alias: 'attr-value' |
|||
}, |
|||
'punctuation': { |
|||
pattern: /(^|[^\\])[|!]=*/, |
|||
lookbehind: true |
|||
} |
|||
// See rest below
|
|||
} |
|||
}, |
|||
|
|||
'passthrough-block': { |
|||
pattern: /^(\+{4,})$[\s\S]*?^\1$/m, |
|||
inside: { |
|||
'punctuation': /^\++|\++$/ |
|||
// See rest below
|
|||
} |
|||
}, |
|||
// Literal blocks and listing blocks
|
|||
'literal-block': { |
|||
pattern: /^(-{4,}|\.{4,})$[\s\S]*?^\1$/m, |
|||
inside: { |
|||
'punctuation': /^(?:-+|\.+)|(?:-+|\.+)$/ |
|||
// See rest below
|
|||
} |
|||
}, |
|||
// Sidebar blocks, quote blocks, example blocks and open blocks
|
|||
'other-block': { |
|||
pattern: /^(--|\*{4,}|_{4,}|={4,})$[\s\S]*?^\1$/m, |
|||
inside: { |
|||
'punctuation': /^(?:-+|\*+|_+|=+)|(?:-+|\*+|_+|=+)$/ |
|||
// See rest below
|
|||
} |
|||
}, |
|||
|
|||
// list-punctuation and list-label must appear before indented-block
|
|||
'list-punctuation': { |
|||
pattern: /(^[ \t]*)(?:-|\*{1,5}|\.{1,5}|(?:[a-z]|\d+)\.|[xvi]+\))(?= )/im, |
|||
lookbehind: true, |
|||
alias: 'punctuation' |
|||
}, |
|||
'list-label': { |
|||
pattern: /(^[ \t]*)[a-z\d].+(?::{2,4}|;;)(?=\s)/im, |
|||
lookbehind: true, |
|||
alias: 'symbol' |
|||
}, |
|||
'indented-block': { |
|||
pattern: /((\r?\n|\r)\2)([ \t]+)\S.*(?:(?:\r?\n|\r)\3.+)*(?=\2{2}|$)/, |
|||
lookbehind: true |
|||
}, |
|||
|
|||
'comment': /^\/\/.*/m, |
|||
'title': { |
|||
pattern: /^.+(?:\r?\n|\r)(?:={3,}|-{3,}|~{3,}|\^{3,}|\+{3,})$|^={1,5} .+|^\.(?![\s.]).*/m, |
|||
alias: 'important', |
|||
inside: { |
|||
'punctuation': /^(?:\.|=+)|(?:=+|-+|~+|\^+|\++)$/ |
|||
// See rest below
|
|||
} |
|||
}, |
|||
'attribute-entry': { |
|||
pattern: /^:[^:\r\n]+:(?: .*?(?: \+(?:\r?\n|\r).*?)*)?$/m, |
|||
alias: 'tag' |
|||
}, |
|||
'attributes': attributes, |
|||
'hr': { |
|||
pattern: /^'{3,}$/m, |
|||
alias: 'punctuation' |
|||
}, |
|||
'page-break': { |
|||
pattern: /^<{3,}$/m, |
|||
alias: 'punctuation' |
|||
}, |
|||
'admonition': { |
|||
pattern: /^(?:CAUTION|IMPORTANT|NOTE|TIP|WARNING):/m, |
|||
alias: 'keyword' |
|||
}, |
|||
'callout': [ |
|||
{ |
|||
pattern: /(^[ \t]*)<?\d*>/m, |
|||
lookbehind: true, |
|||
alias: 'symbol' |
|||
}, |
|||
{ |
|||
pattern: /<\d+>/, |
|||
alias: 'symbol' |
|||
} |
|||
], |
|||
'macro': { |
|||
pattern: /\b[a-z\d][a-z\d-]*::?(?:[^\s\[\]]*\[(?:[^\]\\"']|(["'])(?:(?!\1)[^\\]|\\.)*\1|\\.)*\])/, |
|||
inside: { |
|||
'function': /^[a-z\d-]+(?=:)/, |
|||
'punctuation': /^::?/, |
|||
'attributes': { |
|||
pattern: /(?:\[(?:[^\]\\"']|(["'])(?:(?!\1)[^\\]|\\.)*\1|\\.)*\])/, |
|||
inside: attributes.inside |
|||
} |
|||
} |
|||
}, |
|||
'inline': { |
|||
/* |
|||
The initial look-behind prevents the highlighting of escaped quoted text. |
|||
|
|||
Quoted text can be multi-line but cannot span an empty line. |
|||
All quoted text can have attributes before [foobar, 'foobar', baz="bar"]. |
|||
|
|||
First, we handle the constrained quotes. |
|||
Those must be bounded by non-word chars and cannot have spaces between the delimiter and the first char. |
|||
They are, in order: _emphasis_, ``double quotes'', `single quotes', `monospace`, 'emphasis', *strong*, +monospace+ and #unquoted#
|
|||
|
|||
Then we handle the unconstrained quotes. |
|||
Those do not have the restrictions of the constrained quotes. |
|||
They are, in order: __emphasis__, **strong**, ++monospace++, +++passthrough+++, ##unquoted##, $$passthrough$$, ~subscript~, ^superscript^, {attribute-reference}, [[anchor]], [[[bibliography anchor]]], <<xref>>, (((indexes))) and ((indexes)) |
|||
*/ |
|||
pattern: /(^|[^\\])(?:(?:\B\[(?:[^\]\\"']|(["'])(?:(?!\2)[^\\]|\\.)*\2|\\.)*\])?(?:\b_(?!\s)(?: _|[^_\\\r\n]|\\.)+(?:(?:\r?\n|\r)(?: _|[^_\\\r\n]|\\.)+)*_\b|\B``(?!\s).+?(?:(?:\r?\n|\r).+?)*''\B|\B`(?!\s)(?:[^`'\s]|\s+\S)+['`]\B|\B(['*+#])(?!\s)(?: \3|(?!\3)[^\\\r\n]|\\.)+(?:(?:\r?\n|\r)(?: \3|(?!\3)[^\\\r\n]|\\.)+)*\3\B)|(?:\[(?:[^\]\\"']|(["'])(?:(?!\4)[^\\]|\\.)*\4|\\.)*\])?(?:(__|\*\*|\+\+\+?|##|\$\$|[~^]).+?(?:(?:\r?\n|\r).+?)*\5|\{[^}\r\n]+\}|\[\[\[?.+?(?:(?:\r?\n|\r).+?)*\]?\]\]|<<.+?(?:(?:\r?\n|\r).+?)*>>|\(\(\(?.+?(?:(?:\r?\n|\r).+?)*\)?\)\)))/m, |
|||
lookbehind: true, |
|||
inside: { |
|||
'attributes': attributes, |
|||
'url': { |
|||
pattern: /^(?:\[\[\[?.+?\]?\]\]|<<.+?>>)$/, |
|||
inside: { |
|||
'punctuation': /^(?:\[\[\[?|<<)|(?:\]\]\]?|>>)$/ |
|||
} |
|||
}, |
|||
'attribute-ref': { |
|||
pattern: /^\{.+\}$/, |
|||
inside: { |
|||
'variable': { |
|||
pattern: /(^\{)[a-z\d,+_-]+/, |
|||
lookbehind: true |
|||
}, |
|||
'operator': /^[=?!#%@$]|!(?=[:}])/, |
|||
'punctuation': /^\{|\}$|::?/ |
|||
} |
|||
}, |
|||
'italic': { |
|||
pattern: /^(['_])[\s\S]+\1$/, |
|||
inside: { |
|||
'punctuation': /^(?:''?|__?)|(?:''?|__?)$/ |
|||
} |
|||
}, |
|||
'bold': { |
|||
pattern: /^\*[\s\S]+\*$/, |
|||
inside: { |
|||
punctuation: /^\*\*?|\*\*?$/ |
|||
} |
|||
}, |
|||
'punctuation': /^(?:``?|\+{1,3}|##?|\$\$|[~^]|\(\(\(?)|(?:''?|\+{1,3}|##?|\$\$|[~^`]|\)?\)\))$/ |
|||
} |
|||
}, |
|||
'replacement': { |
|||
pattern: /\((?:C|R|TM)\)/, |
|||
alias: 'builtin' |
|||
}, |
|||
'entity': /&#?[\da-z]{1,8};/i, |
|||
'line-continuation': { |
|||
pattern: /(^| )\+$/m, |
|||
lookbehind: true, |
|||
alias: 'punctuation' |
|||
} |
|||
}; |
|||
|
|||
|
|||
// Allow some nesting. There is no recursion though, so cloning should not be needed.
|
|||
|
|||
function copyFromAsciiDoc(keys) { |
|||
keys = keys.split(' '); |
|||
|
|||
var o = {}; |
|||
for (var i = 0, l = keys.length; i < l; i++) { |
|||
o[keys[i]] = asciidoc[keys[i]]; |
|||
} |
|||
return o; |
|||
} |
|||
|
|||
attributes.inside['interpreted'].inside.rest = copyFromAsciiDoc('macro inline replacement entity'); |
|||
|
|||
asciidoc['passthrough-block'].inside.rest = copyFromAsciiDoc('macro'); |
|||
|
|||
asciidoc['literal-block'].inside.rest = copyFromAsciiDoc('callout'); |
|||
|
|||
asciidoc['table'].inside.rest = copyFromAsciiDoc('comment-block passthrough-block literal-block other-block list-punctuation indented-block comment title attribute-entry attributes hr page-break admonition list-label callout macro inline replacement entity line-continuation'); |
|||
|
|||
asciidoc['other-block'].inside.rest = copyFromAsciiDoc('table list-punctuation indented-block comment attribute-entry attributes hr page-break admonition list-label macro inline replacement entity line-continuation'); |
|||
|
|||
asciidoc['title'].inside.rest = copyFromAsciiDoc('macro inline replacement entity'); |
|||
|
|||
|
|||
// Plugin to make entity title show the real entity, idea by Roman Komarov
|
|||
Prism.hooks.add('wrap', function (env) { |
|||
if (env.type === 'entity') { |
|||
env.attributes['title'] = env.content.replace(/&/, '&'); |
|||
} |
|||
}); |
|||
|
|||
Prism.languages.adoc = Prism.languages.asciidoc; |
|||
}(Prism)); |
|||
@ -0,0 +1 @@ |
|||
!function(t){var n={pattern:/(^[ \t]*)\[(?!\[)(?:(["'$`])(?:(?!\2)[^\\]|\\.)*\2|\[(?:[^\[\]\\]|\\.)*\]|[^\[\]\\"'$`]|\\.)*\]/m,lookbehind:!0,inside:{quoted:{pattern:/([$`])(?:(?!\1)[^\\]|\\.)*\1/,inside:{punctuation:/^[$`]|[$`]$/}},interpreted:{pattern:/'(?:[^'\\]|\\.)*'/,inside:{punctuation:/^'|'$/}},string:/"(?:[^"\\]|\\.)*"/,variable:/\w+(?==)/,punctuation:/^\[|\]$|,/,operator:/=/,"attr-value":/(?!^\s+$).+/}},i=t.languages.asciidoc={"comment-block":{pattern:/^(\/{4,})$[\s\S]*?^\1/m,alias:"comment"},table:{pattern:/^\|={3,}(?:(?:\r?\n|\r(?!\n)).*)*?(?:\r?\n|\r)\|={3,}$/m,inside:{specifiers:{pattern:/(?:(?:(?:\d+(?:\.\d+)?|\.\d+)[+*](?:[<^>](?:\.[<^>])?|\.[<^>])?|[<^>](?:\.[<^>])?|\.[<^>])[a-z]*|[a-z]+)(?=\|)/,alias:"attr-value"},punctuation:{pattern:/(^|[^\\])[|!]=*/,lookbehind:!0}}},"passthrough-block":{pattern:/^(\+{4,})$[\s\S]*?^\1$/m,inside:{punctuation:/^\++|\++$/}},"literal-block":{pattern:/^(-{4,}|\.{4,})$[\s\S]*?^\1$/m,inside:{punctuation:/^(?:-+|\.+)|(?:-+|\.+)$/}},"other-block":{pattern:/^(--|\*{4,}|_{4,}|={4,})$[\s\S]*?^\1$/m,inside:{punctuation:/^(?:-+|\*+|_+|=+)|(?:-+|\*+|_+|=+)$/}},"list-punctuation":{pattern:/(^[ \t]*)(?:-|\*{1,5}|\.{1,5}|(?:[a-z]|\d+)\.|[xvi]+\))(?= )/im,lookbehind:!0,alias:"punctuation"},"list-label":{pattern:/(^[ \t]*)[a-z\d].+(?::{2,4}|;;)(?=\s)/im,lookbehind:!0,alias:"symbol"},"indented-block":{pattern:/((\r?\n|\r)\2)([ \t]+)\S.*(?:(?:\r?\n|\r)\3.+)*(?=\2{2}|$)/,lookbehind:!0},comment:/^\/\/.*/m,title:{pattern:/^.+(?:\r?\n|\r)(?:={3,}|-{3,}|~{3,}|\^{3,}|\+{3,})$|^={1,5} .+|^\.(?![\s.]).*/m,alias:"important",inside:{punctuation:/^(?:\.|=+)|(?:=+|-+|~+|\^+|\++)$/}},"attribute-entry":{pattern:/^:[^:\r\n]+:(?: .*?(?: \+(?:\r?\n|\r).*?)*)?$/m,alias:"tag"},attributes:n,hr:{pattern:/^'{3,}$/m,alias:"punctuation"},"page-break":{pattern:/^<{3,}$/m,alias:"punctuation"},admonition:{pattern:/^(?:CAUTION|IMPORTANT|NOTE|TIP|WARNING):/m,alias:"keyword"},callout:[{pattern:/(^[ \t]*)<?\d*>/m,lookbehind:!0,alias:"symbol"},{pattern:/<\d+>/,alias:"symbol"}],macro:{pattern:/\b[a-z\d][a-z\d-]*::?(?:[^\s\[\]]*\[(?:[^\]\\"']|(["'])(?:(?!\1)[^\\]|\\.)*\1|\\.)*\])/,inside:{function:/^[a-z\d-]+(?=:)/,punctuation:/^::?/,attributes:{pattern:/(?:\[(?:[^\]\\"']|(["'])(?:(?!\1)[^\\]|\\.)*\1|\\.)*\])/,inside:n.inside}}},inline:{pattern:/(^|[^\\])(?:(?:\B\[(?:[^\]\\"']|(["'])(?:(?!\2)[^\\]|\\.)*\2|\\.)*\])?(?:\b_(?!\s)(?: _|[^_\\\r\n]|\\.)+(?:(?:\r?\n|\r)(?: _|[^_\\\r\n]|\\.)+)*_\b|\B``(?!\s).+?(?:(?:\r?\n|\r).+?)*''\B|\B`(?!\s)(?:[^`'\s]|\s+\S)+['`]\B|\B(['*+#])(?!\s)(?: \3|(?!\3)[^\\\r\n]|\\.)+(?:(?:\r?\n|\r)(?: \3|(?!\3)[^\\\r\n]|\\.)+)*\3\B)|(?:\[(?:[^\]\\"']|(["'])(?:(?!\4)[^\\]|\\.)*\4|\\.)*\])?(?:(__|\*\*|\+\+\+?|##|\$\$|[~^]).+?(?:(?:\r?\n|\r).+?)*\5|\{[^}\r\n]+\}|\[\[\[?.+?(?:(?:\r?\n|\r).+?)*\]?\]\]|<<.+?(?:(?:\r?\n|\r).+?)*>>|\(\(\(?.+?(?:(?:\r?\n|\r).+?)*\)?\)\)))/m,lookbehind:!0,inside:{attributes:n,url:{pattern:/^(?:\[\[\[?.+?\]?\]\]|<<.+?>>)$/,inside:{punctuation:/^(?:\[\[\[?|<<)|(?:\]\]\]?|>>)$/}},"attribute-ref":{pattern:/^\{.+\}$/,inside:{variable:{pattern:/(^\{)[a-z\d,+_-]+/,lookbehind:!0},operator:/^[=?!#%@$]|!(?=[:}])/,punctuation:/^\{|\}$|::?/}},italic:{pattern:/^(['_])[\s\S]+\1$/,inside:{punctuation:/^(?:''?|__?)|(?:''?|__?)$/}},bold:{pattern:/^\*[\s\S]+\*$/,inside:{punctuation:/^\*\*?|\*\*?$/}},punctuation:/^(?:``?|\+{1,3}|##?|\$\$|[~^]|\(\(\(?)|(?:''?|\+{1,3}|##?|\$\$|[~^`]|\)?\)\))$/}},replacement:{pattern:/\((?:C|R|TM)\)/,alias:"builtin"},entity:/&#?[\da-z]{1,8};/i,"line-continuation":{pattern:/(^| )\+$/m,lookbehind:!0,alias:"punctuation"}};function e(t){for(var n={},e=0,a=(t=t.split(" ")).length;e<a;e++)n[t[e]]=i[t[e]];return n}n.inside.interpreted.inside.rest=e("macro inline replacement entity"),i["passthrough-block"].inside.rest=e("macro"),i["literal-block"].inside.rest=e("callout"),i.table.inside.rest=e("comment-block passthrough-block literal-block other-block list-punctuation indented-block comment title attribute-entry attributes hr page-break admonition list-label callout macro inline replacement entity line-continuation"),i["other-block"].inside.rest=e("table list-punctuation indented-block comment attribute-entry attributes hr page-break admonition list-label macro inline replacement entity line-continuation"),i.title.inside.rest=e("macro inline replacement entity"),t.hooks.add("wrap",(function(t){"entity"===t.type&&(t.attributes.title=t.content.replace(/&/,"&"))})),t.languages.adoc=t.languages.asciidoc}(Prism); |
|||
@ -0,0 +1,29 @@ |
|||
Prism.languages.asm6502 = { |
|||
'comment': /;.*/, |
|||
'directive': { |
|||
pattern: /\.\w+(?= )/, |
|||
alias: 'property' |
|||
}, |
|||
'string': /(["'`])(?:\\.|(?!\1)[^\\\r\n])*\1/, |
|||
'op-code': { |
|||
pattern: /\b(?:ADC|AND|ASL|BCC|BCS|BEQ|BIT|BMI|BNE|BPL|BRK|BVC|BVS|CLC|CLD|CLI|CLV|CMP|CPX|CPY|DEC|DEX|DEY|EOR|INC|INX|INY|JMP|JSR|LDA|LDX|LDY|LSR|NOP|ORA|PHA|PHP|PLA|PLP|ROL|ROR|RTI|RTS|SBC|SEC|SED|SEI|STA|STX|STY|TAX|TAY|TSX|TXA|TXS|TYA|adc|and|asl|bcc|bcs|beq|bit|bmi|bne|bpl|brk|bvc|bvs|clc|cld|cli|clv|cmp|cpx|cpy|dec|dex|dey|eor|inc|inx|iny|jmp|jsr|lda|ldx|ldy|lsr|nop|ora|pha|php|pla|plp|rol|ror|rti|rts|sbc|sec|sed|sei|sta|stx|sty|tax|tay|tsx|txa|txs|tya)\b/, |
|||
alias: 'keyword' |
|||
}, |
|||
'hex-number': { |
|||
pattern: /#?\$[\da-f]{1,4}\b/i, |
|||
alias: 'number' |
|||
}, |
|||
'binary-number': { |
|||
pattern: /#?%[01]+\b/, |
|||
alias: 'number' |
|||
}, |
|||
'decimal-number': { |
|||
pattern: /#?\b\d+\b/, |
|||
alias: 'number' |
|||
}, |
|||
'register': { |
|||
pattern: /\b[xya]\b/i, |
|||
alias: 'variable' |
|||
}, |
|||
'punctuation': /[(),:]/ |
|||
}; |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.asm6502={comment:/;.*/,directive:{pattern:/\.\w+(?= )/,alias:"property"},string:/(["'`])(?:\\.|(?!\1)[^\\\r\n])*\1/,"op-code":{pattern:/\b(?:ADC|AND|ASL|BCC|BCS|BEQ|BIT|BMI|BNE|BPL|BRK|BVC|BVS|CLC|CLD|CLI|CLV|CMP|CPX|CPY|DEC|DEX|DEY|EOR|INC|INX|INY|JMP|JSR|LDA|LDX|LDY|LSR|NOP|ORA|PHA|PHP|PLA|PLP|ROL|ROR|RTI|RTS|SBC|SEC|SED|SEI|STA|STX|STY|TAX|TAY|TSX|TXA|TXS|TYA|adc|and|asl|bcc|bcs|beq|bit|bmi|bne|bpl|brk|bvc|bvs|clc|cld|cli|clv|cmp|cpx|cpy|dec|dex|dey|eor|inc|inx|iny|jmp|jsr|lda|ldx|ldy|lsr|nop|ora|pha|php|pla|plp|rol|ror|rti|rts|sbc|sec|sed|sei|sta|stx|sty|tax|tay|tsx|txa|txs|tya)\b/,alias:"keyword"},"hex-number":{pattern:/#?\$[\da-f]{1,4}\b/i,alias:"number"},"binary-number":{pattern:/#?%[01]+\b/,alias:"number"},"decimal-number":{pattern:/#?\b\d+\b/,alias:"number"},register:{pattern:/\b[xya]\b/i,alias:"variable"},punctuation:/[(),:]/}; |
|||
@ -0,0 +1,43 @@ |
|||
Prism.languages.asmatmel = { |
|||
'comment': { |
|||
pattern: /;.*/, |
|||
greedy: true |
|||
}, |
|||
'string': { |
|||
pattern: /(["'`])(?:\\.|(?!\1)[^\\\r\n])*\1/, |
|||
greedy: true |
|||
}, |
|||
|
|||
'constant': /\b(?:PORT[A-Z]|DDR[A-Z]|(?:DD|P)[A-Z](?:\d|[0-2]\d|3[01]))\b/, |
|||
|
|||
'directive': { |
|||
pattern: /\.\w+(?= )/, |
|||
alias: 'property' |
|||
}, |
|||
'r-register': { |
|||
pattern: /\br(?:\d|[12]\d|3[01])\b/, |
|||
alias: 'variable' |
|||
}, |
|||
'op-code': { |
|||
pattern: /\b(?:ADC|ADD|ADIW|AND|ANDI|ASR|BCLR|BLD|BRBC|BRBS|BRCC|BRCS|BREAK|BREQ|BRGE|BRHC|BRHS|BRID|BRIE|BRLO|BRLT|BRMI|BRNE|BRPL|BRSH|BRTC|BRTS|BRVC|BRVS|BSET|BST|CALL|CBI|CBR|CLC|CLH|CLI|CLN|CLR|CLS|CLT|CLV|CLZ|COM|CP|CPC|CPI|CPSE|DEC|DES|EICALL|EIJMP|ELPM|EOR|FMUL|FMULS|FMULSU|ICALL|IJMP|IN|INC|JMP|LAC|LAS|LAT|LD|LD[A-Za-z0-9]|LPM|LSL|LSR|MOV|MOVW|MUL|MULS|MULSU|NEG|NOP|OR|ORI|OUT|POP|PUSH|RCALL|RET|RETI|RJMP|ROL|ROR|SBC|SBCI|SBI|SBIC|SBIS|SBIW|SBR|SBRC|SBRS|SEC|SEH|SEI|SEN|SER|SES|SET|SEV|SEZ|SLEEP|SPM|ST|ST[A-Z0-9]|SUB|SUBI|SWAP|TST|WDR|XCH|adc|add|adiw|and|andi|asr|bclr|bld|brbc|brbs|brcc|brcs|break|breq|brge|brhc|brhs|brid|brie|brlo|brlt|brmi|brne|brpl|brsh|brtc|brts|brvc|brvs|bset|bst|call|cbi|cbr|clc|clh|cli|cln|clr|cls|clt|clv|clz|com|cp|cpc|cpi|cpse|dec|des|eicall|eijmp|elpm|eor|fmul|fmuls|fmulsu|icall|ijmp|in|inc|jmp|lac|las|lat|ld|ld[a-z0-9]|lpm|lsl|lsr|mov|movw|mul|muls|mulsu|neg|nop|or|ori|out|pop|push|rcall|ret|reti|rjmp|rol|ror|sbc|sbci|sbi|sbic|sbis|sbiw|sbr|sbrc|sbrs|sec|seh|sei|sen|ser|ses|set|sev|sez|sleep|spm|st|st[a-zA-Z0-9]|sub|subi|swap|tst|wdr|xch)\b/, |
|||
alias: 'keyword' |
|||
}, |
|||
'hex-number': { |
|||
pattern: /#?\$[\da-f]{2,4}\b/i, |
|||
alias: 'number' |
|||
}, |
|||
'binary-number': { |
|||
pattern: /#?%[01]+\b/, |
|||
alias: 'number' |
|||
}, |
|||
'decimal-number': { |
|||
pattern: /#?\b\d+\b/, |
|||
alias: 'number' |
|||
}, |
|||
'register': { |
|||
pattern: /\b[acznvshtixy]\b/i, |
|||
alias: 'variable' |
|||
}, |
|||
'operator': />>=?|<<=?|&[&=]?|\|[\|=]?|[-+*/%^!=<>?]=?/, |
|||
'punctuation': /[(),:]/ |
|||
}; |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.asmatmel={comment:{pattern:/;.*/,greedy:!0},string:{pattern:/(["'`])(?:\\.|(?!\1)[^\\\r\n])*\1/,greedy:!0},constant:/\b(?:PORT[A-Z]|DDR[A-Z]|(?:DD|P)[A-Z](?:\d|[0-2]\d|3[01]))\b/,directive:{pattern:/\.\w+(?= )/,alias:"property"},"r-register":{pattern:/\br(?:\d|[12]\d|3[01])\b/,alias:"variable"},"op-code":{pattern:/\b(?:ADC|ADD|ADIW|AND|ANDI|ASR|BCLR|BLD|BRBC|BRBS|BRCC|BRCS|BREAK|BREQ|BRGE|BRHC|BRHS|BRID|BRIE|BRLO|BRLT|BRMI|BRNE|BRPL|BRSH|BRTC|BRTS|BRVC|BRVS|BSET|BST|CALL|CBI|CBR|CLC|CLH|CLI|CLN|CLR|CLS|CLT|CLV|CLZ|COM|CP|CPC|CPI|CPSE|DEC|DES|EICALL|EIJMP|ELPM|EOR|FMUL|FMULS|FMULSU|ICALL|IJMP|IN|INC|JMP|LAC|LAS|LAT|LD|LD[A-Za-z0-9]|LPM|LSL|LSR|MOV|MOVW|MUL|MULS|MULSU|NEG|NOP|OR|ORI|OUT|POP|PUSH|RCALL|RET|RETI|RJMP|ROL|ROR|SBC|SBCI|SBI|SBIC|SBIS|SBIW|SBR|SBRC|SBRS|SEC|SEH|SEI|SEN|SER|SES|SET|SEV|SEZ|SLEEP|SPM|ST|ST[A-Z0-9]|SUB|SUBI|SWAP|TST|WDR|XCH|adc|add|adiw|and|andi|asr|bclr|bld|brbc|brbs|brcc|brcs|break|breq|brge|brhc|brhs|brid|brie|brlo|brlt|brmi|brne|brpl|brsh|brtc|brts|brvc|brvs|bset|bst|call|cbi|cbr|clc|clh|cli|cln|clr|cls|clt|clv|clz|com|cp|cpc|cpi|cpse|dec|des|eicall|eijmp|elpm|eor|fmul|fmuls|fmulsu|icall|ijmp|in|inc|jmp|lac|las|lat|ld|ld[a-z0-9]|lpm|lsl|lsr|mov|movw|mul|muls|mulsu|neg|nop|or|ori|out|pop|push|rcall|ret|reti|rjmp|rol|ror|sbc|sbci|sbi|sbic|sbis|sbiw|sbr|sbrc|sbrs|sec|seh|sei|sen|ser|ses|set|sev|sez|sleep|spm|st|st[a-zA-Z0-9]|sub|subi|swap|tst|wdr|xch)\b/,alias:"keyword"},"hex-number":{pattern:/#?\$[\da-f]{2,4}\b/i,alias:"number"},"binary-number":{pattern:/#?%[01]+\b/,alias:"number"},"decimal-number":{pattern:/#?\b\d+\b/,alias:"number"},register:{pattern:/\b[acznvshtixy]\b/i,alias:"variable"},operator:/>>=?|<<=?|&[&=]?|\|[\|=]?|[-+*/%^!=<>?]=?/,punctuation:/[(),:]/}; |
|||
@ -0,0 +1,48 @@ |
|||
Prism.languages.aspnet = Prism.languages.extend('markup', { |
|||
'page-directive': { |
|||
pattern: /<%\s*@.*%>/, |
|||
alias: 'tag', |
|||
inside: { |
|||
'page-directive': { |
|||
pattern: /<%\s*@\s*(?:Assembly|Control|Implements|Import|Master(?:Type)?|OutputCache|Page|PreviousPageType|Reference|Register)?|%>/i, |
|||
alias: 'tag' |
|||
}, |
|||
rest: Prism.languages.markup.tag.inside |
|||
} |
|||
}, |
|||
'directive': { |
|||
pattern: /<%.*%>/, |
|||
alias: 'tag', |
|||
inside: { |
|||
'directive': { |
|||
pattern: /<%\s*?[$=%#:]{0,2}|%>/, |
|||
alias: 'tag' |
|||
}, |
|||
rest: Prism.languages.csharp |
|||
} |
|||
} |
|||
}); |
|||
// Regexp copied from prism-markup, with a negative look-ahead added
|
|||
Prism.languages.aspnet.tag.pattern = /<(?!%)\/?[^\s>\/]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/; |
|||
|
|||
// match directives of attribute value foo="<% Bar %>"
|
|||
Prism.languages.insertBefore('inside', 'punctuation', { |
|||
'directive': Prism.languages.aspnet['directive'] |
|||
}, Prism.languages.aspnet.tag.inside['attr-value']); |
|||
|
|||
Prism.languages.insertBefore('aspnet', 'comment', { |
|||
'asp-comment': { |
|||
pattern: /<%--[\s\S]*?--%>/, |
|||
alias: ['asp', 'comment'] |
|||
} |
|||
}); |
|||
|
|||
// script runat="server" contains csharp, not javascript
|
|||
Prism.languages.insertBefore('aspnet', Prism.languages.javascript ? 'script' : 'tag', { |
|||
'asp-script': { |
|||
pattern: /(<script(?=.*runat=['"]?server\b)[^>]*>)[\s\S]*?(?=<\/script>)/i, |
|||
lookbehind: true, |
|||
alias: ['asp', 'script'], |
|||
inside: Prism.languages.csharp || {} |
|||
} |
|||
}); |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.aspnet=Prism.languages.extend("markup",{"page-directive":{pattern:/<%\s*@.*%>/,alias:"tag",inside:{"page-directive":{pattern:/<%\s*@\s*(?:Assembly|Control|Implements|Import|Master(?:Type)?|OutputCache|Page|PreviousPageType|Reference|Register)?|%>/i,alias:"tag"},rest:Prism.languages.markup.tag.inside}},directive:{pattern:/<%.*%>/,alias:"tag",inside:{directive:{pattern:/<%\s*?[$=%#:]{0,2}|%>/,alias:"tag"},rest:Prism.languages.csharp}}}),Prism.languages.aspnet.tag.pattern=/<(?!%)\/?[^\s>\/]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/,Prism.languages.insertBefore("inside","punctuation",{directive:Prism.languages.aspnet.directive},Prism.languages.aspnet.tag.inside["attr-value"]),Prism.languages.insertBefore("aspnet","comment",{"asp-comment":{pattern:/<%--[\s\S]*?--%>/,alias:["asp","comment"]}}),Prism.languages.insertBefore("aspnet",Prism.languages.javascript?"script":"tag",{"asp-script":{pattern:/(<script(?=.*runat=['"]?server\b)[^>]*>)[\s\S]*?(?=<\/script>)/i,lookbehind:!0,alias:["asp","script"],inside:Prism.languages.csharp||{}}}); |
|||
@ -0,0 +1,44 @@ |
|||
// 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': /[{}[\]():,]/ |
|||
}; |
|||
File diff suppressed because one or more lines are too long
@ -0,0 +1,34 @@ |
|||
Prism.languages.autoit = { |
|||
'comment': [ |
|||
/;.*/, |
|||
{ |
|||
// The multi-line comments delimiters can actually be commented out with ";"
|
|||
pattern: /(^[\t ]*)#(?:comments-start|cs)[\s\S]*?^[ \t]*#(?:ce|comments-end)/m, |
|||
lookbehind: true |
|||
} |
|||
], |
|||
'url': { |
|||
pattern: /(^[\t ]*#include\s+)(?:<[^\r\n>]+>|"[^\r\n"]+")/m, |
|||
lookbehind: true |
|||
}, |
|||
'string': { |
|||
pattern: /(["'])(?:\1\1|(?!\1)[^\r\n])*\1/, |
|||
greedy: true, |
|||
inside: { |
|||
'variable': /([%$@])\w+\1/ |
|||
} |
|||
}, |
|||
'directive': { |
|||
pattern: /(^[\t ]*)#[\w-]+/m, |
|||
lookbehind: true, |
|||
alias: 'keyword' |
|||
}, |
|||
'function': /\b\w+(?=\()/, |
|||
// Variables and macros
|
|||
'variable': /[$@]\w+/, |
|||
'keyword': /\b(?:Case|Const|Continue(?:Case|Loop)|Default|Dim|Do|Else(?:If)?|End(?:Func|If|Select|Switch|With)|Enum|Exit(?:Loop)?|For|Func|Global|If|In|Local|Next|Null|ReDim|Select|Static|Step|Switch|Then|To|Until|Volatile|WEnd|While|With)\b/i, |
|||
'number': /\b(?:0x[\da-f]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)\b/i, |
|||
'boolean': /\b(?:False|True)\b/i, |
|||
'operator': /<[=>]?|[-+*\/=&>]=?|[?^]|\b(?:And|Not|Or)\b/i, |
|||
'punctuation': /[\[\]().,:]/ |
|||
}; |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.autoit={comment:[/;.*/,{pattern:/(^[\t ]*)#(?:comments-start|cs)[\s\S]*?^[ \t]*#(?:ce|comments-end)/m,lookbehind:!0}],url:{pattern:/(^[\t ]*#include\s+)(?:<[^\r\n>]+>|"[^\r\n"]+")/m,lookbehind:!0},string:{pattern:/(["'])(?:\1\1|(?!\1)[^\r\n])*\1/,greedy:!0,inside:{variable:/([%$@])\w+\1/}},directive:{pattern:/(^[\t ]*)#[\w-]+/m,lookbehind:!0,alias:"keyword"},function:/\b\w+(?=\()/,variable:/[$@]\w+/,keyword:/\b(?:Case|Const|Continue(?:Case|Loop)|Default|Dim|Do|Else(?:If)?|End(?:Func|If|Select|Switch|With)|Enum|Exit(?:Loop)?|For|Func|Global|If|In|Local|Next|Null|ReDim|Select|Static|Step|Switch|Then|To|Until|Volatile|WEnd|While|With)\b/i,number:/\b(?:0x[\da-f]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)\b/i,boolean:/\b(?:False|True)\b/i,operator:/<[=>]?|[-+*\/=&>]=?|[?^]|\b(?:And|Not|Or)\b/i,punctuation:/[\[\]().,:]/}; |
|||
@ -0,0 +1,188 @@ |
|||
// http://avisynth.nl/index.php/The_full_AviSynth_grammar
|
|||
(function (Prism) { |
|||
|
|||
function replace(pattern, replacements) { |
|||
return pattern.replace(/<<(\d+)>>/g, function (m, index) { |
|||
return replacements[+index]; |
|||
}); |
|||
} |
|||
|
|||
function re(pattern, replacements, flags) { |
|||
return RegExp(replace(pattern, replacements), flags || ''); |
|||
} |
|||
|
|||
var types = /bool|clip|float|int|string|val/.source; |
|||
var internals = [ |
|||
// bools
|
|||
/is(?:bool|clip|float|int|string)|defined|(?:(?:internal)?function|var)?exists?/.source, |
|||
// control
|
|||
/apply|assert|default|eval|import|nop|select|undefined/.source, |
|||
// global
|
|||
/opt_(?:allowfloataudio|avipadscanlines|dwchannelmask|enable_(?:b64a|planartopackedrgb|v210|y3_10_10|y3_10_16)|usewaveextensible|vdubplanarhack)|set(?:cachemode|maxcpu|memorymax|planarlegacyalignment|workingdir)/.source, |
|||
// conv
|
|||
/hex(?:value)?|value/.source, |
|||
// numeric
|
|||
/abs|ceil|continued(?:denominator|numerator)?|exp|floor|fmod|frac|log(?:10)?|max|min|muldiv|pi|pow|rand|round|sign|spline|sqrt/.source, |
|||
// trig
|
|||
/a?sinh?|a?cosh?|a?tan[2h]?/.source, |
|||
// bit
|
|||
/(?:bit(?:and|not|x?or|[lr]?shift[aslu]?|sh[lr]|sa[lr]|[lr]rotatel?|ro[rl]|te?st|set(?:count)?|cl(?:ea)?r|ch(?:an)?ge?))/.source, |
|||
// runtime
|
|||
/average(?:[bgr]|chroma[uv]|luma)|(?:[rgb]|chroma[uv]|luma|rgb|[yuv](?=difference(?:fromprevious|tonext)))difference(?:fromprevious|tonext)?|[yuvrgb]plane(?:median|min|max|minmaxdifference)/.source, |
|||
// script
|
|||
/getprocessinfo|logmsg|script(?:dir(?:utf8)?|file(?:utf8)?|name(?:utf8)?)|setlogparams/.source, |
|||
// string
|
|||
/chr|(?:fill|find|left|mid|replace|rev|right)str|format|[lu]case|ord|str(?:cmpi?|fromutf8|len|toutf8)|time|trim(?:all|left|right)/.source, |
|||
// version
|
|||
/isversionorgreater|version(?:number|string)/.source, |
|||
// helper
|
|||
/buildpixeltype|colorspacenametopixeltype/.source, |
|||
// avsplus
|
|||
/addautoloaddir|on(?:cpu|cuda)|prefetch|setfiltermtmode/.source |
|||
].join('|'); |
|||
var properties = [ |
|||
// content
|
|||
/has(?:audio|video)/.source, |
|||
// resolution
|
|||
/height|width/.source, |
|||
// framerate
|
|||
/frame(?:count|rate)|framerate(?:denominator|numerator)/.source, |
|||
// interlacing
|
|||
/getparity|is(?:field|frame)based/.source, |
|||
// color format
|
|||
/bitspercomponent|componentsize|hasalpha|is(?:planar(?:rgba?)?|interleaved|rgb(?:24|32|48|64)?|y(?:8|u(?:va?|y2))?|yv(?:12|16|24|411)|420|422|444|packedrgb)|numcomponents|pixeltype/.source, |
|||
// audio
|
|||
/audio(?:bits|channels|duration|length(?:[fs]|hi|lo)?|rate)|isaudio(?:float|int)/.source |
|||
].join('|'); |
|||
var filters = [ |
|||
// source
|
|||
/avi(?:file)?source|directshowsource|image(?:reader|source|sourceanim)|opendmlsource|segmented(?:avisource|directshowsource)|wavsource/.source, |
|||
// color
|
|||
/coloryuv|convertbacktoyuy2|convertto(?:RGB(?:24|32|48|64)|(?:planar)?RGBA?|Y8?|YV(?:12|16|24|411)|YUVA?(?:411|420|422|444)|YUY2)|fixluminance|gr[ae]yscale|invert|levels|limiter|mergea?rgb|merge(?:chroma|luma)|rgbadjust|show(?:alpha|blue|green|red)|swapuv|tweak|[uv]toy8?|ytouv/.source, |
|||
// overlay
|
|||
/(?:colorkey|reset)mask|layer|mask(?:hs)?|merge|overlay|subtract/.source, |
|||
// geometry
|
|||
/addborders|(?:bicubic|bilinear|blackman|gauss|lanczos4|lanczos|point|sinc|spline(?:16|36|64))resize|crop(?:bottom)?|flip(?:horizontal|vertical)|(?:horizontal|vertical)?reduceby2|letterbox|skewrows|turn(?:180|left|right)/.source, |
|||
// pixel
|
|||
/blur|fixbrokenchromaupsampling|generalconvolution|(?:spatial|temporal)soften|sharpen/.source, |
|||
// timeline
|
|||
/trim|(?:un)?alignedsplice|(?:assume|assumescaled|change|convert)FPS|(?:delete|duplicate)frame|dissolve|fade(?:in|io|out)[02]?|freezeframe|interleave|loop|reverse|select(?:even|odd|(?:range)?every)/.source, |
|||
// interlace
|
|||
/assume[bt]ff|assume(?:field|frame)based|bob|complementparity|doubleweave|peculiarblend|pulldown|separate(?:columns|fields|rows)|swapfields|weave(?:columns|rows)?/.source, |
|||
// audio
|
|||
/amplify(?:db)?|assumesamplerate|audiodub(?:ex)?|audiotrim|convertaudioto(?:(?:8|16|24|32)bit|float)|converttomono|delayaudio|ensurevbrmp3sync|get(?:left|right)?channel|kill(?:audio|video)|mergechannels|mixaudio|monotostereo|normalize|resampleaudio|ssrc|supereq|timestretch/.source, |
|||
// conditional
|
|||
/animate|applyrange|conditional(?:filter|reader|select)|frameevaluate|scriptclip|tcp(?:server|source)|writefile(?:end|if|start)?/.source, |
|||
// export
|
|||
/imagewriter/.source, |
|||
// debug
|
|||
/blackness|blankclip|colorbars(?:hd)?|compare|dumpfiltergraph|echo|histogram|info|messageclip|preroll|setgraphanalysis|show(?:framenumber|smpte|time)|showfiveversions|stack(?:horizontal|vertical)|subtitle|tone|version/.source |
|||
].join('|'); |
|||
var allinternals = [internals, properties, filters].join('|'); |
|||
|
|||
Prism.languages.avisynth = { |
|||
'comment': [ |
|||
{ |
|||
// Matches [* *] nestable block comments, but only supports 1 level of nested comments
|
|||
// /\[\*(?:[^\[*]|\[(?!\*)|\*(?!\])|<self>)*\*\]/
|
|||
pattern: /(^|[^\\])\[\*(?:[^\[*]|\[(?!\*)|\*(?!\])|\[\*(?:[^\[*]|\[(?!\*)|\*(?!\]))*\*\])*\*\]/, |
|||
lookbehind: true, |
|||
greedy: true |
|||
}, |
|||
{ |
|||
// Matches /* */ block comments
|
|||
pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/, |
|||
lookbehind: true, |
|||
greedy: true |
|||
}, |
|||
{ |
|||
// Matches # comments
|
|||
pattern: /(^|[^\\$])#.*/, |
|||
lookbehind: true, |
|||
greedy: true |
|||
} |
|||
], |
|||
|
|||
// Handle before strings because optional arguments are surrounded by double quotes
|
|||
'argument': { |
|||
pattern: re(/\b(?:<<0>>)\s+("?)\w+\1/.source, [types], 'i'), |
|||
inside: { |
|||
'keyword': /^\w+/ |
|||
} |
|||
}, |
|||
|
|||
// Optional argument assignment
|
|||
'argument-label': { |
|||
pattern: /([,(][\s\\]*)\w+\s*=(?!=)/, |
|||
lookbehind: true, |
|||
inside: { |
|||
'argument-name': { |
|||
pattern: /^\w+/, |
|||
alias: 'punctuation' |
|||
}, |
|||
'punctuation': /=$/ |
|||
} |
|||
}, |
|||
|
|||
'string': [ |
|||
{ |
|||
// triple double-quoted
|
|||
pattern: /"""[\s\S]*?"""/, |
|||
greedy: true, |
|||
}, |
|||
{ |
|||
// single double-quoted
|
|||
pattern: /"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/, |
|||
greedy: true, |
|||
inside: { |
|||
'constant': { |
|||
// These *are* case-sensitive!
|
|||
pattern: /\b(?:DEFAULT_MT_MODE|(?:MAINSCRIPT|PROGRAM|SCRIPT)DIR|(?:MACHINE|USER)_(?:CLASSIC|PLUS)_PLUGINS)\b/ |
|||
} |
|||
} |
|||
} |
|||
], |
|||
|
|||
// The special "last" variable that takes the value of the last implicitly returned clip
|
|||
'variable': /\b(?:last)\b/i, |
|||
|
|||
'boolean': /\b(?:false|no|true|yes)\b/i, |
|||
|
|||
'keyword': /\b(?:catch|else|for|function|global|if|return|try|while|__END__)\b/i, |
|||
|
|||
'constant': /\bMT_(?:MULTI_INSTANCE|NICE_FILTER|SERIALIZED|SPECIAL_MT)\b/, |
|||
|
|||
// AviSynth's internal functions, filters, and properties
|
|||
'builtin-function': { |
|||
pattern: re(/\b(?:<<0>>)\b/.source, [allinternals], 'i'), |
|||
alias: 'function' |
|||
}, |
|||
|
|||
'type-cast': { |
|||
pattern: re(/\b(?:<<0>>)(?=\s*\()/.source, [types], 'i'), |
|||
alias: 'keyword' |
|||
}, |
|||
|
|||
// External/user-defined filters
|
|||
'function': { |
|||
pattern: /\b[a-z_]\w*(?=\s*\()|(\.)[a-z_]\w*\b/i, |
|||
lookbehind: true |
|||
}, |
|||
|
|||
// Matches a \ as the first or last character on a line
|
|||
'line-continuation': { |
|||
pattern: /(^[ \t]*)\\|\\(?=[ \t]*$)/m, |
|||
lookbehind: true, |
|||
alias: 'punctuation' |
|||
}, |
|||
|
|||
'number': /\B\$(?:[\da-f]{6}|[\da-f]{8})\b|(?:(?:\b|\B-)\d+(?:\.\d*)?\b|\B\.\d+\b)/i, |
|||
|
|||
'operator': /\+\+?|[!=<>]=?|&&|\|\||[?:*/%-]/, |
|||
|
|||
'punctuation': /[{}\[\]();,.]/ |
|||
}; |
|||
|
|||
Prism.languages.avs = Prism.languages.avisynth; |
|||
|
|||
}(Prism)); |
|||
File diff suppressed because one or more lines are too long
@ -0,0 +1,50 @@ |
|||
// GitHub: https://github.com/apache/avro
|
|||
// Docs: https://avro.apache.org/docs/current/idl.html
|
|||
|
|||
Prism.languages['avro-idl'] = { |
|||
'comment': { |
|||
pattern: /\/\/.*|\/\*[\s\S]*?\*\//, |
|||
greedy: true |
|||
}, |
|||
'string': { |
|||
pattern: /(^|[^\\])"(?:[^\r\n"\\]|\\.)*"/, |
|||
lookbehind: true, |
|||
greedy: true |
|||
}, |
|||
|
|||
'annotation': { |
|||
pattern: /@(?:[$\w.-]|`[^\r\n`]+`)+/, |
|||
greedy: true, |
|||
alias: 'function' |
|||
}, |
|||
'function-identifier': { |
|||
pattern: /`[^\r\n`]+`(?=\s*\()/, |
|||
greedy: true, |
|||
alias: 'function' |
|||
}, |
|||
'identifier': { |
|||
pattern: /`[^\r\n`]+`/, |
|||
greedy: true |
|||
}, |
|||
|
|||
'class-name': { |
|||
pattern: /(\b(?:enum|error|protocol|record|throws)\b\s+)[$\w]+/, |
|||
lookbehind: true, |
|||
greedy: true |
|||
}, |
|||
'keyword': /\b(?:array|boolean|bytes|date|decimal|double|enum|error|false|fixed|float|idl|import|int|local_timestamp_ms|long|map|null|oneway|protocol|record|schema|string|throws|time_ms|timestamp_ms|true|union|uuid|void)\b/, |
|||
'function': /\b[a-z_]\w*(?=\s*\()/i, |
|||
|
|||
'number': [ |
|||
{ |
|||
pattern: /(^|[^\w.])-?(?:(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|0x(?:[a-f0-9]+(?:\.[a-f0-9]*)?|\.[a-f0-9]+)(?:p[+-]?\d+)?)[dfl]?(?![\w.])/i, |
|||
lookbehind: true |
|||
}, |
|||
/-?\b(?:Infinity|NaN)\b/ |
|||
], |
|||
|
|||
'operator': /=/, |
|||
'punctuation': /[()\[\]{}<>.:,;-]/ |
|||
}; |
|||
|
|||
Prism.languages.avdl = Prism.languages['avro-idl']; |
|||
@ -0,0 +1 @@ |
|||
Prism.languages["avro-idl"]={comment:{pattern:/\/\/.*|\/\*[\s\S]*?\*\//,greedy:!0},string:{pattern:/(^|[^\\])"(?:[^\r\n"\\]|\\.)*"/,lookbehind:!0,greedy:!0},annotation:{pattern:/@(?:[$\w.-]|`[^\r\n`]+`)+/,greedy:!0,alias:"function"},"function-identifier":{pattern:/`[^\r\n`]+`(?=\s*\()/,greedy:!0,alias:"function"},identifier:{pattern:/`[^\r\n`]+`/,greedy:!0},"class-name":{pattern:/(\b(?:enum|error|protocol|record|throws)\b\s+)[$\w]+/,lookbehind:!0,greedy:!0},keyword:/\b(?:array|boolean|bytes|date|decimal|double|enum|error|false|fixed|float|idl|import|int|local_timestamp_ms|long|map|null|oneway|protocol|record|schema|string|throws|time_ms|timestamp_ms|true|union|uuid|void)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:[{pattern:/(^|[^\w.])-?(?:(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|0x(?:[a-f0-9]+(?:\.[a-f0-9]*)?|\.[a-f0-9]+)(?:p[+-]?\d+)?)[dfl]?(?![\w.])/i,lookbehind:!0},/-?\b(?:Infinity|NaN)\b/],operator:/=/,punctuation:/[()\[\]{}<>.:,;-]/},Prism.languages.avdl=Prism.languages["avro-idl"]; |
|||
@ -0,0 +1,32 @@ |
|||
Prism.languages.awk = { |
|||
'hashbang': { |
|||
pattern: /^#!.*/, |
|||
greedy: true, |
|||
alias: 'comment' |
|||
}, |
|||
'comment': { |
|||
pattern: /#.*/, |
|||
greedy: true |
|||
}, |
|||
'string': { |
|||
pattern: /(^|[^\\])"(?:[^\\"\r\n]|\\.)*"/, |
|||
lookbehind: true, |
|||
greedy: true |
|||
}, |
|||
'regex': { |
|||
pattern: /((?:^|[^\w\s)])\s*)\/(?:[^\/\\\r\n]|\\.)*\//, |
|||
lookbehind: true, |
|||
greedy: true |
|||
}, |
|||
|
|||
'variable': /\$\w+/, |
|||
'keyword': /\b(?:BEGIN|BEGINFILE|END|ENDFILE|break|case|continue|default|delete|do|else|exit|for|function|getline|if|in|next|nextfile|printf?|return|switch|while)\b|@(?:include|load)\b/, |
|||
|
|||
'function': /\b[a-z_]\w*(?=\s*\()/i, |
|||
'number': /\b(?:\d+(?:\.\d+)?(?:e[+-]?\d+)?|0x[a-fA-F0-9]+)\b/, |
|||
|
|||
'operator': /--|\+\+|!?~|>&|>>|<<|(?:\*\*|[<>!=+\-*/%^])=?|&&|\|[|&]|[?:]/, |
|||
'punctuation': /[()[\]{},;]/ |
|||
}; |
|||
|
|||
Prism.languages.gawk = Prism.languages.awk; |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.awk={hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},comment:{pattern:/#.*/,greedy:!0},string:{pattern:/(^|[^\\])"(?:[^\\"\r\n]|\\.)*"/,lookbehind:!0,greedy:!0},regex:{pattern:/((?:^|[^\w\s)])\s*)\/(?:[^\/\\\r\n]|\\.)*\//,lookbehind:!0,greedy:!0},variable:/\$\w+/,keyword:/\b(?:BEGIN|BEGINFILE|END|ENDFILE|break|case|continue|default|delete|do|else|exit|for|function|getline|if|in|next|nextfile|printf?|return|switch|while)\b|@(?:include|load)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/\b(?:\d+(?:\.\d+)?(?:e[+-]?\d+)?|0x[a-fA-F0-9]+)\b/,operator:/--|\+\+|!?~|>&|>>|<<|(?:\*\*|[<>!=+\-*/%^])=?|&&|\|[|&]|[?:]/,punctuation:/[()[\]{},;]/},Prism.languages.gawk=Prism.languages.awk; |
|||
@ -0,0 +1,235 @@ |
|||
(function (Prism) { |
|||
// $ set | grep '^[A-Z][^[:space:]]*=' | cut -d= -f1 | tr '\n' '|'
|
|||
// + LC_ALL, RANDOM, REPLY, SECONDS.
|
|||
// + make sure PS1..4 are here as they are not always set,
|
|||
// - some useless things.
|
|||
var envVars = '\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b'; |
|||
|
|||
var commandAfterHeredoc = { |
|||
pattern: /(^(["']?)\w+\2)[ \t]+\S.*/, |
|||
lookbehind: true, |
|||
alias: 'punctuation', // this looks reasonably well in all themes
|
|||
inside: null // see below
|
|||
}; |
|||
|
|||
var insideString = { |
|||
'bash': commandAfterHeredoc, |
|||
'environment': { |
|||
pattern: RegExp('\\$' + envVars), |
|||
alias: 'constant' |
|||
}, |
|||
'variable': [ |
|||
// [0]: Arithmetic Environment
|
|||
{ |
|||
pattern: /\$?\(\([\s\S]+?\)\)/, |
|||
greedy: true, |
|||
inside: { |
|||
// If there is a $ sign at the beginning highlight $(( and )) as variable
|
|||
'variable': [ |
|||
{ |
|||
pattern: /(^\$\(\([\s\S]+)\)\)/, |
|||
lookbehind: true |
|||
}, |
|||
/^\$\(\(/ |
|||
], |
|||
'number': /\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/, |
|||
// Operators according to https://www.gnu.org/software/bash/manual/bashref.html#Shell-Arithmetic
|
|||
'operator': /--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/, |
|||
// If there is no $ sign at the beginning highlight (( and )) as punctuation
|
|||
'punctuation': /\(\(?|\)\)?|,|;/ |
|||
} |
|||
}, |
|||
// [1]: Command Substitution
|
|||
{ |
|||
pattern: /\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/, |
|||
greedy: true, |
|||
inside: { |
|||
'variable': /^\$\(|^`|\)$|`$/ |
|||
} |
|||
}, |
|||
// [2]: Brace expansion
|
|||
{ |
|||
pattern: /\$\{[^}]+\}/, |
|||
greedy: true, |
|||
inside: { |
|||
'operator': /:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/, |
|||
'punctuation': /[\[\]]/, |
|||
'environment': { |
|||
pattern: RegExp('(\\{)' + envVars), |
|||
lookbehind: true, |
|||
alias: 'constant' |
|||
} |
|||
} |
|||
}, |
|||
/\$(?:\w+|[#?*!@$])/ |
|||
], |
|||
// Escape sequences from echo and printf's manuals, and escaped quotes.
|
|||
'entity': /\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/ |
|||
}; |
|||
|
|||
Prism.languages.bash = { |
|||
'shebang': { |
|||
pattern: /^#!\s*\/.*/, |
|||
alias: 'important' |
|||
}, |
|||
'comment': { |
|||
pattern: /(^|[^"{\\$])#.*/, |
|||
lookbehind: true |
|||
}, |
|||
'function-name': [ |
|||
// a) function foo {
|
|||
// b) foo() {
|
|||
// c) function foo() {
|
|||
// but not “foo {”
|
|||
{ |
|||
// a) and c)
|
|||
pattern: /(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/, |
|||
lookbehind: true, |
|||
alias: 'function' |
|||
}, |
|||
{ |
|||
// b)
|
|||
pattern: /\b[\w-]+(?=\s*\(\s*\)\s*\{)/, |
|||
alias: 'function' |
|||
} |
|||
], |
|||
// Highlight variable names as variables in for and select beginnings.
|
|||
'for-or-select': { |
|||
pattern: /(\b(?:for|select)\s+)\w+(?=\s+in\s)/, |
|||
alias: 'variable', |
|||
lookbehind: true |
|||
}, |
|||
// Highlight variable names as variables in the left-hand part
|
|||
// of assignments (“=” and “+=”).
|
|||
'assign-left': { |
|||
pattern: /(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/, |
|||
inside: { |
|||
'environment': { |
|||
pattern: RegExp('(^|[\\s;|&]|[<>]\\()' + envVars), |
|||
lookbehind: true, |
|||
alias: 'constant' |
|||
} |
|||
}, |
|||
alias: 'variable', |
|||
lookbehind: true |
|||
}, |
|||
// Highlight parameter names as variables
|
|||
'parameter': { |
|||
pattern: /(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/, |
|||
alias: 'variable', |
|||
lookbehind: true |
|||
}, |
|||
'string': [ |
|||
// Support for Here-documents https://en.wikipedia.org/wiki/Here_document
|
|||
{ |
|||
pattern: /((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/, |
|||
lookbehind: true, |
|||
greedy: true, |
|||
inside: insideString |
|||
}, |
|||
// Here-document with quotes around the tag
|
|||
// → No expansion (so no “inside”).
|
|||
{ |
|||
pattern: /((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/, |
|||
lookbehind: true, |
|||
greedy: true, |
|||
inside: { |
|||
'bash': commandAfterHeredoc |
|||
} |
|||
}, |
|||
// “Normal” string
|
|||
{ |
|||
// https://www.gnu.org/software/bash/manual/html_node/Double-Quotes.html
|
|||
pattern: /(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/, |
|||
lookbehind: true, |
|||
greedy: true, |
|||
inside: insideString |
|||
}, |
|||
{ |
|||
// https://www.gnu.org/software/bash/manual/html_node/Single-Quotes.html
|
|||
pattern: /(^|[^$\\])'[^']*'/, |
|||
lookbehind: true, |
|||
greedy: true |
|||
}, |
|||
{ |
|||
// https://www.gnu.org/software/bash/manual/html_node/ANSI_002dC-Quoting.html
|
|||
pattern: /\$'(?:[^'\\]|\\[\s\S])*'/, |
|||
greedy: true, |
|||
inside: { |
|||
'entity': insideString.entity |
|||
} |
|||
} |
|||
], |
|||
'environment': { |
|||
pattern: RegExp('\\$?' + envVars), |
|||
alias: 'constant' |
|||
}, |
|||
'variable': insideString.variable, |
|||
'function': { |
|||
pattern: /(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/, |
|||
lookbehind: true |
|||
}, |
|||
'keyword': { |
|||
pattern: /(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/, |
|||
lookbehind: true |
|||
}, |
|||
// https://www.gnu.org/software/bash/manual/html_node/Shell-Builtin-Commands.html
|
|||
'builtin': { |
|||
pattern: /(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/, |
|||
lookbehind: true, |
|||
// Alias added to make those easier to distinguish from strings.
|
|||
alias: 'class-name' |
|||
}, |
|||
'boolean': { |
|||
pattern: /(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/, |
|||
lookbehind: true |
|||
}, |
|||
'file-descriptor': { |
|||
pattern: /\B&\d\b/, |
|||
alias: 'important' |
|||
}, |
|||
'operator': { |
|||
// Lots of redirections here, but not just that.
|
|||
pattern: /\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/, |
|||
inside: { |
|||
'file-descriptor': { |
|||
pattern: /^\d/, |
|||
alias: 'important' |
|||
} |
|||
} |
|||
}, |
|||
'punctuation': /\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/, |
|||
'number': { |
|||
pattern: /(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/, |
|||
lookbehind: true |
|||
} |
|||
}; |
|||
|
|||
commandAfterHeredoc.inside = Prism.languages.bash; |
|||
|
|||
/* Patterns in command substitution. */ |
|||
var toBeCopied = [ |
|||
'comment', |
|||
'function-name', |
|||
'for-or-select', |
|||
'assign-left', |
|||
'parameter', |
|||
'string', |
|||
'environment', |
|||
'function', |
|||
'keyword', |
|||
'builtin', |
|||
'boolean', |
|||
'file-descriptor', |
|||
'operator', |
|||
'punctuation', |
|||
'number' |
|||
]; |
|||
var inside = insideString.variable[1].inside; |
|||
for (var i = 0; i < toBeCopied.length; i++) { |
|||
inside[toBeCopied[i]] = Prism.languages.bash[toBeCopied[i]]; |
|||
} |
|||
|
|||
Prism.languages.sh = Prism.languages.bash; |
|||
Prism.languages.shell = Prism.languages.bash; |
|||
}(Prism)); |
|||
File diff suppressed because one or more lines are too long
@ -0,0 +1,17 @@ |
|||
Prism.languages.basic = { |
|||
'comment': { |
|||
pattern: /(?:!|REM\b).+/i, |
|||
inside: { |
|||
'keyword': /^REM/i |
|||
} |
|||
}, |
|||
'string': { |
|||
pattern: /"(?:""|[!#$%&'()*,\/:;<=>?^\w +\-.])*"/, |
|||
greedy: true |
|||
}, |
|||
'number': /(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i, |
|||
'keyword': /\b(?:AS|BEEP|BLOAD|BSAVE|CALL(?: ABSOLUTE)?|CASE|CHAIN|CHDIR|CLEAR|CLOSE|CLS|COM|COMMON|CONST|DATA|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DIM|DO|DOUBLE|ELSE|ELSEIF|END|ENVIRON|ERASE|ERROR|EXIT|FIELD|FILES|FOR|FUNCTION|GET|GOSUB|GOTO|IF|INPUT|INTEGER|IOCTL|KEY|KILL|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|MKDIR|NAME|NEXT|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPTION BASE|OUT|POKE|PUT|READ|REDIM|REM|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SELECT CASE|SHARED|SHELL|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|SUB|SWAP|SYSTEM|THEN|TIMER|TO|TROFF|TRON|TYPE|UNLOCK|UNTIL|USING|VIEW PRINT|WAIT|WEND|WHILE|WRITE)(?:\$|\b)/i, |
|||
'function': /\b(?:ABS|ACCESS|ACOS|ANGLE|AREA|ARITHMETIC|ARRAY|ASIN|ASK|AT|ATN|BASE|BEGIN|BREAK|CAUSE|CEIL|CHR|CLIP|COLLATE|COLOR|CON|COS|COSH|COT|CSC|DATE|DATUM|DEBUG|DECIMAL|DEF|DEG|DEGREES|DELETE|DET|DEVICE|DISPLAY|DOT|ELAPSED|EPS|ERASABLE|EXLINE|EXP|EXTERNAL|EXTYPE|FILETYPE|FIXED|FP|GO|GRAPH|HANDLER|IDN|IMAGE|IN|INT|INTERNAL|IP|IS|KEYED|LBOUND|LCASE|LEFT|LEN|LENGTH|LET|LINE|LINES|LOG|LOG10|LOG2|LTRIM|MARGIN|MAT|MAX|MAXNUM|MID|MIN|MISSING|MOD|NATIVE|NUL|NUMERIC|OF|OPTION|ORD|ORGANIZATION|OUTIN|OUTPUT|PI|POINT|POINTER|POINTS|POS|PRINT|PROGRAM|PROMPT|RAD|RADIANS|RANDOMIZE|RECORD|RECSIZE|RECTYPE|RELATIVE|REMAINDER|REPEAT|REST|RETRY|REWRITE|RIGHT|RND|ROUND|RTRIM|SAME|SEC|SELECT|SEQUENTIAL|SET|SETTER|SGN|SIN|SINH|SIZE|SKIP|SQR|STANDARD|STATUS|STR|STREAM|STYLE|TAB|TAN|TANH|TEMPLATE|TEXT|THERE|TIME|TIMEOUT|TRACE|TRANSFORM|TRUNCATE|UBOUND|UCASE|USE|VAL|VARIABLE|VIEWPORT|WHEN|WINDOW|WITH|ZER|ZONEWIDTH)(?:\$|\b)/i, |
|||
'operator': /<[=>]?|>=?|[+\-*\/^=&]|\b(?:AND|EQV|IMP|NOT|OR|XOR)\b/i, |
|||
'punctuation': /[,;:()]/ |
|||
}; |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.basic={comment:{pattern:/(?:!|REM\b).+/i,inside:{keyword:/^REM/i}},string:{pattern:/"(?:""|[!#$%&'()*,\/:;<=>?^\w +\-.])*"/,greedy:!0},number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i,keyword:/\b(?:AS|BEEP|BLOAD|BSAVE|CALL(?: ABSOLUTE)?|CASE|CHAIN|CHDIR|CLEAR|CLOSE|CLS|COM|COMMON|CONST|DATA|DECLARE|DEF(?: FN| SEG|DBL|INT|LNG|SNG|STR)|DIM|DO|DOUBLE|ELSE|ELSEIF|END|ENVIRON|ERASE|ERROR|EXIT|FIELD|FILES|FOR|FUNCTION|GET|GOSUB|GOTO|IF|INPUT|INTEGER|IOCTL|KEY|KILL|LINE INPUT|LOCATE|LOCK|LONG|LOOP|LSET|MKDIR|NAME|NEXT|OFF|ON(?: COM| ERROR| KEY| TIMER)?|OPEN|OPTION BASE|OUT|POKE|PUT|READ|REDIM|REM|RESTORE|RESUME|RETURN|RMDIR|RSET|RUN|SELECT CASE|SHARED|SHELL|SINGLE|SLEEP|STATIC|STEP|STOP|STRING|SUB|SWAP|SYSTEM|THEN|TIMER|TO|TROFF|TRON|TYPE|UNLOCK|UNTIL|USING|VIEW PRINT|WAIT|WEND|WHILE|WRITE)(?:\$|\b)/i,function:/\b(?:ABS|ACCESS|ACOS|ANGLE|AREA|ARITHMETIC|ARRAY|ASIN|ASK|AT|ATN|BASE|BEGIN|BREAK|CAUSE|CEIL|CHR|CLIP|COLLATE|COLOR|CON|COS|COSH|COT|CSC|DATE|DATUM|DEBUG|DECIMAL|DEF|DEG|DEGREES|DELETE|DET|DEVICE|DISPLAY|DOT|ELAPSED|EPS|ERASABLE|EXLINE|EXP|EXTERNAL|EXTYPE|FILETYPE|FIXED|FP|GO|GRAPH|HANDLER|IDN|IMAGE|IN|INT|INTERNAL|IP|IS|KEYED|LBOUND|LCASE|LEFT|LEN|LENGTH|LET|LINE|LINES|LOG|LOG10|LOG2|LTRIM|MARGIN|MAT|MAX|MAXNUM|MID|MIN|MISSING|MOD|NATIVE|NUL|NUMERIC|OF|OPTION|ORD|ORGANIZATION|OUTIN|OUTPUT|PI|POINT|POINTER|POINTS|POS|PRINT|PROGRAM|PROMPT|RAD|RADIANS|RANDOMIZE|RECORD|RECSIZE|RECTYPE|RELATIVE|REMAINDER|REPEAT|REST|RETRY|REWRITE|RIGHT|RND|ROUND|RTRIM|SAME|SEC|SELECT|SEQUENTIAL|SET|SETTER|SGN|SIN|SINH|SIZE|SKIP|SQR|STANDARD|STATUS|STR|STREAM|STYLE|TAB|TAN|TANH|TEMPLATE|TEXT|THERE|TIME|TIMEOUT|TRACE|TRANSFORM|TRUNCATE|UBOUND|UCASE|USE|VAL|VARIABLE|VIEWPORT|WHEN|WINDOW|WITH|ZER|ZONEWIDTH)(?:\$|\b)/i,operator:/<[=>]?|>=?|[+\-*\/^=&]|\b(?:AND|EQV|IMP|NOT|OR|XOR)\b/i,punctuation:/[,;:()]/}; |
|||
@ -0,0 +1,99 @@ |
|||
(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)); |
|||
@ -0,0 +1 @@ |
|||
!function(e){var r=/%%?[~:\w]+%?|!\S+!/,t={pattern:/\/[a-z?]+(?=[ :]|$):?|-[a-z]\b|--[a-z-]+\b/im,alias:"attr-name",inside:{punctuation:/:/}},n=/"(?:[\\"]"|[^"])*"(?!")/,i=/(?:\b|-)\d+\b/;e.languages.batch={comment:[/^::.*/m,{pattern:/((?:^|[&(])[ \t]*)rem\b(?:[^^&)\r\n]|\^(?:\r\n|[\s\S]))*/im,lookbehind:!0}],label:{pattern:/^:.*/m,alias:"property"},command:[{pattern:/((?:^|[&(])[ \t]*)for(?: \/[a-z?](?:[ :](?:"[^"]*"|[^\s"/]\S*))?)* \S+ in \([^)]+\) do/im,lookbehind:!0,inside:{keyword:/\b(?:do|in)\b|^for\b/i,string:n,parameter:t,variable:r,number:i,punctuation:/[()',]/}},{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:!0,inside:{keyword:/\b(?:cmdextversion|defined|errorlevel|exist|not)\b|^if\b/i,string:n,parameter:t,variable:r,number:i,operator:/\^|==|\b(?:equ|geq|gtr|leq|lss|neq)\b/i}},{pattern:/((?:^|[&()])[ \t]*)else\b/im,lookbehind:!0,inside:{keyword:/^else\b/i}},{pattern:/((?:^|[&(])[ \t]*)set(?: \/[a-z](?:[ :](?:"[^"]*"|[^\s"/]\S*))?)* (?:[^^&)\r\n]|\^(?:\r\n|[\s\S]))*/im,lookbehind:!0,inside:{keyword:/^set\b/i,string:n,parameter:t,variable:[r,/\w+(?=(?:[*\/%+\-&^|]|<<|>>)?=)/],number:i,operator:/[*\/%+\-&^|]=?|<<=?|>>=?|[!~_=]/,punctuation:/[()',]/}},{pattern:/((?:^|[&(])[ \t]*@?)\w+\b(?:"(?:[\\"]"|[^"])*"(?!")|[^"^&)\r\n]|\^(?:\r\n|[\s\S]))*/m,lookbehind:!0,inside:{keyword:/^\w+\b/,string:n,parameter:t,label:{pattern:/(^\s*):\S+/m,lookbehind:!0,alias:"property"},variable:r,number:i,operator:/\^/}}],operator:/[&@]/,punctuation:/[()']/}}(Prism); |
|||
@ -0,0 +1,29 @@ |
|||
Prism.languages.bbcode = { |
|||
'tag': { |
|||
pattern: /\[\/?[^\s=\]]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'"\]=]+))?(?:\s+[^\s=\]]+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'"\]=]+))*\s*\]/, |
|||
inside: { |
|||
'tag': { |
|||
pattern: /^\[\/?[^\s=\]]+/, |
|||
inside: { |
|||
'punctuation': /^\[\/?/ |
|||
} |
|||
}, |
|||
'attr-value': { |
|||
pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'"\]=]+)/, |
|||
inside: { |
|||
'punctuation': [ |
|||
/^=/, |
|||
{ |
|||
pattern: /^(\s*)["']|["']$/, |
|||
lookbehind: true |
|||
} |
|||
] |
|||
} |
|||
}, |
|||
'punctuation': /\]/, |
|||
'attr-name': /[^\s=\]]+/ |
|||
} |
|||
} |
|||
}; |
|||
|
|||
Prism.languages.shortcode = Prism.languages.bbcode; |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.bbcode={tag:{pattern:/\[\/?[^\s=\]]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'"\]=]+))?(?:\s+[^\s=\]]+\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'"\]=]+))*\s*\]/,inside:{tag:{pattern:/^\[\/?[^\s=\]]+/,inside:{punctuation:/^\[\/?/}},"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'"\]=]+)/,inside:{punctuation:[/^=/,{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\]/,"attr-name":/[^\s=\]]+/}}},Prism.languages.shortcode=Prism.languages.bbcode; |
|||
@ -0,0 +1,19 @@ |
|||
(function (Prism) { |
|||
Prism.languages.bbj = { |
|||
'comment': { |
|||
pattern: /(^|[^\\:])rem\s+.*/i, |
|||
lookbehind: true, |
|||
greedy: true |
|||
}, |
|||
'string': { |
|||
pattern: /(['"])(?:(?!\1|\\).|\\.)*\1/, |
|||
greedy: true |
|||
}, |
|||
'number': /(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i, |
|||
'keyword': /\b(?:abstract|all|argc|begin|bye|callback|case|chn|class|classend|ctl|day|declare|delete|dim|dom|dread|dsz|else|end|endif|err|exitto|extends|fi|field|for|from|gosub|goto|if|implements|interface|interfaceend|iol|iolist|let|list|load|method|methodend|methodret|on|opts|pfx|print|private|process_events|protected|psz|public|read|read_resource|release|remove_callback|repeat|restore|return|rev|seterr|setesc|sqlchn|sqlunt|ssn|start|static|swend|switch|sys|then|tim|unt|until|use|void|wend|where|while)\b/i, |
|||
'function': /\b\w+(?=\()/, |
|||
'boolean': /\b(?:BBjAPI\.TRUE|BBjAPI\.FALSE)\b/i, |
|||
'operator': /<[=>]?|>=?|[+\-*\/^=&]|\b(?:and|not|or|xor)\b/i, |
|||
'punctuation': /[.,;:()]/ |
|||
}; |
|||
}(Prism)); |
|||
@ -0,0 +1 @@ |
|||
!function(e){e.languages.bbj={comment:{pattern:/(^|[^\\:])rem\s+.*/i,lookbehind:!0,greedy:!0},string:{pattern:/(['"])(?:(?!\1|\\).|\\.)*\1/,greedy:!0},number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i,keyword:/\b(?:abstract|all|argc|begin|bye|callback|case|chn|class|classend|ctl|day|declare|delete|dim|dom|dread|dsz|else|end|endif|err|exitto|extends|fi|field|for|from|gosub|goto|if|implements|interface|interfaceend|iol|iolist|let|list|load|method|methodend|methodret|on|opts|pfx|print|private|process_events|protected|psz|public|read|read_resource|release|remove_callback|repeat|restore|return|rev|seterr|setesc|sqlchn|sqlunt|ssn|start|static|swend|switch|sys|then|tim|unt|until|use|void|wend|where|while)\b/i,function:/\b\w+(?=\()/,boolean:/\b(?:BBjAPI\.TRUE|BBjAPI\.FALSE)\b/i,operator:/<[=>]?|>=?|[+\-*\/^=&]|\b(?:and|not|or|xor)\b/i,punctuation:/[.,;:()]/}}(Prism); |
|||
@ -0,0 +1,77 @@ |
|||
// based loosely upon: https://github.com/Azure/bicep/blob/main/src/textmate/bicep.tmlanguage
|
|||
Prism.languages.bicep = { |
|||
'comment': [ |
|||
{ |
|||
// multiline comments eg /* ASDF */
|
|||
pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/, |
|||
lookbehind: true, |
|||
greedy: true |
|||
}, |
|||
{ |
|||
// singleline comments eg // ASDF
|
|||
pattern: /(^|[^\\:])\/\/.*/, |
|||
lookbehind: true, |
|||
greedy: true |
|||
} |
|||
], |
|||
|
|||
'property': [ |
|||
{ |
|||
pattern: /([\r\n][ \t]*)[a-z_]\w*(?=[ \t]*:)/i, |
|||
lookbehind: true |
|||
}, |
|||
{ |
|||
pattern: /([\r\n][ \t]*)'(?:\\.|\$(?!\{)|[^'\\\r\n$])*'(?=[ \t]*:)/, |
|||
lookbehind: true, |
|||
greedy: true |
|||
} |
|||
], |
|||
'string': [ |
|||
{ |
|||
pattern: /'''[^'][\s\S]*?'''/, |
|||
greedy: true |
|||
}, |
|||
{ |
|||
pattern: /(^|[^\\'])'(?:\\.|\$(?!\{)|[^'\\\r\n$])*'/, |
|||
lookbehind: true, |
|||
greedy: true, |
|||
} |
|||
], |
|||
'interpolated-string': { |
|||
pattern: /(^|[^\\'])'(?:\\.|\$(?:(?!\{)|\{[^{}\r\n]*\})|[^'\\\r\n$])*'/, |
|||
lookbehind: true, |
|||
greedy: true, |
|||
inside: { |
|||
'interpolation': { |
|||
pattern: /\$\{[^{}\r\n]*\}/, |
|||
inside: { |
|||
'expression': { |
|||
pattern: /(^\$\{)[\s\S]+(?=\}$)/, |
|||
lookbehind: true |
|||
}, |
|||
'punctuation': /^\$\{|\}$/, |
|||
} |
|||
}, |
|||
'string': /[\s\S]+/ |
|||
} |
|||
}, |
|||
|
|||
'datatype': { |
|||
pattern: /(\b(?:output|param)\b[ \t]+\w+[ \t]+)\w+\b/, |
|||
lookbehind: true, |
|||
alias: 'class-name' |
|||
}, |
|||
|
|||
'boolean': /\b(?:false|true)\b/, |
|||
// https://github.com/Azure/bicep/blob/114a3251b4e6e30082a58729f19a8cc4e374ffa6/src/textmate/bicep.tmlanguage#L184
|
|||
'keyword': /\b(?:existing|for|if|in|module|null|output|param|resource|targetScope|var)\b/, |
|||
|
|||
'decorator': /@\w+\b/, |
|||
'function': /\b[a-z_]\w*(?=[ \t]*\()/i, |
|||
|
|||
'number': /(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i, |
|||
'operator': /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/, |
|||
'punctuation': /[{}[\];(),.:]/, |
|||
}; |
|||
|
|||
Prism.languages.bicep['interpolated-string'].inside['interpolation'].inside['expression'].inside = Prism.languages.bicep; |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.bicep={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],property:[{pattern:/([\r\n][ \t]*)[a-z_]\w*(?=[ \t]*:)/i,lookbehind:!0},{pattern:/([\r\n][ \t]*)'(?:\\.|\$(?!\{)|[^'\\\r\n$])*'(?=[ \t]*:)/,lookbehind:!0,greedy:!0}],string:[{pattern:/'''[^'][\s\S]*?'''/,greedy:!0},{pattern:/(^|[^\\'])'(?:\\.|\$(?!\{)|[^'\\\r\n$])*'/,lookbehind:!0,greedy:!0}],"interpolated-string":{pattern:/(^|[^\\'])'(?:\\.|\$(?:(?!\{)|\{[^{}\r\n]*\})|[^'\\\r\n$])*'/,lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/\$\{[^{}\r\n]*\}/,inside:{expression:{pattern:/(^\$\{)[\s\S]+(?=\}$)/,lookbehind:!0},punctuation:/^\$\{|\}$/}},string:/[\s\S]+/}},datatype:{pattern:/(\b(?:output|param)\b[ \t]+\w+[ \t]+)\w+\b/,lookbehind:!0,alias:"class-name"},boolean:/\b(?:false|true)\b/,keyword:/\b(?:existing|for|if|in|module|null|output|param|resource|targetScope|var)\b/,decorator:/@\w+\b/,function:/\b[a-z_]\w*(?=[ \t]*\()/i,number:/(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:E[+-]?\d+)?/i,operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/,punctuation:/[{}[\];(),.:]/},Prism.languages.bicep["interpolated-string"].inside.interpolation.inside.expression.inside=Prism.languages.bicep; |
|||
@ -0,0 +1,23 @@ |
|||
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' |
|||
} |
|||
}); |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.birb=Prism.languages.extend("clike",{string:{pattern:/r?("|')(?:\\.|(?!\1)[^\\])*\1/,greedy:!0},"class-name":[/\b[A-Z](?:[\d_]*[a-zA-Z]\w*)?\b/,/\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:!0,alias:"symbol"}}); |
|||
@ -0,0 +1,39 @@ |
|||
Prism.languages.bison = Prism.languages.extend('c', {}); |
|||
|
|||
Prism.languages.insertBefore('bison', 'comment', { |
|||
'bison': { |
|||
// This should match all the beginning of the file
|
|||
// including the prologue(s), the bison declarations and
|
|||
// the grammar rules.
|
|||
pattern: /^(?:[^%]|%(?!%))*%%[\s\S]*?%%/, |
|||
inside: { |
|||
'c': { |
|||
// Allow for one level of nested braces
|
|||
pattern: /%\{[\s\S]*?%\}|\{(?:\{[^}]*\}|[^{}])*\}/, |
|||
inside: { |
|||
'delimiter': { |
|||
pattern: /^%?\{|%?\}$/, |
|||
alias: 'punctuation' |
|||
}, |
|||
'bison-variable': { |
|||
pattern: /[$@](?:<[^\s>]+>)?[\w$]+/, |
|||
alias: 'variable', |
|||
inside: { |
|||
'punctuation': /<|>/ |
|||
} |
|||
}, |
|||
rest: Prism.languages.c |
|||
} |
|||
}, |
|||
'comment': Prism.languages.c.comment, |
|||
'string': Prism.languages.c.string, |
|||
'property': /\S+(?=:)/, |
|||
'keyword': /%\w+/, |
|||
'number': { |
|||
pattern: /(^|[^@])\b(?:0x[\da-f]+|\d+)/i, |
|||
lookbehind: true |
|||
}, |
|||
'punctuation': /%[%?]|[|:;\[\]<>]/ |
|||
} |
|||
} |
|||
}); |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.bison=Prism.languages.extend("c",{}),Prism.languages.insertBefore("bison","comment",{bison:{pattern:/^(?:[^%]|%(?!%))*%%[\s\S]*?%%/,inside:{c:{pattern:/%\{[\s\S]*?%\}|\{(?:\{[^}]*\}|[^{}])*\}/,inside:{delimiter:{pattern:/^%?\{|%?\}$/,alias:"punctuation"},"bison-variable":{pattern:/[$@](?:<[^\s>]+>)?[\w$]+/,alias:"variable",inside:{punctuation:/<|>/}},rest:Prism.languages.c}},comment:Prism.languages.c.comment,string:Prism.languages.c.string,property:/\S+(?=:)/,keyword:/%\w+/,number:{pattern:/(^|[^@])\b(?:0x[\da-f]+|\d+)/i,lookbehind:!0},punctuation:/%[%?]|[|:;\[\]<>]/}}}); |
|||
@ -0,0 +1,21 @@ |
|||
Prism.languages.bnf = { |
|||
'string': { |
|||
pattern: /"[^\r\n"]*"|'[^\r\n']*'/ |
|||
}, |
|||
'definition': { |
|||
pattern: /<[^<>\r\n\t]+>(?=\s*::=)/, |
|||
alias: ['rule', 'keyword'], |
|||
inside: { |
|||
'punctuation': /^<|>$/ |
|||
} |
|||
}, |
|||
'rule': { |
|||
pattern: /<[^<>\r\n\t]+>/, |
|||
inside: { |
|||
'punctuation': /^<|>$/ |
|||
} |
|||
}, |
|||
'operator': /::=|[|()[\]{}*+?]|\.{3}/ |
|||
}; |
|||
|
|||
Prism.languages.rbnf = Prism.languages.bnf; |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.bnf={string:{pattern:/"[^\r\n"]*"|'[^\r\n']*'/},definition:{pattern:/<[^<>\r\n\t]+>(?=\s*::=)/,alias:["rule","keyword"],inside:{punctuation:/^<|>$/}},rule:{pattern:/<[^<>\r\n\t]+>/,inside:{punctuation:/^<|>$/}},operator:/::=|[|()[\]{}*+?]|\.{3}/},Prism.languages.rbnf=Prism.languages.bnf; |
|||
@ -0,0 +1,63 @@ |
|||
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': /[←⇐↩(){}⟨⟩[\]‿·⋄,.;:?]/ |
|||
}; |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.bqn={shebang:{pattern:/^#![ \t]*\/.*/,alias:"important",greedy:!0},comment:{pattern:/#.*/,greedy:!0},"string-literal":{pattern:/"(?:[^"]|"")*"/,greedy:!0,alias:"string"},"character-literal":{pattern:/'(?:[\s\S]|[\uD800-\uDBFF][\uDC00-\uDFFF])'/,greedy:!0,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:/[←⇐↩(){}⟨⟩[\]‿·⋄,.;:?]/}; |
|||
@ -0,0 +1,20 @@ |
|||
Prism.languages.brainfuck = { |
|||
'pointer': { |
|||
pattern: /<|>/, |
|||
alias: 'keyword' |
|||
}, |
|||
'increment': { |
|||
pattern: /\+/, |
|||
alias: 'inserted' |
|||
}, |
|||
'decrement': { |
|||
pattern: /-/, |
|||
alias: 'deleted' |
|||
}, |
|||
'branching': { |
|||
pattern: /\[|\]/, |
|||
alias: 'important' |
|||
}, |
|||
'operator': /[.,]/, |
|||
'comment': /\S+/ |
|||
}; |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.brainfuck={pointer:{pattern:/<|>/,alias:"keyword"},increment:{pattern:/\+/,alias:"inserted"},decrement:{pattern:/-/,alias:"deleted"},branching:{pattern:/\[|\]/,alias:"important"},operator:/[.,]/,comment:/\S+/}; |
|||
@ -0,0 +1,44 @@ |
|||
Prism.languages.brightscript = { |
|||
'comment': /(?:\brem|').*/i, |
|||
'directive-statement': { |
|||
pattern: /(^[\t ]*)#(?:const|else(?:[\t ]+if)?|end[\t ]+if|error|if).*/im, |
|||
lookbehind: true, |
|||
alias: 'property', |
|||
inside: { |
|||
'error-message': { |
|||
pattern: /(^#error).+/, |
|||
lookbehind: true |
|||
}, |
|||
'directive': { |
|||
pattern: /^#(?:const|else(?:[\t ]+if)?|end[\t ]+if|error|if)/, |
|||
alias: 'keyword' |
|||
}, |
|||
'expression': { |
|||
pattern: /[\s\S]+/, |
|||
inside: null // see below
|
|||
} |
|||
} |
|||
}, |
|||
'property': { |
|||
pattern: /([\r\n{,][\t ]*)(?:(?!\d)\w+|"(?:[^"\r\n]|"")*"(?!"))(?=[ \t]*:)/, |
|||
lookbehind: true, |
|||
greedy: true |
|||
}, |
|||
'string': { |
|||
pattern: /"(?:[^"\r\n]|"")*"(?!")/, |
|||
greedy: true |
|||
}, |
|||
'class-name': { |
|||
pattern: /(\bAs[\t ]+)\w+/i, |
|||
lookbehind: true |
|||
}, |
|||
'keyword': /\b(?:As|Dim|Each|Else|Elseif|End|Exit|For|Function|Goto|If|In|Print|Return|Step|Stop|Sub|Then|To|While)\b/i, |
|||
'boolean': /\b(?:false|true)\b/i, |
|||
'function': /\b(?!\d)\w+(?=[\t ]*\()/, |
|||
'number': /(?:\b\d+(?:\.\d+)?(?:[ed][+-]\d+)?|&h[a-f\d]+)\b[%&!#]?/i, |
|||
'operator': /--|\+\+|>>=?|<<=?|<>|[-+*/\\<>]=?|[:^=?]|\b(?:and|mod|not|or)\b/i, |
|||
'punctuation': /[.,;()[\]{}]/, |
|||
'constant': /\b(?:LINE_NUM)\b/i |
|||
}; |
|||
|
|||
Prism.languages.brightscript['directive-statement'].inside.expression.inside = Prism.languages.brightscript; |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.brightscript={comment:/(?:\brem|').*/i,"directive-statement":{pattern:/(^[\t ]*)#(?:const|else(?:[\t ]+if)?|end[\t ]+if|error|if).*/im,lookbehind:!0,alias:"property",inside:{"error-message":{pattern:/(^#error).+/,lookbehind:!0},directive:{pattern:/^#(?:const|else(?:[\t ]+if)?|end[\t ]+if|error|if)/,alias:"keyword"},expression:{pattern:/[\s\S]+/,inside:null}}},property:{pattern:/([\r\n{,][\t ]*)(?:(?!\d)\w+|"(?:[^"\r\n]|"")*"(?!"))(?=[ \t]*:)/,lookbehind:!0,greedy:!0},string:{pattern:/"(?:[^"\r\n]|"")*"(?!")/,greedy:!0},"class-name":{pattern:/(\bAs[\t ]+)\w+/i,lookbehind:!0},keyword:/\b(?:As|Dim|Each|Else|Elseif|End|Exit|For|Function|Goto|If|In|Print|Return|Step|Stop|Sub|Then|To|While)\b/i,boolean:/\b(?:false|true)\b/i,function:/\b(?!\d)\w+(?=[\t ]*\()/,number:/(?:\b\d+(?:\.\d+)?(?:[ed][+-]\d+)?|&h[a-f\d]+)\b[%&!#]?/i,operator:/--|\+\+|>>=?|<<=?|<>|[-+*/\\<>]=?|[:^=?]|\b(?:and|mod|not|or)\b/i,punctuation:/[.,;()[\]{}]/,constant:/\b(?:LINE_NUM)\b/i},Prism.languages.brightscript["directive-statement"].inside.expression.inside=Prism.languages.brightscript; |
|||
@ -0,0 +1,37 @@ |
|||
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': /[{}[\];(),.:]/ |
|||
}; |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.bro={comment:{pattern:/(^|[^\\$])#.*/,lookbehind:!0,inside:{italic:/\b(?:FIXME|TODO|XXX)\b/}},string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},boolean:/\b[TF]\b/,function:{pattern:/(\b(?:event|function|hook)[ \t]+)\w+(?:::\w+)?/,lookbehind:!0},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:!0},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:/[{}[\];(),.:]/}; |
|||
@ -0,0 +1,75 @@ |
|||
/* 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']; |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.bsl={comment:/\/\/.*/,string:[{pattern:/"(?:[^"]|"")*"(?!")/,greedy:!0},{pattern:/'(?:[^'\r\n\\]|\\.)*'/}],keyword:[{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:!0},{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:!0},operator:[/[<>+\-*/]=?|[%=]/,{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:!0},{pattern:/\b(?:and|not|or)\b/i}],punctuation:/\(\.|\.\)|[()\[\]:;,.]/,directive:[{pattern:/^([ \t]*)&.*/m,lookbehind:!0,greedy:!0,alias:"important"},{pattern:/^([ \t]*)#.*/gm,lookbehind:!0,greedy:!0,alias:"important"}]},Prism.languages.oscript=Prism.languages.bsl; |
|||
@ -0,0 +1,80 @@ |
|||
Prism.languages.c = Prism.languages.extend('clike', { |
|||
'comment': { |
|||
pattern: /\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/, |
|||
greedy: true |
|||
}, |
|||
'string': { |
|||
// https://en.cppreference.com/w/c/language/string_literal
|
|||
pattern: /"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/, |
|||
greedy: true |
|||
}, |
|||
'class-name': { |
|||
pattern: /(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/, |
|||
lookbehind: true |
|||
}, |
|||
'keyword': /\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/, |
|||
'function': /\b[a-z_]\w*(?=\s*\()/i, |
|||
'number': /(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i, |
|||
'operator': />>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/ |
|||
}); |
|||
|
|||
Prism.languages.insertBefore('c', 'string', { |
|||
'char': { |
|||
// https://en.cppreference.com/w/c/language/character_constant
|
|||
pattern: /'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/, |
|||
greedy: true |
|||
} |
|||
}); |
|||
|
|||
Prism.languages.insertBefore('c', 'string', { |
|||
'macro': { |
|||
// allow for multiline macro definitions
|
|||
// spaces after the # character compile fine with gcc
|
|||
pattern: /(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im, |
|||
lookbehind: true, |
|||
greedy: true, |
|||
alias: 'property', |
|||
inside: { |
|||
'string': [ |
|||
{ |
|||
// highlight the path of the include statement as a string
|
|||
pattern: /^(#\s*include\s*)<[^>]+>/, |
|||
lookbehind: true |
|||
}, |
|||
Prism.languages.c['string'] |
|||
], |
|||
'char': Prism.languages.c['char'], |
|||
'comment': Prism.languages.c['comment'], |
|||
'macro-name': [ |
|||
{ |
|||
pattern: /(^#\s*define\s+)\w+\b(?!\()/i, |
|||
lookbehind: true |
|||
}, |
|||
{ |
|||
pattern: /(^#\s*define\s+)\w+\b(?=\()/i, |
|||
lookbehind: true, |
|||
alias: 'function' |
|||
} |
|||
], |
|||
// highlight macro directives as keywords
|
|||
'directive': { |
|||
pattern: /^(#\s*)[a-z]+/, |
|||
lookbehind: true, |
|||
alias: 'keyword' |
|||
}, |
|||
'directive-hash': /^#/, |
|||
'punctuation': /##|\\(?=[\r\n])/, |
|||
'expression': { |
|||
pattern: /\S[\s\S]*/, |
|||
inside: Prism.languages.c |
|||
} |
|||
} |
|||
} |
|||
}); |
|||
|
|||
Prism.languages.insertBefore('c', 'function', { |
|||
// highlight predefined macros as constants
|
|||
'constant': /\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/ |
|||
}); |
|||
|
|||
delete Prism.languages.c['boolean']; |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.c=Prism.languages.extend("clike",{comment:{pattern:/\/\/(?:[^\r\n\\]|\\(?:\r\n?|\n|(?![\r\n])))*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},string:{pattern:/"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"/,greedy:!0},"class-name":{pattern:/(\b(?:enum|struct)\s+(?:__attribute__\s*\(\([\s\S]*?\)\)\s*)?)\w+|\b[a-z]\w*_t\b/,lookbehind:!0},keyword:/\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|__attribute__|asm|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|inline|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|typeof|union|unsigned|void|volatile|while)\b/,function:/\b[a-z_]\w*(?=\s*\()/i,number:/(?:\b0x(?:[\da-f]+(?:\.[\da-f]*)?|\.[\da-f]+)(?:p[+-]?\d+)?|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?)[ful]{0,4}/i,operator:/>>=?|<<=?|->|([-+&|:])\1|[?:~]|[-+*/%&|^!=<>]=?/}),Prism.languages.insertBefore("c","string",{char:{pattern:/'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n]){0,32}'/,greedy:!0}}),Prism.languages.insertBefore("c","string",{macro:{pattern:/(^[\t ]*)#\s*[a-z](?:[^\r\n\\/]|\/(?!\*)|\/\*(?:[^*]|\*(?!\/))*\*\/|\\(?:\r\n|[\s\S]))*/im,lookbehind:!0,greedy:!0,alias:"property",inside:{string:[{pattern:/^(#\s*include\s*)<[^>]+>/,lookbehind:!0},Prism.languages.c.string],char:Prism.languages.c.char,comment:Prism.languages.c.comment,"macro-name":[{pattern:/(^#\s*define\s+)\w+\b(?!\()/i,lookbehind:!0},{pattern:/(^#\s*define\s+)\w+\b(?=\()/i,lookbehind:!0,alias:"function"}],directive:{pattern:/^(#\s*)[a-z]+/,lookbehind:!0,alias:"keyword"},"directive-hash":/^#/,punctuation:/##|\\(?=[\r\n])/,expression:{pattern:/\S[\s\S]*/,inside:Prism.languages.c}}}}),Prism.languages.insertBefore("c","function",{constant:/\b(?:EOF|NULL|SEEK_CUR|SEEK_END|SEEK_SET|__DATE__|__FILE__|__LINE__|__TIMESTAMP__|__TIME__|__func__|stderr|stdin|stdout)\b/}),delete Prism.languages.c.boolean; |
|||
@ -0,0 +1,44 @@ |
|||
// 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']; |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.cfscript=Prism.languages.extend("clike",{comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,inside:{annotation:{pattern:/(?:^|[^.])@[\w\.]+/,alias:"punctuation"}}},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],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",{"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; |
|||
@ -0,0 +1,60 @@ |
|||
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]+/ |
|||
} |
|||
}, |
|||
}); |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.chaiscript=Prism.languages.extend("clike",{string:{pattern:/(^|[^\\])'(?:[^'\\]|\\[\s\S])*'/,lookbehind:!0,greedy:!0},"class-name":[{pattern:/(\bclass\s+)\w+/,lookbehind:!0},{pattern:/(\b(?:attr|def)\s+)\w+(?=\s*::)/,lookbehind:!0}],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":{pattern:/([,(]\s*)\w+(?=\s+\w)/,lookbehind:!0,alias:"class-name"}}),Prism.languages.insertBefore("chaiscript","string",{"string-interpolation":{pattern:/(^|[^\\])"(?:[^"$\\]|\\[\s\S]|\$(?!\{)|\$\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\})*"/,lookbehind:!0,greedy:!0,inside:{interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^{}]*\})*\})*\}/,lookbehind:!0,inside:{"interpolation-expression":{pattern:/(^\$\{)[\s\S]+(?=\}$)/,lookbehind:!0,inside:Prism.languages.chaiscript},"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"}}},string:/[\s\S]+/}}}); |
|||
@ -0,0 +1,27 @@ |
|||
Prism.languages.cil = { |
|||
'comment': /\/\/.*/, |
|||
|
|||
'string': { |
|||
pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, |
|||
greedy: true |
|||
}, |
|||
|
|||
'directive': { |
|||
pattern: /(^|\W)\.[a-z]+(?=\s)/, |
|||
lookbehind: true, |
|||
alias: 'class-name' |
|||
}, |
|||
|
|||
// Actually an assembly reference
|
|||
'variable': /\[[\w\.]+\]/, |
|||
|
|||
|
|||
'keyword': /\b(?:abstract|ansi|assembly|auto|autochar|beforefieldinit|bool|bstr|byvalstr|catch|char|cil|class|currency|date|decimal|default|enum|error|explicit|extends|extern|famandassem|family|famorassem|final(?:ly)?|float32|float64|hidebysig|u?int(?:8|16|32|64)?|iant|idispatch|implements|import|initonly|instance|interface|iunknown|literal|lpstr|lpstruct|lptstr|lpwstr|managed|method|native(?:Type)?|nested|newslot|object(?:ref)?|pinvokeimpl|private|privatescope|public|reqsecobj|rtspecialname|runtime|sealed|sequential|serializable|specialname|static|string|struct|syschar|tbstr|unicode|unmanagedexp|unsigned|value(?:type)?|variant|virtual|void)\b/, |
|||
|
|||
'function': /\b(?:(?:constrained|no|readonly|tail|unaligned|volatile)\.)?(?:conv\.(?:[iu][1248]?|ovf\.[iu][1248]?(?:\.un)?|r\.un|r4|r8)|ldc\.(?:i4(?:\.\d+|\.[mM]1|\.s)?|i8|r4|r8)|ldelem(?:\.[iu][1248]?|\.r[48]|\.ref|a)?|ldind\.(?:[iu][1248]?|r[48]|ref)|stelem\.?(?:i[1248]?|r[48]|ref)?|stind\.(?:i[1248]?|r[48]|ref)?|end(?:fault|filter|finally)|ldarg(?:\.[0-3s]|a(?:\.s)?)?|ldloc(?:\.\d+|\.s)?|sub(?:\.ovf(?:\.un)?)?|mul(?:\.ovf(?:\.un)?)?|add(?:\.ovf(?:\.un)?)?|stloc(?:\.[0-3s])?|refany(?:type|val)|blt(?:\.un)?(?:\.s)?|ble(?:\.un)?(?:\.s)?|bgt(?:\.un)?(?:\.s)?|bge(?:\.un)?(?:\.s)?|unbox(?:\.any)?|init(?:blk|obj)|call(?:i|virt)?|brfalse(?:\.s)?|bne\.un(?:\.s)?|ldloca(?:\.s)?|brzero(?:\.s)?|brtrue(?:\.s)?|brnull(?:\.s)?|brinst(?:\.s)?|starg(?:\.s)?|leave(?:\.s)?|shr(?:\.un)?|rem(?:\.un)?|div(?:\.un)?|clt(?:\.un)?|alignment|castclass|ldvirtftn|beq(?:\.s)?|ckfinite|ldsflda|ldtoken|localloc|mkrefany|rethrow|cgt\.un|arglist|switch|stsfld|sizeof|newobj|newarr|ldsfld|ldnull|ldflda|isinst|throw|stobj|stfld|ldstr|ldobj|ldlen|ldftn|ldfld|cpobj|cpblk|break|br\.s|xor|shl|ret|pop|not|nop|neg|jmp|dup|cgt|ceq|box|and|or|br)\b/, |
|||
|
|||
'boolean': /\b(?:false|true)\b/, |
|||
'number': /\b-?(?:0x[0-9a-f]+|\d+)(?:\.[0-9a-f]+)?\b/i, |
|||
|
|||
'punctuation': /[{}[\];(),:=]|IL_[0-9A-Za-z]+/ |
|||
}; |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.cil={comment:/\/\/.*/,string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},directive:{pattern:/(^|\W)\.[a-z]+(?=\s)/,lookbehind:!0,alias:"class-name"},variable:/\[[\w\.]+\]/,keyword:/\b(?:abstract|ansi|assembly|auto|autochar|beforefieldinit|bool|bstr|byvalstr|catch|char|cil|class|currency|date|decimal|default|enum|error|explicit|extends|extern|famandassem|family|famorassem|final(?:ly)?|float32|float64|hidebysig|u?int(?:8|16|32|64)?|iant|idispatch|implements|import|initonly|instance|interface|iunknown|literal|lpstr|lpstruct|lptstr|lpwstr|managed|method|native(?:Type)?|nested|newslot|object(?:ref)?|pinvokeimpl|private|privatescope|public|reqsecobj|rtspecialname|runtime|sealed|sequential|serializable|specialname|static|string|struct|syschar|tbstr|unicode|unmanagedexp|unsigned|value(?:type)?|variant|virtual|void)\b/,function:/\b(?:(?:constrained|no|readonly|tail|unaligned|volatile)\.)?(?:conv\.(?:[iu][1248]?|ovf\.[iu][1248]?(?:\.un)?|r\.un|r4|r8)|ldc\.(?:i4(?:\.\d+|\.[mM]1|\.s)?|i8|r4|r8)|ldelem(?:\.[iu][1248]?|\.r[48]|\.ref|a)?|ldind\.(?:[iu][1248]?|r[48]|ref)|stelem\.?(?:i[1248]?|r[48]|ref)?|stind\.(?:i[1248]?|r[48]|ref)?|end(?:fault|filter|finally)|ldarg(?:\.[0-3s]|a(?:\.s)?)?|ldloc(?:\.\d+|\.s)?|sub(?:\.ovf(?:\.un)?)?|mul(?:\.ovf(?:\.un)?)?|add(?:\.ovf(?:\.un)?)?|stloc(?:\.[0-3s])?|refany(?:type|val)|blt(?:\.un)?(?:\.s)?|ble(?:\.un)?(?:\.s)?|bgt(?:\.un)?(?:\.s)?|bge(?:\.un)?(?:\.s)?|unbox(?:\.any)?|init(?:blk|obj)|call(?:i|virt)?|brfalse(?:\.s)?|bne\.un(?:\.s)?|ldloca(?:\.s)?|brzero(?:\.s)?|brtrue(?:\.s)?|brnull(?:\.s)?|brinst(?:\.s)?|starg(?:\.s)?|leave(?:\.s)?|shr(?:\.un)?|rem(?:\.un)?|div(?:\.un)?|clt(?:\.un)?|alignment|castclass|ldvirtftn|beq(?:\.s)?|ckfinite|ldsflda|ldtoken|localloc|mkrefany|rethrow|cgt\.un|arglist|switch|stsfld|sizeof|newobj|newarr|ldsfld|ldnull|ldflda|isinst|throw|stobj|stfld|ldstr|ldobj|ldlen|ldftn|ldfld|cpobj|cpblk|break|br\.s|xor|shl|ret|pop|not|nop|neg|jmp|dup|cgt|ceq|box|and|or|br)\b/,boolean:/\b(?:false|true)\b/,number:/\b-?(?:0x[0-9a-f]+|\d+)(?:\.[0-9a-f]+)?\b/i,punctuation:/[{}[\];(),:=]|IL_[0-9A-Za-z]+/}; |
|||
@ -0,0 +1,8 @@ |
|||
Prism.languages.cilkc = Prism.languages.insertBefore('c', 'function', { |
|||
'parallel-keyword': { |
|||
pattern: /\bcilk_(?:for|reducer|s(?:cope|pawn|ync))\b/, |
|||
alias: 'keyword' |
|||
} |
|||
}); |
|||
|
|||
Prism.languages['cilk-c'] = Prism.languages['cilkc']; |
|||
@ -0,0 +1 @@ |
|||
Prism.languages.cilkc=Prism.languages.insertBefore("c","function",{"parallel-keyword":{pattern:/\bcilk_(?:for|reducer|s(?:cope|pawn|ync))\b/,alias:"keyword"}}),Prism.languages["cilk-c"]=Prism.languages.cilkc; |
|||
@ -0,0 +1,9 @@ |
|||
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']; |
|||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue