##// END OF EJS Templates
release: Finish preparation for 4.27.0
release: Finish preparation for 4.27.0

File last commit:

r4105:10488616 default
r4773:6cea3037 v4.27.0 stable
Show More
factor.js
85 lines | 3.5 KiB | application/javascript | JavascriptLexer
project: added all source files and assets
r1 // CodeMirror, copyright (c) by Marijn Haverbeke and others
codemirror: bumped to version 5.49.2
r4105 // Distributed under an MIT license: https://codemirror.net/LICENSE
project: added all source files and assets
r1
// Factor syntax highlight - simple mode
//
// by Dimage Sapelkin (https://github.com/kerabromsmu)
(function(mod) {
if (typeof exports == "object" && typeof module == "object") // CommonJS
mod(require("../../lib/codemirror"), require("../../addon/mode/simple"));
else if (typeof define == "function" && define.amd) // AMD
define(["../../lib/codemirror", "../../addon/mode/simple"], mod);
else // Plain browser env
mod(CodeMirror);
})(function(CodeMirror) {
"use strict";
CodeMirror.defineSimpleMode("factor", {
// The start state contains the rules that are intially used
start: [
// comments
{regex: /#?!.*/, token: "comment"},
// strings """, multiline --> state
{regex: /"""/, token: "string", next: "string3"},
codemirror: bumped to version 5.49.2
r4105 {regex: /(STRING:)(\s)/, token: ["keyword", null], next: "string2"},
{regex: /\S*?"/, token: "string", next: "string"},
project: added all source files and assets
r1 // numbers: dec, hex, unicode, bin, fractional, complex
codemirror: bumped to version 5.49.2
r4105 {regex: /(?:0x[\d,a-f]+)|(?:0o[0-7]+)|(?:0b[0,1]+)|(?:\-?\d+.?\d*)(?=\s)/, token: "number"},
project: added all source files and assets
r1 //{regex: /[+-]?/} //fractional
// definition: defining word, defined word, etc
codemirror: bumped to version 5.49.2
r4105 {regex: /((?:GENERIC)|\:?\:)(\s+)(\S+)(\s+)(\()/, token: ["keyword", null, "def", null, "bracket"], next: "stack"},
// method definition: defining word, type, defined word, etc
{regex: /(M\:)(\s+)(\S+)(\s+)(\S+)/, token: ["keyword", null, "def", null, "tag"]},
project: added all source files and assets
r1 // vocabulary using --> state
{regex: /USING\:/, token: "keyword", next: "vocabulary"},
// vocabulary definition/use
codemirror: bumped to version 5.49.2
r4105 {regex: /(USE\:|IN\:)(\s+)(\S+)(?=\s|$)/, token: ["keyword", null, "tag"]},
// definition: a defining word, defined word
{regex: /(\S+\:)(\s+)(\S+)(?=\s|$)/, token: ["keyword", null, "def"]},
project: added all source files and assets
r1 // "keywords", incl. ; t f . [ ] { } defining words
codemirror: bumped to version 5.49.2
r4105 {regex: /(?:;|\\|t|f|if|loop|while|until|do|PRIVATE>|<PRIVATE|\.|\S*\[|\]|\S*\{|\})(?=\s|$)/, token: "keyword"},
// <constructors> and the like
{regex: /\S+[\)>\.\*\?]+(?=\s|$)/, token: "builtin"},
{regex: /[\)><]+\S+(?=\s|$)/, token: "builtin"},
// operators
{regex: /(?:[\+\-\=\/\*<>])(?=\s|$)/, token: "keyword"},
project: added all source files and assets
r1 // any id (?)
{regex: /\S+/, token: "variable"},
codemirror: bumped to version 5.49.2
r4105 {regex: /\s+|./, token: null}
project: added all source files and assets
r1 ],
vocabulary: [
{regex: /;/, token: "keyword", next: "start"},
codemirror: bumped to version 5.49.2
r4105 {regex: /\S+/, token: "tag"},
{regex: /\s+|./, token: null}
project: added all source files and assets
r1 ],
string: [
{regex: /(?:[^\\]|\\.)*?"/, token: "string", next: "start"},
{regex: /.*/, token: "string"}
],
codemirror: bumped to version 5.49.2
r4105 string2: [
{regex: /^;/, token: "keyword", next: "start"},
{regex: /.*/, token: "string"}
],
project: added all source files and assets
r1 string3: [
{regex: /(?:[^\\]|\\.)*?"""/, token: "string", next: "start"},
{regex: /.*/, token: "string"}
],
stack: [
codemirror: bumped to version 5.49.2
r4105 {regex: /\)/, token: "bracket", next: "start"},
{regex: /--/, token: "bracket"},
{regex: /\S+/, token: "meta"},
{regex: /\s+|./, token: null}
project: added all source files and assets
r1 ],
// The meta property contains global information about the mode. It
// can contain properties like lineComment, which are supported by
// all modes, and also directives like dontIndentStates, which are
// specific to simple modes.
meta: {
dontIndentStates: ["start", "vocabulary", "string", "string3", "stack"],
lineComment: [ "!", "#!" ]
}
});
CodeMirror.defineMIME("text/x-factor", "factor");
});