Merge pull request #1277 from h3rb/master
Simply adding 1 more mode for Tiny Mushcode (a common research language like LISP)
This commit is contained in:
commit
d091abc397
12 changed files with 886 additions and 5 deletions
|
|
@ -101,6 +101,7 @@ var docs = {
|
|||
"docs/luapage.lp": "LuaPage",
|
||||
"docs/Makefile": "Makefile",
|
||||
"docs/markdown.md": {name: "Markdown", wrapped: true},
|
||||
"docs/tinymush.mc": {name: "TinyMUSH"},
|
||||
"docs/objectivec.m": {name: "Objective-C"},
|
||||
"docs/ocaml.ml": "OCaml",
|
||||
"docs/OpenSCAD.scad": "OpenSCAD",
|
||||
|
|
|
|||
8
demo/kitchen-sink/docs/tinymush.mc
Normal file
8
demo/kitchen-sink/docs/tinymush.mc
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
@create phone
|
||||
&pickup phone=$pick up:@ifelse [u(is,u(mode),ICC)]={@pemit %#=You pick up the [fullname(me)].[set(me,PHONER:%#)][set(me,MODE:CIP)][set([u(INCOMING)],CONNECTED:[num(me)])][set(me,CONNECTED:[u(INCOMING)])]%r[showpicture(PICPICKUP)]%rUse '[color(green,black,psay <message>)]' (or '[color(green,black,p <message>)]') to talk into the phone.;@oemit %#=%N picks up the [fullname(me)].},{@pemit %#=You pick up the phone but no one is there. You hear a dialtone and then hang up. [play(u(DIALTONE))];@oemit %#=%N picks up the phone, but no one is on the other end.}
|
||||
&ringfun phone=[ifelse(eq(comp([u(%0/ringtone)],off),0),[color(black,cyan,INCOMING CALL FROM %1)],[play([switch([u(%0/ringtone)],1,[u(%0/ringtone1)],2,[u(%0/ringtone2)],3,[u(%0/ringtone3)],4,[u(%0/ringtone4)],5,[u(%0/ringtone5)],6,[u(%0/ringtone6)],7,[u(%0/ringtone7)],8,[u(%0/ringtone8)],9,[u(%0/ringtone9)],custom,[u(%0/customtone)],vibrate,[u(%0/vibrate)])])]
|
||||
&ringloop phone=@switch [u(ringstate)]=1,{@emit [setq(q,[u(connecting)])][set(%qq,rangs:0)][set(%qq,mode:WFC)][set(%qq,INCOMING:)];@ifelse [u(%qq/HASVMB)]={@tr me/ROUTEVMB=[u(connecting)];},{@pemit %#=[u(MSGCNC)];}},2,{@pemit %#=The call is connected.[setq(q,[u(CONNECTING)])][set(me,CONNECTED:%qq)][set(%qq,CONNECTED:[num(me)])][set(%qq,MODE:CIP)];@tr me/ciploop;@tr %qq/ciploop;},3,{@emit On [fullname(me)]'s earpiece you hear a ringing sound.[play(u(LINETONE))];@tr me/ringhere;@increment [u(connecting)]/RANGS;@wait 5={@tr me/ringloop};},4,{}
|
||||
&ringstate phone=[setq(q,u(connecting))][setq(1,[gt(u(%qq/rangs),sub(u(%qq/rings),1))])][setq(2,[and(u(is,u(%qq/MODE),CIP),u(is,u(%qq/INCOMING),[num(me)]))][setq(3,[u(is,u(%qq/MODE),ICC)])][ifelse(%q1,1,ifelse(%q2,2,ifelse(%q3,3,4)))]
|
||||
;comment
|
||||
@@(comment)
|
||||
say [time()]
|
||||
|
|
@ -74,6 +74,7 @@ var modesByName = {
|
|||
lsl: ["LSL" , "lsl"],
|
||||
makefile: ["Makefile" , "^GNUmakefile|^makefile|^Makefile|^OCamlMakefile|make"],
|
||||
markdown: ["Markdown" , "md|markdown"],
|
||||
mushcode: ["TinyMUSH" , "mc|mush"],
|
||||
objectivec: ["Objective-C" , "m"],
|
||||
ocaml: ["OCaml" , "ml|mli"],
|
||||
pascal: ["Pascal" , "pas|p"],
|
||||
|
|
|
|||
|
|
@ -143,7 +143,7 @@ var themes = {
|
|||
bright: [ "chrome", "clouds", "crimson_editor", "dawn", "dreamweaver", "eclipse", "github",
|
||||
"solarized_light", "textmate", "tomorrow"],
|
||||
dark: [ "clouds_midnight", "cobalt", "idle_fingers", "kr_theme", "merbivore", "merbivore_soft",
|
||||
"mono_industrial", "monokai", "pastel_on_dark", "solarized_dark", "tomorrow_night",
|
||||
"mono_industrial", "monokai", "pastel_on_dark", "solarized_dark", "terminal", "tomorrow_night",
|
||||
"tomorrow_night_blue", "tomorrow_night_bright", "tomorrow_night_eighties", "twilight", "vibrant_ink"]
|
||||
}
|
||||
themes = [].concat(themes.bright, themes.dark);
|
||||
|
|
|
|||
|
|
@ -89,11 +89,12 @@
|
|||
<option value="ace/theme/monokai">Monokai</option>
|
||||
<option value="ace/theme/pastel_on_dark">Pastel on dark</option>
|
||||
<option value="ace/theme/solarized_dark">Solarized Dark</option>
|
||||
<option value="ace/theme/twilight">Twilight</option>
|
||||
<option value="ace/theme/terminal">Terminal</option>
|
||||
<option value="ace/theme/tomorrow_night">Tomorrow Night</option>
|
||||
<option value="ace/theme/tomorrow_night_blue">Tomorrow Night Blue</option>
|
||||
<option value="ace/theme/tomorrow_night_bright">Tomorrow Night Bright</option>
|
||||
<option value="ace/theme/tomorrow_night_eighties">Tomorrow Night 80s</option>
|
||||
<option value="ace/theme/twilight">Twilight</option>
|
||||
<option value="ace/theme/vibrant_ink">Vibrant Ink</option>
|
||||
</optgroup>
|
||||
</select>
|
||||
|
|
|
|||
116
lib/ace/mode/mushcode.js
Normal file
116
lib/ace/mode/mushcode.js
Normal file
|
|
@ -0,0 +1,116 @@
|
|||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Distributed under the BSD license:
|
||||
*
|
||||
* Copyright (c) 2010, Ajax.org B.V.
|
||||
* 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 Ajax.org B.V. 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 AJAX.ORG B.V. 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.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var oop = require("../lib/oop");
|
||||
var TextMode = require("./text").Mode;
|
||||
var Tokenizer = require("../tokenizer").Tokenizer;
|
||||
var MushCodeRules = require("./mushcode_high_rules").MushCodeRules;
|
||||
var PythonFoldMode = require("./folding/pythonic").FoldMode;
|
||||
var Range = require("../range").Range;
|
||||
|
||||
var Mode = function() {
|
||||
this.$tokenizer = new Tokenizer(new MushCodeRules().getRules());
|
||||
this.foldingRules = new PythonFoldMode("\\:");
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
(function() {
|
||||
|
||||
this.lineCommentStart = "#";
|
||||
|
||||
this.getNextLineIndent = function(state, line, tab) {
|
||||
var indent = this.$getIndent(line);
|
||||
|
||||
var tokenizedLine = this.$tokenizer.getLineTokens(line, state);
|
||||
var tokens = tokenizedLine.tokens;
|
||||
|
||||
if (tokens.length && tokens[tokens.length-1].type == "comment") {
|
||||
return indent;
|
||||
}
|
||||
|
||||
if (state == "start") {
|
||||
var match = line.match(/^.*[\{\(\[\:]\s*$/);
|
||||
if (match) {
|
||||
indent += tab;
|
||||
}
|
||||
}
|
||||
|
||||
return indent;
|
||||
};
|
||||
|
||||
var outdents = {
|
||||
"pass": 1,
|
||||
"return": 1,
|
||||
"raise": 1,
|
||||
"break": 1,
|
||||
"continue": 1
|
||||
};
|
||||
|
||||
this.checkOutdent = function(state, line, input) {
|
||||
if (input !== "\r\n" && input !== "\r" && input !== "\n")
|
||||
return false;
|
||||
|
||||
var tokens = this.$tokenizer.getLineTokens(line.trim(), state).tokens;
|
||||
|
||||
if (!tokens)
|
||||
return false;
|
||||
|
||||
// ignore trailing comments
|
||||
do {
|
||||
var last = tokens.pop();
|
||||
} while (last && (last.type == "comment" || (last.type == "text" && last.value.match(/^\s+$/))));
|
||||
|
||||
if (!last)
|
||||
return false;
|
||||
|
||||
return (last.type == "keyword" && outdents[last.value]);
|
||||
};
|
||||
|
||||
this.autoOutdent = function(state, doc, row) {
|
||||
// outdenting in python is slightly different because it always applies
|
||||
// to the next line and only of a new line is inserted
|
||||
|
||||
row += 1;
|
||||
var indent = this.$getIndent(doc.getLine(row));
|
||||
var tab = doc.getTabString();
|
||||
if (indent.slice(-tab.length) == tab)
|
||||
doc.remove(new Range(row, indent.length-tab.length, row, indent.length));
|
||||
};
|
||||
|
||||
}).call(Mode.prototype);
|
||||
|
||||
exports.Mode = Mode;
|
||||
});
|
||||
|
||||
|
||||
|
||||
569
lib/ace/mode/mushcode_high_rules.js
Normal file
569
lib/ace/mode/mushcode_high_rules.js
Normal file
|
|
@ -0,0 +1,569 @@
|
|||
/*
|
||||
* MUSHCodeMode
|
||||
*/
|
||||
|
||||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var oop = require("../lib/oop");
|
||||
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
||||
|
||||
var MushCodeRules = function() {
|
||||
|
||||
|
||||
var keywords = (
|
||||
"@if|"+
|
||||
"@ifelse|"+
|
||||
"@switch|"+
|
||||
"@halt|"+
|
||||
"@dolist|"+
|
||||
"@create|"+
|
||||
"@scent|"+
|
||||
"@sound|"+
|
||||
"@touch|"+
|
||||
"@ataste|"+
|
||||
"@osound|"+
|
||||
"@ahear|"+
|
||||
"@aahear|"+
|
||||
"@amhear|"+
|
||||
"@otouch|"+
|
||||
"@otaste|"+
|
||||
"@drop|"+
|
||||
"@odrop|"+
|
||||
"@adrop|"+
|
||||
"@dropfail|"+
|
||||
"@odropfail|"+
|
||||
"@smell|"+
|
||||
"@oemit|"+
|
||||
"@emit|"+
|
||||
"@pemit|"+
|
||||
"@parent|"+
|
||||
"@clone|"+
|
||||
"@taste|"+
|
||||
"whisper|"+
|
||||
"page|"+
|
||||
"say|"+
|
||||
"pose|"+
|
||||
"semipose|"+
|
||||
"teach|"+
|
||||
"touch|"+
|
||||
"taste|"+
|
||||
"smell|"+
|
||||
"listen|"+
|
||||
"look|"+
|
||||
"move|"+
|
||||
"go|"+
|
||||
"home|"+
|
||||
"follow|"+
|
||||
"unfollow|"+
|
||||
"desert|"+
|
||||
"dismiss|"+
|
||||
"@tel"
|
||||
);
|
||||
|
||||
var builtinConstants = (
|
||||
"=#0"
|
||||
);
|
||||
|
||||
var builtinFunctions = (
|
||||
"default|"+
|
||||
"edefault|"+
|
||||
"eval|"+
|
||||
"get_eval|"+
|
||||
"get|"+
|
||||
"grep|"+
|
||||
"grepi|"+
|
||||
"hasattr|"+
|
||||
"hasattrp|"+
|
||||
"hasattrval|"+
|
||||
"hasattrpval|"+
|
||||
"lattr|"+
|
||||
"nattr|"+
|
||||
"poss|"+
|
||||
"udefault|"+
|
||||
"ufun|"+
|
||||
"u|"+
|
||||
"v|"+
|
||||
"uldefault|"+
|
||||
"xget|"+
|
||||
"zfun|"+
|
||||
"band|"+
|
||||
"bnand|"+
|
||||
"bnot|"+
|
||||
"bor|"+
|
||||
"bxor|"+
|
||||
"shl|"+
|
||||
"shr|"+
|
||||
"and|"+
|
||||
"cand|"+
|
||||
"cor|"+
|
||||
"eq|"+
|
||||
"gt|"+
|
||||
"gte|"+
|
||||
"lt|"+
|
||||
"lte|"+
|
||||
"nand|"+
|
||||
"neq|"+
|
||||
"nor|"+
|
||||
"not|"+
|
||||
"or|"+
|
||||
"t|"+
|
||||
"xor|"+
|
||||
"con|"+
|
||||
"entrances|"+
|
||||
"exit|"+
|
||||
"followers|"+
|
||||
"home|"+
|
||||
"lcon|"+
|
||||
"lexits|"+
|
||||
"loc|"+
|
||||
"locate|"+
|
||||
"lparent|"+
|
||||
"lsearch|"+
|
||||
"next|"+
|
||||
"num|"+
|
||||
"owner|"+
|
||||
"parent|"+
|
||||
"pmatch|"+
|
||||
"rloc|"+
|
||||
"rnum|"+
|
||||
"room|"+
|
||||
"where|"+
|
||||
"zone|"+
|
||||
"worn|"+
|
||||
"held|"+
|
||||
"carried|"+
|
||||
"acos|"+
|
||||
"asin|"+
|
||||
"atan|"+
|
||||
"ceil|"+
|
||||
"cos|"+
|
||||
"e|"+
|
||||
"exp|"+
|
||||
"fdiv|"+
|
||||
"fmod|"+
|
||||
"floor|"+
|
||||
"log|"+
|
||||
"ln|"+
|
||||
"pi|"+
|
||||
"power|"+
|
||||
"round|"+
|
||||
"sin|"+
|
||||
"sqrt|"+
|
||||
"tan|"+
|
||||
"aposs|"+
|
||||
"andflags|"+
|
||||
"conn|"+
|
||||
"commandssent|"+
|
||||
"controls|"+
|
||||
"doing|"+
|
||||
"elock|"+
|
||||
"findable|"+
|
||||
"flags|"+
|
||||
"fullname|"+
|
||||
"hasflag|"+
|
||||
"haspower|"+
|
||||
"hastype|"+
|
||||
"hidden|"+
|
||||
"idle|"+
|
||||
"isbaker|"+
|
||||
"lock|"+
|
||||
"lstats|"+
|
||||
"money|"+
|
||||
"who|"+
|
||||
"name|"+
|
||||
"nearby|"+
|
||||
"obj|"+
|
||||
"objflags|"+
|
||||
"photo|"+
|
||||
"poll|"+
|
||||
"powers|"+
|
||||
"pendingtext|"+
|
||||
"receivedtext|"+
|
||||
"restarts|"+
|
||||
"restarttime|"+
|
||||
"subj|"+
|
||||
"shortestpath|"+
|
||||
"tmoney|"+
|
||||
"type|"+
|
||||
"visible|"+
|
||||
"cat|"+
|
||||
"element|"+
|
||||
"elements|"+
|
||||
"extract|"+
|
||||
"filter|"+
|
||||
"filterbool|"+
|
||||
"first|"+
|
||||
"foreach|"+
|
||||
"fold|"+
|
||||
"grab|"+
|
||||
"graball|"+
|
||||
"index|"+
|
||||
"insert|"+
|
||||
"itemize|"+
|
||||
"items|"+
|
||||
"iter|"+
|
||||
"last|"+
|
||||
"ldelete|"+
|
||||
"map|"+
|
||||
"match|"+
|
||||
"matchall|"+
|
||||
"member|"+
|
||||
"mix|"+
|
||||
"munge|"+
|
||||
"pick|"+
|
||||
"remove|"+
|
||||
"replace|"+
|
||||
"rest|"+
|
||||
"revwords|"+
|
||||
"setdiff|"+
|
||||
"setinter|"+
|
||||
"setunion|"+
|
||||
"shuffle|"+
|
||||
"sort|"+
|
||||
"sortby|"+
|
||||
"splice|"+
|
||||
"step|"+
|
||||
"wordpos|"+
|
||||
"words|"+
|
||||
"add|"+
|
||||
"lmath|"+
|
||||
"max|"+
|
||||
"mean|"+
|
||||
"median|"+
|
||||
"min|"+
|
||||
"mul|"+
|
||||
"percent|"+
|
||||
"sign|"+
|
||||
"stddev|"+
|
||||
"sub|"+
|
||||
"val|"+
|
||||
"bound|"+
|
||||
"abs|"+
|
||||
"inc|"+
|
||||
"dec|"+
|
||||
"dist2d|"+
|
||||
"dist3d|"+
|
||||
"div|"+
|
||||
"floordiv|"+
|
||||
"mod|"+
|
||||
"modulo|"+
|
||||
"remainder|"+
|
||||
"vadd|"+
|
||||
"vdim|"+
|
||||
"vdot|"+
|
||||
"vmag|"+
|
||||
"vmax|"+
|
||||
"vmin|"+
|
||||
"vmul|"+
|
||||
"vsub|"+
|
||||
"vunit|"+
|
||||
"regedit|"+
|
||||
"regeditall|"+
|
||||
"regeditalli|"+
|
||||
"regediti|"+
|
||||
"regmatch|"+
|
||||
"regmatchi|"+
|
||||
"regrab|"+
|
||||
"regraball|"+
|
||||
"regraballi|"+
|
||||
"regrabi|"+
|
||||
"regrep|"+
|
||||
"regrepi|"+
|
||||
"after|"+
|
||||
"alphamin|"+
|
||||
"alphamax|"+
|
||||
"art|"+
|
||||
"before|"+
|
||||
"brackets|"+
|
||||
"capstr|"+
|
||||
"case|"+
|
||||
"caseall|"+
|
||||
"center|"+
|
||||
"containsfansi|"+
|
||||
"comp|"+
|
||||
"decompose|"+
|
||||
"decrypt|"+
|
||||
"delete|"+
|
||||
"edit|"+
|
||||
"encrypt|"+
|
||||
"escape|"+
|
||||
"if|"+
|
||||
"ifelse|"+
|
||||
"lcstr|"+
|
||||
"left|"+
|
||||
"lit|"+
|
||||
"ljust|"+
|
||||
"merge|"+
|
||||
"mid|"+
|
||||
"ostrlen|"+
|
||||
"pos|"+
|
||||
"repeat|"+
|
||||
"reverse|"+
|
||||
"right|"+
|
||||
"rjust|"+
|
||||
"scramble|"+
|
||||
"secure|"+
|
||||
"space|"+
|
||||
"spellnum|"+
|
||||
"squish|"+
|
||||
"strcat|"+
|
||||
"strmatch|"+
|
||||
"strinsert|"+
|
||||
"stripansi|"+
|
||||
"stripfansi|"+
|
||||
"strlen|"+
|
||||
"switch|"+
|
||||
"switchall|"+
|
||||
"table|"+
|
||||
"tr|"+
|
||||
"trim|"+
|
||||
"ucstr|"+
|
||||
"unsafe|"+
|
||||
"wrap|"+
|
||||
"ctitle|"+
|
||||
"cwho|"+
|
||||
"channels|"+
|
||||
"clock|"+
|
||||
"cflags|"+
|
||||
"ilev|"+
|
||||
"itext|"+
|
||||
"inum|"+
|
||||
"convsecs|"+
|
||||
"convutcsecs|"+
|
||||
"convtime|"+
|
||||
"ctime|"+
|
||||
"etimefmt|"+
|
||||
"isdaylight|"+
|
||||
"mtime|"+
|
||||
"secs|"+
|
||||
"msecs|"+
|
||||
"starttime|"+
|
||||
"time|"+
|
||||
"timefmt|"+
|
||||
"timestring|"+
|
||||
"utctime|"+
|
||||
"atrlock|"+
|
||||
"clone|"+
|
||||
"create|"+
|
||||
"cook|"+
|
||||
"dig|"+
|
||||
"emit|"+
|
||||
"lemit|"+
|
||||
"link|"+
|
||||
"oemit|"+
|
||||
"open|"+
|
||||
"pemit|"+
|
||||
"remit|"+
|
||||
"set|"+
|
||||
"tel|"+
|
||||
"wipe|"+
|
||||
"zemit|"+
|
||||
"fbcreate|"+
|
||||
"fbdestroy|"+
|
||||
"fbwrite|"+
|
||||
"fbclear|"+
|
||||
"fbcopy|"+
|
||||
"fbcopyto|"+
|
||||
"fbclip|"+
|
||||
"fbdump|"+
|
||||
"fbflush|"+
|
||||
"fbhset|"+
|
||||
"fblist|"+
|
||||
"fbstats|"+
|
||||
"qentries|"+
|
||||
"qentry|"+
|
||||
"play|"+
|
||||
"ansi|"+
|
||||
"break|"+
|
||||
"c|"+
|
||||
"asc|"+
|
||||
"die|"+
|
||||
"isdbref|"+
|
||||
"isint|"+
|
||||
"isnum|"+
|
||||
"isletters|"+
|
||||
"linecoords|"+
|
||||
"localize|"+
|
||||
"lnum|"+
|
||||
"nameshort|"+
|
||||
"null|"+
|
||||
"objeval|"+
|
||||
"r|"+
|
||||
"rand|"+
|
||||
"s|"+
|
||||
"setq|"+
|
||||
"setr|"+
|
||||
"soundex|"+
|
||||
"soundslike|"+
|
||||
"valid|"+
|
||||
"vchart|"+
|
||||
"vchart2|"+
|
||||
"vlabel|"+
|
||||
"@@|"+
|
||||
"bakerdays|"+
|
||||
"bodybuild|"+
|
||||
"box|"+
|
||||
"capall|"+
|
||||
"catalog|"+
|
||||
"children|"+
|
||||
"ctrailer|"+
|
||||
"darttime|"+
|
||||
"debt|"+
|
||||
"detailbar|"+
|
||||
"exploredroom|"+
|
||||
"fansitoansi|"+
|
||||
"fansitoxansi|"+
|
||||
"fullbar|"+
|
||||
"halfbar|"+
|
||||
"isdarted|"+
|
||||
"isnewbie|"+
|
||||
"isword|"+
|
||||
"lambda|"+
|
||||
"lobjects|"+
|
||||
"lplayers|"+
|
||||
"lthings|"+
|
||||
"lvexits|"+
|
||||
"lvobjects|"+
|
||||
"lvplayers|"+
|
||||
"lvthings|"+
|
||||
"newswrap|"+
|
||||
"numsuffix|"+
|
||||
"playerson|"+
|
||||
"playersthisweek|"+
|
||||
"randomad|"+
|
||||
"randword|"+
|
||||
"realrandword|"+
|
||||
"replacechr|"+
|
||||
"second|"+
|
||||
"splitamount|"+
|
||||
"strlenall|"+
|
||||
"text|"+
|
||||
"third|"+
|
||||
"tofansi|"+
|
||||
"totalac|"+
|
||||
"unique|"+
|
||||
"getaddressroom|"+
|
||||
"listpropertycomm|"+
|
||||
"listpropertyres|"+
|
||||
"lotowner|"+
|
||||
"lotrating|"+
|
||||
"lotratingcount|"+
|
||||
"lotvalue|"+
|
||||
"boughtproduct|"+
|
||||
"companyabb|"+
|
||||
"companyicon|"+
|
||||
"companylist|"+
|
||||
"companyname|"+
|
||||
"companyowners|"+
|
||||
"companyvalue|"+
|
||||
"employees|"+
|
||||
"invested|"+
|
||||
"productlist|"+
|
||||
"productname|"+
|
||||
"productowners|"+
|
||||
"productrating|"+
|
||||
"productratingcount|"+
|
||||
"productsoldat|"+
|
||||
"producttype|"+
|
||||
"ratedproduct|"+
|
||||
"soldproduct|"+
|
||||
"topproducts|"+
|
||||
"totalspentonproduct|"+
|
||||
"totalstock|"+
|
||||
"transfermoney|"+
|
||||
"uniquebuyercount|"+
|
||||
"uniqueproductsbought|"+
|
||||
"validcompany|"+
|
||||
"deletepicture|"+
|
||||
"fbsave|"+
|
||||
"getpicturesecurity|"+
|
||||
"haspicture|"+
|
||||
"listpictures|"+
|
||||
"picturesize|"+
|
||||
"replacecolor|"+
|
||||
"rgbtocolor|"+
|
||||
"savepicture|"+
|
||||
"setpicturesecurity|"+
|
||||
"showpicture|"+
|
||||
"piechart|"+
|
||||
"piechartlabel|"+
|
||||
"createmaze|"+
|
||||
"drawmaze|"+
|
||||
"drawwireframe"
|
||||
);
|
||||
var keywordMapper = this.createKeywordMapper({
|
||||
"invalid.deprecated": "debugger",
|
||||
"support.function": builtinFunctions,
|
||||
"constant.language": builtinConstants,
|
||||
"keyword": keywords
|
||||
}, "identifier");
|
||||
|
||||
var strPre = "(?:r|u|ur|R|U|UR|Ur|uR)?";
|
||||
|
||||
var decimalInteger = "(?:(?:[1-9]\\d*)|(?:0))";
|
||||
var octInteger = "(?:0[oO]?[0-7]+)";
|
||||
var hexInteger = "(?:0[xX][\\dA-Fa-f]+)";
|
||||
var binInteger = "(?:0[bB][01]+)";
|
||||
var integer = "(?:" + decimalInteger + "|" + octInteger + "|" + hexInteger + "|" + binInteger + ")";
|
||||
|
||||
var exponent = "(?:[eE][+-]?\\d+)";
|
||||
var fraction = "(?:\\.\\d+)";
|
||||
var intPart = "(?:\\d+)";
|
||||
var pointFloat = "(?:(?:" + intPart + "?" + fraction + ")|(?:" + intPart + "\\.))";
|
||||
var exponentFloat = "(?:(?:" + pointFloat + "|" + intPart + ")" + exponent + ")";
|
||||
var floatNumber = "(?:" + exponentFloat + "|" + pointFloat + ")";
|
||||
|
||||
this.$rules = {
|
||||
"start" : [
|
||||
{
|
||||
token : "variable", // mush substitution register
|
||||
regex : "%[0-9]{1}"
|
||||
},
|
||||
{
|
||||
token : "variable", // mush substitution register
|
||||
regex : "%q[0-9A-Za-z]{1}"
|
||||
},
|
||||
{
|
||||
token : "variable", // mush special character register
|
||||
regex : "%[a-zA-Z]{1}"
|
||||
},
|
||||
{
|
||||
token: "variable.language",
|
||||
regex: "%[a-z0-9-_]+"
|
||||
},
|
||||
{
|
||||
token : "constant.numeric", // imaginary
|
||||
regex : "(?:" + floatNumber + "|\\d+)[jJ]\\b"
|
||||
}, {
|
||||
token : "constant.numeric", // float
|
||||
regex : floatNumber
|
||||
}, {
|
||||
token : "constant.numeric", // long integer
|
||||
regex : integer + "[lL]\\b"
|
||||
}, {
|
||||
token : "constant.numeric", // integer
|
||||
regex : integer + "\\b"
|
||||
}, {
|
||||
token : keywordMapper,
|
||||
regex : "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
|
||||
}, {
|
||||
token : "keyword.operator",
|
||||
regex : "\\+|\\-|\\*|\\*\\*|\\/|\\/\\/|#|%|<<|>>|\\||\\^|~|<|>|<=|=>|==|!=|<>|="
|
||||
}, {
|
||||
token : "paren.lparen",
|
||||
regex : "[\\[\\(\\{]"
|
||||
}, {
|
||||
token : "paren.rparen",
|
||||
regex : "[\\]\\)\\}]"
|
||||
}, {
|
||||
token : "text",
|
||||
regex : "\\s+"
|
||||
} ],
|
||||
};
|
||||
};
|
||||
|
||||
oop.inherits(MushCodeRules, TextHighlightRules);
|
||||
|
||||
exports.MushCodeRules = MushCodeRules;
|
||||
});
|
||||
144
lib/ace/theme/terminal.css
Normal file
144
lib/ace/theme/terminal.css
Normal file
|
|
@ -0,0 +1,144 @@
|
|||
.ace-terminal-theme .ace_gutter {
|
||||
background: #1a0005;
|
||||
color: steelblue
|
||||
}
|
||||
|
||||
.ace-terminal-theme .ace_print-margin {
|
||||
width: 1px;
|
||||
background: #1a1a1a
|
||||
}
|
||||
|
||||
.ace-terminal-theme .ace_scroller {
|
||||
background-color: black
|
||||
}
|
||||
|
||||
.ace-terminal-theme .ace_text-layer {
|
||||
color: #DEDEDE
|
||||
}
|
||||
|
||||
.ace-terminal-theme .ace_cursor {
|
||||
border-left: 2px solid springgreen
|
||||
}
|
||||
|
||||
.ace-terminal-theme .ace_overwrite-cursors .ace_cursor {
|
||||
border-left: 0px;
|
||||
border-bottom: 1px solid #9F9F9F
|
||||
}
|
||||
|
||||
.ace-terminal-theme .ace_marker-layer .ace_selection {
|
||||
background: #424242
|
||||
}
|
||||
|
||||
.ace-terminal-theme.ace_multiselect .ace_selection.ace_start {
|
||||
box-shadow: 0 0 3px 0px black;
|
||||
border-radius: 2px
|
||||
}
|
||||
|
||||
.ace-terminal-theme .ace_marker-layer .ace_step {
|
||||
background: rgb(0, 0, 0)
|
||||
}
|
||||
|
||||
.ace-terminal-theme .ace_marker-layer .ace_bracket {
|
||||
background: #090;
|
||||
}
|
||||
|
||||
.ace-terminal-theme .ace_marker-layer .ace_bracket-start {
|
||||
background: #090;
|
||||
}
|
||||
|
||||
.ace-terminal-theme .ace_marker-layer .ace_bracket-unmatched {
|
||||
margin: -1px 0 0 -1px;
|
||||
border: 1px solid #900
|
||||
}
|
||||
|
||||
.ace-terminal-theme .ace_marker-layer .ace_active-line {
|
||||
background: #2A2A2A
|
||||
}
|
||||
|
||||
.ace-terminal-theme .ace_gutter-active-line {
|
||||
background-color: #2A112A
|
||||
}
|
||||
|
||||
.ace-terminal-theme .ace_marker-layer .ace_selected-word {
|
||||
border: 1px solid #424242
|
||||
}
|
||||
|
||||
.ace-terminal-theme .ace_invisible {
|
||||
color: #343434
|
||||
}
|
||||
|
||||
.ace-terminal-theme .ace_keyword,
|
||||
.ace-terminal-theme .ace_meta,
|
||||
.ace-terminal-theme .ace_storage,
|
||||
.ace-terminal-theme .ace_storage.ace_type,
|
||||
.ace-terminal-theme .ace_support.ace_type {
|
||||
color: tomato
|
||||
}
|
||||
|
||||
.ace-terminal-theme .ace_keyword.ace_operator {
|
||||
color: deeppink
|
||||
}
|
||||
|
||||
.ace-terminal-theme .ace_constant.ace_character,
|
||||
.ace-terminal-theme .ace_constant.ace_language,
|
||||
.ace-terminal-theme .ace_constant.ace_numeric,
|
||||
.ace-terminal-theme .ace_keyword.ace_other.ace_unit,
|
||||
.ace-terminal-theme .ace_support.ace_constant,
|
||||
.ace-terminal-theme .ace_variable.ace_parameter {
|
||||
color: #E78C45
|
||||
}
|
||||
|
||||
.ace-terminal-theme .ace_constant.ace_other {
|
||||
color: gold
|
||||
}
|
||||
|
||||
.ace-terminal-theme .ace_invalid {
|
||||
color: yellow;
|
||||
background-color: red
|
||||
}
|
||||
|
||||
.ace-terminal-theme .ace_invalid.ace_deprecated {
|
||||
color: #CED2CF;
|
||||
background-color: #B798BF
|
||||
}
|
||||
|
||||
.ace-terminal-theme .ace_fold {
|
||||
background-color: #7AA6DA;
|
||||
border-color: #DEDEDE
|
||||
}
|
||||
|
||||
.ace-terminal-theme .ace_entity.ace_name.ace_function,
|
||||
.ace-terminal-theme .ace_support.ace_function,
|
||||
.ace-terminal-theme .ace_variable {
|
||||
color: #7AA6DA
|
||||
}
|
||||
|
||||
.ace-terminal-theme .ace_support.ace_class,
|
||||
.ace-terminal-theme .ace_support.ace_type {
|
||||
color: #E7C547
|
||||
}
|
||||
|
||||
.ace-terminal-theme .ace_markup.ace_heading,
|
||||
.ace-terminal-theme .ace_string {
|
||||
color: #B9CA4A
|
||||
}
|
||||
|
||||
.ace-terminal-theme .ace_entity.ace_name.ace_tag,
|
||||
.ace-terminal-theme .ace_entity.ace_other.ace_attribute-name,
|
||||
.ace-terminal-theme .ace_meta.ace_tag,
|
||||
.ace-terminal-theme .ace_string.ace_regexp,
|
||||
.ace-terminal-theme .ace_variable {
|
||||
color: #D54E53
|
||||
}
|
||||
|
||||
.ace-terminal-theme .ace_comment {
|
||||
color: orangered
|
||||
}
|
||||
|
||||
.ace-terminal-theme .ace_markup.ace_underline {
|
||||
text-decoration: underline
|
||||
}
|
||||
|
||||
.ace-terminal-theme .ace_indent-guide {
|
||||
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAACCAYAAACZgbYnAAAAEklEQVQImWNgYGD4z7Bq1ar/AAz9A/2naJQKAAAAAElFTkSuQmCC) right repeat-y
|
||||
}
|
||||
39
lib/ace/theme/terminal.js
Normal file
39
lib/ace/theme/terminal.js
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Distributed under the BSD license:
|
||||
*
|
||||
* Copyright (c) 2010, Ajax.org B.V.
|
||||
* 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 Ajax.org B.V. 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 AJAX.ORG B.V. 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.
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
define(function(require, exports, module) {
|
||||
|
||||
exports.isDark = true;
|
||||
exports.cssClass = "ace-terminal-theme";
|
||||
exports.cssText = require("../requirejs/text!./terminal.css");
|
||||
|
||||
var dom = require("../lib/dom");
|
||||
dom.importCssString(exports.cssText, exports.cssClass);
|
||||
});
|
||||
|
|
@ -107,7 +107,7 @@ util.fillDropdown("themeEl", {
|
|||
"chrome", "clouds", "crimson_editor", "dawn", "dreamweaver", "eclipse", "github",
|
||||
"solarized_light", "textmate", "tomorrow", "xcode"],
|
||||
dark: [ "clouds_midnight", "cobalt", "idle_fingers", "kr_theme", "merbivore", "merbivore_soft",
|
||||
"mono_industrial", "monokai", "pastel_on_dark", "solarized_dark", "tomorrow_night",
|
||||
"mono_industrial", "monokai", "pastel_on_dark", "solarized_dark", "terminal", "tomorrow_night",
|
||||
"tomorrow_night_blue", "tomorrow_night_bright", "tomorrow_night_eighties", "twilight", "vibrant_ink"]
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -90,11 +90,12 @@
|
|||
<option value="ace/theme/monokai">Monokai</option>
|
||||
<option value="ace/theme/pastel_on_dark">Pastel on dark</option>
|
||||
<option value="ace/theme/solarized_dark">Solarized Dark</option>
|
||||
<option value="ace/theme/twilight">Twilight</option>
|
||||
<option value="ace/theme/terminal">Terminal</option>
|
||||
<option value="ace/theme/tomorrow_night">Tomorrow Night</option>
|
||||
<option value="ace/theme/tomorrow_night_blue">Tomorrow Night Blue</option>
|
||||
<option value="ace/theme/tomorrow_night_bright">Tomorrow Night Bright</option>
|
||||
<option value="ace/theme/tomorrow_night_eighties">Tomorrow Night 80s</option>
|
||||
<option value="ace/theme/twilight">Twilight</option>
|
||||
<option value="ace/theme/vibrant_ink">Vibrant Ink</option>
|
||||
</optgroup>
|
||||
</select>
|
||||
|
|
|
|||
|
|
@ -248,6 +248,7 @@ var themes = {
|
|||
"solarized_dark": "Solarized-dark",
|
||||
"solarized_light": "Solarized-light",
|
||||
//"textmate": "Textmate (Mac Classic)",
|
||||
"terminal": "Terminal"
|
||||
"tomorrow": "Tomorrow",
|
||||
"tomorrow_night": "Tomorrow-Night",
|
||||
"tomorrow_night_blue": "Tomorrow-Night-Blue",
|
||||
|
|
@ -368,4 +369,4 @@ var rule = "."+ace.renderer.$theme +" .ace_indent-guide {\n\
|
|||
console.log(rule)
|
||||
require("ace/lib/dom").importCssString(rule)
|
||||
|
||||
*/
|
||||
*/
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue