kopia lustrzana https://github.com/c9/core
update ace
rodzic
2e524ab8ba
commit
15911b3ed6
|
@ -12,6 +12,7 @@ define(function(require, exports, module) {
|
|||
var keyUtil = require("ace/lib/keys");
|
||||
var KeyBinding = require("ace/keyboard/keybinding").KeyBinding;
|
||||
var CommandManager = require("ace/commands/command_manager").CommandManager;
|
||||
CommandManager.prototype.$checkCommandState = false;
|
||||
|
||||
/***** Initialization *****/
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
text-align: left !important;
|
||||
top: 0;
|
||||
z-index: 5;
|
||||
pointer-events: auto;
|
||||
pointer-events: auto!important;
|
||||
}
|
||||
.ace_blame-cell{
|
||||
border-top: solid 1px;
|
||||
|
|
|
@ -176,6 +176,7 @@ var BlameGutter = function(editor, blameStr) {
|
|||
|
||||
this.onMousedown = this.onMousedown.bind(this);
|
||||
this.onChangeEditor = this.onChangeEditor.bind(this);
|
||||
this.onChangeSelection = this.onChangeSelection.bind(this);
|
||||
this.onMousemove = this.onMousemove.bind(this);
|
||||
this.onMouseout = this.onMouseout.bind(this);
|
||||
|
||||
|
@ -212,6 +213,7 @@ var BlameGutter = function(editor, blameStr) {
|
|||
this.closeButton = this.resizer.firstChild;
|
||||
|
||||
gutter.on("afterRender", this.drawGutter);
|
||||
editor.on("changeSelection", this.onChangeSelection);
|
||||
this.element.addEventListener("mousedown", this.onMousedown);
|
||||
this.resizer.addEventListener("mousedown", this.onMousedown);
|
||||
|
||||
|
@ -229,6 +231,7 @@ var BlameGutter = function(editor, blameStr) {
|
|||
var editor = this.editor;
|
||||
var gutter = editor.renderer.$gutterLayer;
|
||||
gutter.off("afterRender", this.drawGutter);
|
||||
editor.off("changeSelection", this.onChangeSelection);
|
||||
|
||||
editor.blameGutter = gutter.blameColumn = this.editor = null;
|
||||
|
||||
|
@ -260,6 +263,20 @@ var BlameGutter = function(editor, blameStr) {
|
|||
this.attachToEditor(e.editor);
|
||||
};
|
||||
|
||||
this.onChangeSelection = function() {
|
||||
var renderer = this.editor.renderer;
|
||||
var row = this.session.selection.cursor.row;
|
||||
|
||||
var blameData = this.blameData || [];
|
||||
|
||||
while (!blameData[row] && row > 0) row--;
|
||||
var blameCell = blameData[row];
|
||||
if (blameCell) {
|
||||
this.selectedHash = blameCell.data.hash;
|
||||
renderer.$loop.schedule(renderer.CHANGE_GUTTER | renderer.CHANGE_MARKER);
|
||||
}
|
||||
};
|
||||
|
||||
this.drawGutter = function(e, gutter) {
|
||||
var container = gutter.blameColumn.element;
|
||||
var blameData = gutter.blameColumn.blameData;
|
||||
|
@ -268,7 +285,7 @@ var BlameGutter = function(editor, blameStr) {
|
|||
var cells = gutter.$lines.cells;
|
||||
var cache = gutter.blameColumn.$cache;
|
||||
var cacheIndex = 0;
|
||||
var offset = - getTop(gutter.element) + gutter.config.offset;
|
||||
var offset = -getTop(gutter.element);
|
||||
|
||||
var commit;
|
||||
for (var i = 0; i < cells.length; i++) {
|
||||
|
@ -280,11 +297,6 @@ var BlameGutter = function(editor, blameStr) {
|
|||
// find first row
|
||||
while (!blameData[row] && row > 0) row--;
|
||||
data = blameData[row]
|
||||
commit = {
|
||||
row: row,
|
||||
cell: cell,
|
||||
data: data,
|
||||
};
|
||||
}
|
||||
|
||||
if (!data)
|
||||
|
@ -299,7 +311,7 @@ var BlameGutter = function(editor, blameStr) {
|
|||
data: data,
|
||||
};
|
||||
}
|
||||
if (commit.cell == cell)
|
||||
if (commit)
|
||||
add(commit.data, commit.row, commit.cell);
|
||||
|
||||
function add(data, row, firstCell, nextCell) {
|
||||
|
@ -310,7 +322,7 @@ var BlameGutter = function(editor, blameStr) {
|
|||
el.index = row;
|
||||
el.textContent = data.text + " " + data.title;
|
||||
|
||||
var top = getTop(firstCell.element) - offset;
|
||||
var top = Math.max(getTop(firstCell.element) - offset, 0);
|
||||
var next = nextCell ? getTop(nextCell.element) - offset : gutter.config.height;
|
||||
el.style.top = top + "px";
|
||||
el.style.height = next - top + "px";
|
||||
|
@ -362,6 +374,8 @@ var BlameGutter = function(editor, blameStr) {
|
|||
var blameCell = blameData[target.index];
|
||||
if (!blameCell)
|
||||
return event.stopEvent(e);
|
||||
var pos = this.editor.renderer.screenToTextCoordinates(e.clientX, e.clientY);
|
||||
this.editor.selection.moveToPosition(pos);
|
||||
gutter.blameColumn.selectedHash = blameCell.data.hash;
|
||||
this.editor.renderer.$loop.schedule(this.editor.renderer.CHANGE_GUTTER);
|
||||
return event.stopEvent(e);
|
||||
|
|
|
@ -38,7 +38,7 @@ oop.inherits(CommandManager, MultiHashHandler);
|
|||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
if (typeof command === "string")
|
||||
command = this.commands[command];
|
||||
|
||||
|
@ -48,6 +48,9 @@ oop.inherits(CommandManager, MultiHashHandler);
|
|||
if (editor && editor.$readOnly && !command.readOnly)
|
||||
return false;
|
||||
|
||||
if (this.$checkCommandState != false && command.isAvailable && !command.isAvailable(editor))
|
||||
return false;
|
||||
|
||||
var e = {editor: editor, command: command, args: args};
|
||||
e.returnValue = this._emit("exec", e);
|
||||
this._signal("afterExec", e);
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* 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
|
||||
|
@ -14,7 +14,7 @@
|
|||
* * 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
|
||||
|
@ -49,7 +49,9 @@ module.exports = {
|
|||
win: "Ctrl-L"
|
||||
},
|
||||
called: false,
|
||||
exec: function(editor) { this.called = true; }
|
||||
available: true,
|
||||
exec: function(editor) { this.called = true; },
|
||||
isAvailable: function(editor) { return this.available; }
|
||||
};
|
||||
|
||||
this.cm = new CommandManager("mac", [this.command]);
|
||||
|
@ -78,6 +80,16 @@ module.exports = {
|
|||
assert.equal(command, this.command);
|
||||
},
|
||||
|
||||
"test: command isAvailable": function() {
|
||||
this.command.available = false;
|
||||
|
||||
this.cm.exec("gotoline");
|
||||
assert.ok(!this.command.called);
|
||||
this.cm.$checkCommandState = false;
|
||||
this.cm.exec("gotoline");
|
||||
assert.ok(this.command.called);
|
||||
},
|
||||
|
||||
"test: remove command by object": function() {
|
||||
this.cm.removeCommand(this.command);
|
||||
|
||||
|
@ -133,10 +145,10 @@ module.exports = {
|
|||
called += "2";
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
var statusUpdateEmitted = false;
|
||||
this._emit = function() {statusUpdateEmitted = true};
|
||||
this._emit = function() {statusUpdateEmitted = true;};
|
||||
|
||||
this.cm.exec("togglerecording", this);
|
||||
assert.ok(this.cm.recording);
|
||||
|
|
|
@ -70,6 +70,8 @@ exports.all = function() {
|
|||
return lang.copyObject(options);
|
||||
};
|
||||
|
||||
exports.$modes = {};
|
||||
|
||||
// module loading
|
||||
exports.moduleUrl = function(name, component) {
|
||||
if (options.$moduleUrls[name])
|
||||
|
|
|
@ -839,7 +839,7 @@ EditSession.$uid = 0;
|
|||
this._signal("tokenizerUpdate", e);
|
||||
};
|
||||
|
||||
this.$modes = {};
|
||||
this.$modes = config.$modes;
|
||||
|
||||
/**
|
||||
* Sets a new text mode for the `EditSession`. This method also emits the `'changeMode'` event. If a [[BackgroundTokenizer `BackgroundTokenizer`]] is set, the `'tokenizerUpdate'` event is also emitted.
|
||||
|
@ -1817,20 +1817,13 @@ EditSession.$uid = 0;
|
|||
return Math.min(indentation, maxIndent);
|
||||
}
|
||||
function addSplit(screenPos) {
|
||||
var displayed = tokens.slice(lastSplit, screenPos);
|
||||
|
||||
// The document size is the current size - the extra width for tabs
|
||||
// and multipleWidth characters.
|
||||
var len = displayed.length;
|
||||
displayed.join("")
|
||||
// Get all the TAB_SPACEs.
|
||||
.replace(/12/g, function() {
|
||||
len -= 1;
|
||||
})
|
||||
// Get all the CHAR_EXT/multipleWidth characters.
|
||||
.replace(/2/g, function() {
|
||||
len -= 1;
|
||||
});
|
||||
var len = screenPos - lastSplit;
|
||||
for (var i = lastSplit; i < screenPos; i++) {
|
||||
var ch = tokens[i];
|
||||
if (ch === 12 || ch === 2) len -= 1;
|
||||
}
|
||||
|
||||
if (!splits.length) {
|
||||
indent = getWrapIndent();
|
||||
|
@ -2503,15 +2496,22 @@ config.defineOptions(EditSession.prototype, "session", {
|
|||
if (val != this.$wrapAsCode) {
|
||||
this.$wrapAsCode = val;
|
||||
if (this.$useWrapMode) {
|
||||
this.$modified = true;
|
||||
this.$resetRowCache(0);
|
||||
this.$updateWrapData(0, this.getLength() - 1);
|
||||
this.$useWrapMode = false;
|
||||
this.setUseWrapMode(true);
|
||||
}
|
||||
}
|
||||
},
|
||||
initialValue: "auto"
|
||||
},
|
||||
indentedSoftWrap: { initialValue: true },
|
||||
indentedSoftWrap: {
|
||||
set: function() {
|
||||
if (this.$useWrapMode) {
|
||||
this.$useWrapMode = false;
|
||||
this.setUseWrapMode(true);
|
||||
}
|
||||
},
|
||||
initialValue: true
|
||||
},
|
||||
firstLineNumber: {
|
||||
set: function() {this._signal("changeBreakpoint");},
|
||||
initialValue: 1
|
||||
|
|
|
@ -51,9 +51,18 @@ var keyWordCompleter = {
|
|||
|
||||
var snippetCompleter = {
|
||||
getCompletions: function(editor, session, pos, prefix, callback) {
|
||||
var scopes = [];
|
||||
|
||||
// set scope to html-tag if we're inside an html tag
|
||||
var token = session.getTokenAt(pos.row, pos.column);
|
||||
if (token && token.type.match(/(tag-name|tag-open|tag-whitespace|attribute-name|attribute-value)\.xml$/))
|
||||
scopes.push('html-tag');
|
||||
else
|
||||
scopes = snippetManager.getActiveScopes(editor);
|
||||
|
||||
var snippetMap = snippetManager.snippetMap;
|
||||
var completions = [];
|
||||
snippetManager.getActiveScopes(editor).forEach(function(scope) {
|
||||
scopes.forEach(function(scope) {
|
||||
var snippets = snippetMap[scope] || [];
|
||||
for (var i = snippets.length; i--;) {
|
||||
var s = snippets[i];
|
||||
|
|
|
@ -81,6 +81,7 @@ var supportedModes = {
|
|||
Erlang: ["erl|hrl"],
|
||||
Forth: ["frt|fs|ldr|fth|4th"],
|
||||
Fortran: ["f|f90"],
|
||||
FSharp: ["fsi|fs|ml|mli|fsx|fsscript"],
|
||||
FTL: ["ftl"],
|
||||
Gcode: ["gcode"],
|
||||
Gherkin: ["feature"],
|
||||
|
@ -138,6 +139,7 @@ var supportedModes = {
|
|||
Pascal: ["pas|p"],
|
||||
Perl: ["pl|pm"],
|
||||
pgSQL: ["pgsql"],
|
||||
PHP_Laravel_blade: ["blade.php"],
|
||||
PHP: ["php|phtml|shtml|php3|php4|php5|phps|phpt|aw|ctp|module"],
|
||||
Pig: ["pig"],
|
||||
Powershell: ["ps1"],
|
||||
|
@ -161,6 +163,7 @@ var supportedModes = {
|
|||
SCSS: ["scss"],
|
||||
SH: ["sh|bash|^.bashrc"],
|
||||
SJS: ["sjs"],
|
||||
Slim: ["slim|skim"],
|
||||
Smarty: ["smarty|tpl"],
|
||||
snippets: ["snippets"],
|
||||
Soy_Template:["soy"],
|
||||
|
@ -202,7 +205,8 @@ var nameOverrides = {
|
|||
coffee: "CoffeeScript",
|
||||
HTML_Ruby: "HTML (Ruby)",
|
||||
HTML_Elixir: "HTML (Elixir)",
|
||||
FTL: "FreeMarker"
|
||||
FTL: "FreeMarker",
|
||||
PHP_Laravel_blade: "PHP (Blade Template)"
|
||||
};
|
||||
var modesByName = {};
|
||||
for (var name in supportedModes) {
|
||||
|
|
|
@ -144,6 +144,9 @@ var optionGroups = {
|
|||
type: "number",
|
||||
path: "printMarginColumn"
|
||||
}],
|
||||
"Indented Soft Wrap": {
|
||||
path: "indentedSoftWrap"
|
||||
},
|
||||
"Highlight selected word": {
|
||||
path: "highlightSelectedWord"
|
||||
},
|
||||
|
@ -322,7 +325,7 @@ var OptionPanel = function(editor, element) {
|
|||
value = parseFloat(value);
|
||||
if (option.onchange)
|
||||
option.onchange(value);
|
||||
else
|
||||
else if (option.path)
|
||||
this.editor.setOption(option.path, value);
|
||||
this._signal("setOption", {name: option.path, value: value});
|
||||
};
|
||||
|
|
|
@ -85,6 +85,9 @@ var TextInput = function(parentNode, host) {
|
|||
this.focus = function() {
|
||||
if (tempStyle || HAS_FOCUS_ARGS || this.$focusScroll == "browser")
|
||||
return text.focus({ preventScroll: true });
|
||||
// getBoundingClientRect on IE throws error if element is not in dom tree
|
||||
if (!document.documentElement.contains(text))
|
||||
return;
|
||||
var top = text.style.top;
|
||||
text.style.position = "fixed";
|
||||
text.style.top = "0px";
|
||||
|
|
|
@ -49,6 +49,7 @@ var Gutter = function(parentEl) {
|
|||
this.$updateAnnotations = this.$updateAnnotations.bind(this);
|
||||
|
||||
this.$lines = new Lines(this.element);
|
||||
this.$lines.$offsetCoefficient = 1;
|
||||
};
|
||||
|
||||
(function() {
|
||||
|
@ -373,7 +374,6 @@ var Gutter = function(parentEl) {
|
|||
dom.setStyle(cell.element.style, "top", this.$lines.computeLineTop(row, config, session) + "px");
|
||||
|
||||
cell.text = text;
|
||||
cell.row = row;
|
||||
return cell;
|
||||
};
|
||||
|
||||
|
|
|
@ -40,12 +40,13 @@ var Lines = function(element, canvasHeight) {
|
|||
|
||||
this.cells = [];
|
||||
this.cellCache = [];
|
||||
this.$offsetCoefficient = 0;
|
||||
};
|
||||
|
||||
(function() {
|
||||
|
||||
this.moveContainer = function(config) {
|
||||
dom.translate(this.element, 0, -((config.firstRowScreen * config.lineHeight) % this.canvasHeight));
|
||||
dom.translate(this.element, 0, -((config.firstRowScreen * config.lineHeight) % this.canvasHeight) - config.offset * this.$offsetCoefficient);
|
||||
};
|
||||
|
||||
this.pageChanged = function(oldConfig, newConfig) {
|
||||
|
@ -143,6 +144,7 @@ var Lines = function(element, canvasHeight) {
|
|||
row: row
|
||||
};
|
||||
}
|
||||
cell.row = row;
|
||||
|
||||
return cell;
|
||||
};
|
||||
|
|
|
@ -195,7 +195,7 @@ exports.importCssString = function importCssString(cssText, id, container) {
|
|||
|
||||
if (root == doc)
|
||||
root = exports.getDocumentHead(doc);
|
||||
root.appendChild(style);
|
||||
root.insertBefore(style, root.firstChild);
|
||||
};
|
||||
|
||||
exports.importCssStylsheet = function(uri, doc) {
|
||||
|
|
|
@ -1,106 +0,0 @@
|
|||
[[
|
||||
"start",
|
||||
["punctuation.definition.comment.bro","#"],
|
||||
["comment.line.number-sign.bro","#! Add countries for the originator and responder of a connection"]
|
||||
],[
|
||||
"start",
|
||||
["punctuation.definition.comment.bro","#"],
|
||||
["comment.line.number-sign.bro","#! to the connection logs."]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"start",
|
||||
["text","module Conn;"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"start",
|
||||
["text","export {"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t"],
|
||||
["storage.modifier.bro","redef"],
|
||||
["text"," "],
|
||||
["storage.type.bro","record"],
|
||||
["text"," Conn::Info += {"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t"],
|
||||
["punctuation.definition.comment.bro","#"],
|
||||
["comment.line.number-sign.bro","# Country code for the originator of the connection based "]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t"],
|
||||
["punctuation.definition.comment.bro","#"],
|
||||
["comment.line.number-sign.bro","# on a GeoIP lookup."]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\torig_cc: "],
|
||||
["storage.type.bro","string"],
|
||||
["text"," &optional &log;"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t"],
|
||||
["punctuation.definition.comment.bro","#"],
|
||||
["comment.line.number-sign.bro","# Country code for the responser of the connection based "]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t"],
|
||||
["punctuation.definition.comment.bro","#"],
|
||||
["comment.line.number-sign.bro","# on a GeoIP lookup."]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\tresp_cc: "],
|
||||
["storage.type.bro","string"],
|
||||
["text"," &optional &log;"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t};"]
|
||||
],[
|
||||
"start",
|
||||
["text","}"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"start",
|
||||
["meta.function.bro"," "],
|
||||
["storage.type.bro","connection_state_remove"],
|
||||
["meta.function.bro","("],
|
||||
["entity.name.function.bro","c: connection"],
|
||||
["meta.function.bro",") "],
|
||||
"event connection_state_remove(c: connection) "
|
||||
],[
|
||||
"start",
|
||||
["text","\t{"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t"],
|
||||
["storage.modifier.bro","local"],
|
||||
["text"," orig_loc = lookup_location(c$id$orig_h);"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t"],
|
||||
["keyword.control.bro","if"],
|
||||
["text"," ( orig_loc?$country_code )"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\tc$conn$orig_cc = orig_loc$country_code;"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"start",
|
||||
["text","\t"],
|
||||
["storage.modifier.bro","local"],
|
||||
["text"," resp_loc = lookup_location(c$id$resp_h);"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t"],
|
||||
["keyword.control.bro","if"],
|
||||
["text"," ( resp_loc?$country_code )"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\tc$conn$resp_cc = resp_loc$country_code;"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t}"]
|
||||
]]
|
|
@ -0,0 +1,140 @@
|
|||
[[
|
||||
"start",
|
||||
["comment.start","(*"],
|
||||
["comment"," fsharp "],
|
||||
["comment.start","(*"],
|
||||
["comment"," example "],
|
||||
["comment.end","*)"],
|
||||
["comment"," "],
|
||||
["comment.end","*)"]
|
||||
],[
|
||||
"start",
|
||||
["keyword","module"],
|
||||
["text"," "],
|
||||
["identifier","Test"],
|
||||
["text"," "],
|
||||
["keyword.operator","="]
|
||||
],[
|
||||
"start",
|
||||
["text"," "],
|
||||
["keyword","let"],
|
||||
["text"," "],
|
||||
["identifier","func1"],
|
||||
["text"," "],
|
||||
["identifier","x"],
|
||||
["text"," "],
|
||||
["keyword.operator","="],
|
||||
["text"," "]
|
||||
],[
|
||||
"start",
|
||||
["text"," "],
|
||||
["keyword","if"],
|
||||
["text"," "],
|
||||
["identifier","x"],
|
||||
["text"," "],
|
||||
["keyword.operator","<"],
|
||||
["text"," "],
|
||||
["constant.integer","100"],
|
||||
["text"," "],
|
||||
["keyword","then"]
|
||||
],[
|
||||
"start",
|
||||
["text"," "],
|
||||
["identifier","x"],
|
||||
["keyword.operator","*"],
|
||||
["identifier","x"]
|
||||
],[
|
||||
"start",
|
||||
["text"," "],
|
||||
["keyword","else"]
|
||||
],[
|
||||
"start",
|
||||
["text"," "],
|
||||
["identifier","x"],
|
||||
["keyword.operator","*"],
|
||||
["identifier","x"],
|
||||
["text"," "],
|
||||
["keyword.operator","+"],
|
||||
["text"," "],
|
||||
["constant.integer","1"]
|
||||
],[
|
||||
"start",
|
||||
["text"," "],
|
||||
["keyword","let"],
|
||||
["text"," "],
|
||||
["identifier","list"],
|
||||
["text"," "],
|
||||
["keyword.operator","="],
|
||||
["text"," "],
|
||||
["paren.lpar","("],
|
||||
["keyword.operator","-"],
|
||||
["constant.integer","1"],
|
||||
["text",", "],
|
||||
["constant.integer","42"],
|
||||
["paren.rpar",")"],
|
||||
["text"," :: "],
|
||||
["paren.lpar","["],
|
||||
["text"," "],
|
||||
["keyword","for"],
|
||||
["text"," "],
|
||||
["identifier","i"],
|
||||
["text"," "],
|
||||
["keyword","in"],
|
||||
["text"," "],
|
||||
["constant.integer","0"],
|
||||
["text"," .. "],
|
||||
["constant.integer","99"],
|
||||
["text"," "],
|
||||
["keyword.operator","->"],
|
||||
["text"," "],
|
||||
["paren.lpar","("],
|
||||
["identifier","i"],
|
||||
["text",", "],
|
||||
["identifier","func1"],
|
||||
["paren.lpar","("],
|
||||
["identifier","i"],
|
||||
["paren.rpar","))"],
|
||||
["text"," "],
|
||||
["paren.rpar","]"]
|
||||
],[
|
||||
"start",
|
||||
["text"," "],
|
||||
["keyword","let"],
|
||||
["text"," "],
|
||||
["identifier","verbatim"],
|
||||
["text"," "],
|
||||
["keyword.operator","="],
|
||||
["text"," "],
|
||||
["verbatim.string","@"],
|
||||
["string","\""],
|
||||
["string","c:\\Program "],
|
||||
["constant.language.escape","\"\""],
|
||||
["string"," Files\\\""]
|
||||
],[
|
||||
"start",
|
||||
["text"," "],
|
||||
["keyword","let"],
|
||||
["text"," "],
|
||||
["identifier","trippleQuote"],
|
||||
["text"," "],
|
||||
["keyword.operator","="],
|
||||
["text"," "],
|
||||
["string","\"\"\" \"hello world\" \"\"\""]
|
||||
],[
|
||||
"start",
|
||||
["text"," "]
|
||||
],[
|
||||
"start",
|
||||
["text"," "],
|
||||
["comment","// print"]
|
||||
],[
|
||||
"start",
|
||||
["text"," "],
|
||||
["identifier","printfn"],
|
||||
["text"," "],
|
||||
["string","\"The table of squares from 0 to 99 is:"],
|
||||
["constant.language.escape","\\n"],
|
||||
["string","%A\""],
|
||||
["text"," "],
|
||||
["identifier","list"]
|
||||
]]
|
|
@ -0,0 +1,173 @@
|
|||
[[
|
||||
"start"
|
||||
],[
|
||||
"start",
|
||||
["constant.language.jssmLanguage","machine_name :"],
|
||||
["text"," "],
|
||||
["entity.name.tag.jssmLabel.doublequoted","\"Three-state traffic light, plus off and flash-red\""],
|
||||
["text",";"]
|
||||
],[
|
||||
"start",
|
||||
["constant.language.jssmLanguage","machine_version :"],
|
||||
["text"," "],
|
||||
["constant.numeric","1.2.1"],
|
||||
["text",";"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"start",
|
||||
["constant.language.jssmLanguage","jssm_version :"],
|
||||
["text"," >= "],
|
||||
["constant.numeric","5.0.0"],
|
||||
["text",";"]
|
||||
],[
|
||||
"start",
|
||||
["constant.language.jssmLanguage","graph_layout :"],
|
||||
["text"," "],
|
||||
["entity.name.tag.jssmLabel.atom","dot"],
|
||||
["text",";"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"start",
|
||||
["entity.name.tag.jssmLabel.atom","on_init"],
|
||||
["text"," : "],
|
||||
["entity.name.function","${"],
|
||||
["keyword.other","setup"],
|
||||
["entity.name.function","}"],
|
||||
["text",";"]
|
||||
],[
|
||||
"start",
|
||||
["entity.name.tag.jssmLabel.atom","on_halt"],
|
||||
["text"," : "],
|
||||
["entity.name.function","${"],
|
||||
["keyword.other","finalize"],
|
||||
["entity.name.function","}"],
|
||||
["text",";"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"start",
|
||||
["punctuation.definition.comment.mn","/*"],
|
||||
["comment.block.jssm"," turn on "],
|
||||
["punctuation.definition.comment.mn","*/"]
|
||||
],[
|
||||
"start",
|
||||
["entity.name.tag.jssmLabel.atom","Off"],
|
||||
["text"," "],
|
||||
["constant.character.jssmAction","'Enable'"],
|
||||
["text"," { "],
|
||||
["entity.name.tag.jssmLabel.atom","follow"],
|
||||
["text",": "],
|
||||
["entity.name.function","${"],
|
||||
["keyword.other","turned_on"],
|
||||
["entity.name.function","}"],
|
||||
["text","; } "],
|
||||
["keyword.control.transition.jssmArrow.none_legal","->"],
|
||||
["text"," "],
|
||||
["entity.name.tag.jssmLabel.atom","Red"],
|
||||
["text",";"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"start",
|
||||
["comment.line.jssm","// main sequence"]
|
||||
],[
|
||||
"start",
|
||||
["entity.name.tag.jssmLabel.atom","Red"],
|
||||
["text"," "],
|
||||
["constant.character.jssmAction","'Proceed'"],
|
||||
["text"," "],
|
||||
["keyword.control.transition.jssmArrow.none_main","=>"],
|
||||
["text"," "],
|
||||
["entity.name.tag.jssmLabel.atom","Green"],
|
||||
["text"," "],
|
||||
["constant.character.jssmAction","'Proceed'"],
|
||||
["text"," "],
|
||||
["keyword.control.transition.jssmArrow.none_main","=>"],
|
||||
["text"," "],
|
||||
["entity.name.tag.jssmLabel.atom","Yellow"],
|
||||
["text"," "],
|
||||
["constant.character.jssmAction","'Proceed'"],
|
||||
["text"," "],
|
||||
["keyword.control.transition.jssmArrow.none_main","=>"],
|
||||
["text"," "],
|
||||
["entity.name.tag.jssmLabel.atom","Red"],
|
||||
["text",";"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"start",
|
||||
["comment.line.jssm","// emergency flash red"]
|
||||
],[
|
||||
"start",
|
||||
["text","["],
|
||||
["entity.name.tag.jssmLabel.atom","Red"],
|
||||
["text"," "],
|
||||
["entity.name.tag.jssmLabel.atom","Yellow"],
|
||||
["text"," "],
|
||||
["entity.name.tag.jssmLabel.atom","Green"],
|
||||
["text","] "],
|
||||
["constant.character.jssmAction","'Flash'"],
|
||||
["text"," "],
|
||||
["keyword.control.transition.jssmArrow.none_legal","->"],
|
||||
["text"," "],
|
||||
["entity.name.tag.jssmLabel.atom","Flash"],
|
||||
["text",";"]
|
||||
],[
|
||||
"start",
|
||||
["entity.name.tag.jssmLabel.atom","Flash"],
|
||||
["text"," "],
|
||||
["constant.character.jssmAction","'Proceed'"],
|
||||
["text"," { "],
|
||||
["entity.name.tag.jssmLabel.atom","label"],
|
||||
["text",": "],
|
||||
["constant.character.jssmAction","'no change'"],
|
||||
["text","; } "],
|
||||
["keyword.control.transition.jssmArrow.none_legal","->"],
|
||||
["text"," "],
|
||||
["entity.name.tag.jssmLabel.atom","Flash"],
|
||||
["text"," "],
|
||||
["constant.character.jssmAction","'Exit'"],
|
||||
["text"," "],
|
||||
["keyword.control.transition.jssmArrow.none_legal","->"],
|
||||
["text"," "],
|
||||
["entity.name.tag.jssmLabel.atom","Red"],
|
||||
["text",";"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"start",
|
||||
["comment.line.jssm","// turn off"]
|
||||
],[
|
||||
"start",
|
||||
["text","["],
|
||||
["entity.name.tag.jssmLabel.atom","Red"],
|
||||
["text"," "],
|
||||
["entity.name.tag.jssmLabel.atom","Yellow"],
|
||||
["text"," "],
|
||||
["entity.name.tag.jssmLabel.atom","Green"],
|
||||
["text"," "],
|
||||
["entity.name.tag.jssmLabel.atom","Flash"],
|
||||
["text","] "],
|
||||
["constant.character.jssmAction","'Disable'"],
|
||||
["text"," { "],
|
||||
["entity.name.tag.jssmLabel.atom","follow"],
|
||||
["text",": "],
|
||||
["entity.name.function","${"],
|
||||
["keyword.other","turned_off"],
|
||||
["entity.name.function","}"],
|
||||
["text","; } "],
|
||||
["keyword.control.transition.jssmArrow.none_forced","~>"],
|
||||
["text"," "],
|
||||
["entity.name.tag.jssmLabel.atom","Off"],
|
||||
["text",";"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"start"
|
||||
]]
|
|
@ -1,143 +0,0 @@
|
|||
[[
|
||||
"start",
|
||||
["keyword.control","import"],
|
||||
["text"," "],
|
||||
["identifier","logic"]
|
||||
],[
|
||||
"start",
|
||||
["keyword.control","section"]
|
||||
],[
|
||||
"start",
|
||||
["text"," "],
|
||||
["keyword.control","variables"],
|
||||
["text"," "],
|
||||
["paren.lparen","("],
|
||||
["identifier","A"],
|
||||
["text"," "],
|
||||
["punctuation.operator",":"],
|
||||
["text"," "],
|
||||
["storage.type","Type"],
|
||||
["paren.rparen",")"],
|
||||
["text"," "],
|
||||
["paren.lparen","("],
|
||||
["identifier","p"],
|
||||
["text"," "],
|
||||
["identifier","q"],
|
||||
["text"," "],
|
||||
["punctuation.operator",":"],
|
||||
["text"," "],
|
||||
["identifier","A"],
|
||||
["text"," "],
|
||||
["operator","→"],
|
||||
["text"," "],
|
||||
["storage.type","Prop"],
|
||||
["paren.rparen",")"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"start",
|
||||
["text"," "],
|
||||
["keyword.control","example"],
|
||||
["text"," "],
|
||||
["punctuation.operator",":"],
|
||||
["text"," "],
|
||||
["paren.lparen","("],
|
||||
["operator","∀"],
|
||||
["identifier","x"],
|
||||
["text"," "],
|
||||
["punctuation.operator",":"],
|
||||
["text"," "],
|
||||
["identifier","A"],
|
||||
["punctuation.operator",","],
|
||||
["text"," "],
|
||||
["identifier","p"],
|
||||
["text"," "],
|
||||
["identifier","x"],
|
||||
["text"," "],
|
||||
["operator","∧"],
|
||||
["text"," "],
|
||||
["identifier","q"],
|
||||
["text"," "],
|
||||
["identifier","x"],
|
||||
["paren.rparen",")"],
|
||||
["text"," "],
|
||||
["operator","→"],
|
||||
["text"," "],
|
||||
["operator","∀"],
|
||||
["identifier","y"],
|
||||
["text"," "],
|
||||
["punctuation.operator",":"],
|
||||
["text"," "],
|
||||
["identifier","A"],
|
||||
["punctuation.operator",","],
|
||||
["text"," "],
|
||||
["identifier","p"],
|
||||
["text"," "],
|
||||
["identifier","y"],
|
||||
["text"," "],
|
||||
["operator",":="]
|
||||
],[
|
||||
"start",
|
||||
["text"," "],
|
||||
["keyword.control","assume"],
|
||||
["text"," "],
|
||||
["identifier","H"],
|
||||
["text"," "],
|
||||
["punctuation.operator",":"],
|
||||
["text"," "],
|
||||
["operator","∀"],
|
||||
["identifier","x"],
|
||||
["text"," "],
|
||||
["punctuation.operator",":"],
|
||||
["text"," "],
|
||||
["identifier","A"],
|
||||
["punctuation.operator",","],
|
||||
["text"," "],
|
||||
["identifier","p"],
|
||||
["text"," "],
|
||||
["identifier","x"],
|
||||
["text"," "],
|
||||
["operator","∧"],
|
||||
["text"," "],
|
||||
["identifier","q"],
|
||||
["text"," "],
|
||||
["identifier","x"],
|
||||
["punctuation.operator",","]
|
||||
],[
|
||||
"start",
|
||||
["text"," "],
|
||||
["keyword.control","take"],
|
||||
["text"," "],
|
||||
["identifier","y"],
|
||||
["text"," "],
|
||||
["punctuation.operator",":"],
|
||||
["text"," "],
|
||||
["identifier","A"],
|
||||
["punctuation.operator",","]
|
||||
],[
|
||||
"start",
|
||||
["text"," "],
|
||||
["keyword.control","show"],
|
||||
["text"," "],
|
||||
["identifier","p"],
|
||||
["text"," "],
|
||||
["identifier","y"],
|
||||
["punctuation.operator",","],
|
||||
["text"," "],
|
||||
["keyword.control","from"],
|
||||
["text"," "],
|
||||
["identifier","and"],
|
||||
["punctuation.operator","."],
|
||||
["identifier","elim_left"],
|
||||
["text"," "],
|
||||
["paren.lparen","("],
|
||||
["identifier","H"],
|
||||
["text"," "],
|
||||
["identifier","y"],
|
||||
["paren.rparen",")"]
|
||||
],[
|
||||
"start",
|
||||
["keyword.control","end"]
|
||||
],[
|
||||
"start"
|
||||
]]
|
474
plugins/node_modules/ace/lib/ace/mode/_test/tokens_php_laravel_blade.json
wygenerowano
vendored
100644
474
plugins/node_modules/ace/lib/ace/mode/_test/tokens_php_laravel_blade.json
wygenerowano
vendored
100644
|
@ -0,0 +1,474 @@
|
|||
[[
|
||||
"start",
|
||||
["comment.start.xml","<!--"],
|
||||
["comment.xml"," Stored in resources/views/layouts/app.blade.php "],
|
||||
["comment.end.xml","-->"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"start",
|
||||
["meta.tag.punctuation.tag-open.xml","<"],
|
||||
["meta.tag.tag-name.xml","html"],
|
||||
["meta.tag.punctuation.tag-close.xml",">"]
|
||||
],[
|
||||
"start",
|
||||
["text.xml"," "],
|
||||
["meta.tag.punctuation.tag-open.xml","<"],
|
||||
["meta.tag.tag-name.xml","head"],
|
||||
["meta.tag.punctuation.tag-close.xml",">"]
|
||||
],[
|
||||
"start",
|
||||
["text.xml"," "],
|
||||
["meta.tag.punctuation.tag-open.xml","<"],
|
||||
["meta.tag.tag-name.xml","title"],
|
||||
["meta.tag.punctuation.tag-close.xml",">"],
|
||||
["text.xml","App Name - "],
|
||||
["directive.declaration.blade","@"],
|
||||
["keyword.directives.blade","yield"],
|
||||
["parenthesis.begin.blade","("],
|
||||
["punctuation.definition.string.begin.blade","'"],
|
||||
["string.quoted.double.blade","title"],
|
||||
["punctuation.definition.string.end.blade","'"],
|
||||
["parenthesis.end.blade",")"],
|
||||
["meta.tag.punctuation.end-tag-open.xml","</"],
|
||||
["meta.tag.tag-name.xml","title"],
|
||||
["meta.tag.punctuation.tag-close.xml",">"]
|
||||
],[
|
||||
"js-start",
|
||||
["text.xml"," "],
|
||||
["meta.tag.punctuation.tag-open.xml","<"],
|
||||
["meta.tag.script.tag-name.xml","script"],
|
||||
["meta.tag.punctuation.tag-close.xml",">"]
|
||||
],[
|
||||
"js-start",
|
||||
["text"," "],
|
||||
["storage.type","var"],
|
||||
["text"," "],
|
||||
["identifier","app"],
|
||||
["text"," "],
|
||||
["keyword.operator","="],
|
||||
["text"," "],
|
||||
["directive.declaration.blade","@"],
|
||||
["keyword.directives.blade","json"],
|
||||
["parenthesis.begin.blade","("],
|
||||
["variable.blade","$array"],
|
||||
["parenthesis.end.blade",")"],
|
||||
["punctuation.operator",";"]
|
||||
],[
|
||||
"start",
|
||||
["text"," "],
|
||||
["meta.tag.punctuation.end-tag-open.xml","</"],
|
||||
["meta.tag.script.tag-name.xml","script"],
|
||||
["meta.tag.punctuation.tag-close.xml",">"]
|
||||
],[
|
||||
"start",
|
||||
["text.xml"," "],
|
||||
["meta.tag.punctuation.end-tag-open.xml","</"],
|
||||
["meta.tag.tag-name.xml","head"],
|
||||
["meta.tag.punctuation.tag-close.xml",">"]
|
||||
],[
|
||||
"start",
|
||||
["text.xml"," "],
|
||||
["meta.tag.punctuation.tag-open.xml","<"],
|
||||
["meta.tag.tag-name.xml","body"],
|
||||
["meta.tag.punctuation.tag-close.xml",">"]
|
||||
],[
|
||||
"start",
|
||||
["text.xml"," "],
|
||||
["directive.declaration.blade","@"],
|
||||
["keyword.directives.blade","extends"],
|
||||
["parenthesis.begin.blade","("],
|
||||
["punctuation.definition.string.begin.blade","'"],
|
||||
["string.quoted.double.blade","layouts.app"],
|
||||
["punctuation.definition.string.end.blade","'"],
|
||||
["parenthesis.end.blade",")"]
|
||||
],[
|
||||
"start",
|
||||
["text.xml"," "],
|
||||
["directive.declaration.blade","@"],
|
||||
["keyword.directives.blade","section"],
|
||||
["parenthesis.begin.blade","("],
|
||||
["punctuation.definition.string.begin.blade","'"],
|
||||
["string.quoted.double.blade","sidebar"],
|
||||
["punctuation.definition.string.end.blade","'"],
|
||||
["parenthesis.end.blade",")"]
|
||||
],[
|
||||
"start",
|
||||
["text.xml"," "],
|
||||
["directive.declaration.blade","@"],
|
||||
["keyword.directives.blade","parent"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"start",
|
||||
["text.xml"," "],
|
||||
["meta.tag.punctuation.tag-open.xml","<"],
|
||||
["meta.tag.tag-name.xml","p"],
|
||||
["meta.tag.punctuation.tag-close.xml",">"],
|
||||
["text.xml","This is appended to the master sidebar."],
|
||||
["meta.tag.punctuation.end-tag-open.xml","</"],
|
||||
["meta.tag.tag-name.xml","p"],
|
||||
["meta.tag.punctuation.tag-close.xml",">"]
|
||||
],[
|
||||
"start",
|
||||
["text.xml"," "],
|
||||
["directive.declaration.blade","@"],
|
||||
["keyword.directives.blade","endsection"]
|
||||
],[
|
||||
"start",
|
||||
["text.xml"," "]
|
||||
],[
|
||||
"start",
|
||||
["text.xml"," "],
|
||||
["directive.declaration.blade","@"],
|
||||
["keyword.control.blade","if"],
|
||||
["text.xml"," "],
|
||||
["parenthesis.begin.blade","("],
|
||||
["source.blade","count"],
|
||||
["parenthesis.begin.blade","("],
|
||||
["variable.blade","$records"],
|
||||
["parenthesis.end.blade",")"],
|
||||
["source.blade"," "],
|
||||
["keyword.operator.blade","==="],
|
||||
["source.blade"," 1"],
|
||||
["parenthesis.end.blade",")"]
|
||||
],[
|
||||
"start",
|
||||
["text.xml"," I have one record!"]
|
||||
],[
|
||||
"start",
|
||||
["text.xml"," "],
|
||||
["directive.declaration.blade","@"],
|
||||
["keyword.control.blade","else"],
|
||||
["text.xml","if "],
|
||||
["parenthesis.begin.blade","("],
|
||||
["source.blade","count"],
|
||||
["parenthesis.begin.blade","("],
|
||||
["variable.blade","$records"],
|
||||
["parenthesis.end.blade",")"],
|
||||
["source.blade"," "],
|
||||
["keyword.operator.blade",">"],
|
||||
["source.blade"," 1"],
|
||||
["parenthesis.end.blade",")"]
|
||||
],[
|
||||
"start",
|
||||
["text.xml"," I have multiple records!"]
|
||||
],[
|
||||
"start",
|
||||
["text.xml"," "],
|
||||
["directive.declaration.blade","@"],
|
||||
["keyword.control.blade","else"]
|
||||
],[
|
||||
"start",
|
||||
["text.xml"," I don't have any records!"]
|
||||
],[
|
||||
"start",
|
||||
["text.xml"," "],
|
||||
["directive.declaration.blade","@"],
|
||||
["keyword.control.blade","endif"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"start",
|
||||
["text.xml"," "],
|
||||
["directive.declaration.blade","@"],
|
||||
["keyword.control.blade","foreach"],
|
||||
["text.xml"," "],
|
||||
["parenthesis.begin.blade","("],
|
||||
["variable.blade","$users"],
|
||||
["source.blade"," "],
|
||||
["keyword.operator.blade","as"],
|
||||
["source.blade"," "],
|
||||
["variable.blade","$user"],
|
||||
["parenthesis.end.blade",")"]
|
||||
],[
|
||||
"start",
|
||||
["text.xml"," "],
|
||||
["directive.declaration.blade","@"],
|
||||
["keyword.control.blade","if"],
|
||||
["text.xml"," "],
|
||||
["parenthesis.begin.blade","("],
|
||||
["variable.blade","$user"],
|
||||
["keyword.operator.blade","->"],
|
||||
["constant.other.property.blade","type"],
|
||||
["source.blade"," "],
|
||||
["keyword.operator.blade","=="],
|
||||
["source.blade"," 1"],
|
||||
["parenthesis.end.blade",")"]
|
||||
],[
|
||||
"start",
|
||||
["text.xml"," "],
|
||||
["directive.declaration.blade","@"],
|
||||
["keyword.control.blade","continue"]
|
||||
],[
|
||||
"start",
|
||||
["text.xml"," "],
|
||||
["directive.declaration.blade","@"],
|
||||
["keyword.control.blade","endif"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"start",
|
||||
["text.xml"," "],
|
||||
["meta.tag.punctuation.tag-open.xml","<"],
|
||||
["meta.tag.tag-name.xml","li"],
|
||||
["meta.tag.punctuation.tag-close.xml",">"],
|
||||
["injections.begin.blade","{{"],
|
||||
["source.blade"," "],
|
||||
["variable.blade","$user"],
|
||||
["keyword.operator.blade","->"],
|
||||
["constant.other.property.blade","name"],
|
||||
["source.blade"," "],
|
||||
["injections.end.blade","}}"],
|
||||
["meta.tag.punctuation.end-tag-open.xml","</"],
|
||||
["meta.tag.tag-name.xml","li"],
|
||||
["meta.tag.punctuation.tag-close.xml",">"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"start",
|
||||
["text.xml"," "],
|
||||
["directive.declaration.blade","@"],
|
||||
["keyword.control.blade","if"],
|
||||
["text.xml"," "],
|
||||
["parenthesis.begin.blade","("],
|
||||
["variable.blade","$user"],
|
||||
["keyword.operator.blade","->"],
|
||||
["constant.other.property.blade","number"],
|
||||
["source.blade"," "],
|
||||
["keyword.operator.blade","=="],
|
||||
["source.blade"," 5"],
|
||||
["parenthesis.end.blade",")"]
|
||||
],[
|
||||
"start",
|
||||
["text.xml"," "],
|
||||
["directive.declaration.blade","@"],
|
||||
["keyword.control.blade","break"]
|
||||
],[
|
||||
"start",
|
||||
["text.xml"," "],
|
||||
["directive.declaration.blade","@"],
|
||||
["keyword.control.blade","endif"]
|
||||
],[
|
||||
"start",
|
||||
["text.xml"," "],
|
||||
["directive.declaration.blade","@"],
|
||||
["keyword.control.blade","endforeach"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"start",
|
||||
["text.xml"," "],
|
||||
["directive.declaration.blade","@"],
|
||||
["keyword.control.blade","foreach"],
|
||||
["text.xml"," "],
|
||||
["parenthesis.begin.blade","("],
|
||||
["variable.blade","$users"],
|
||||
["source.blade"," "],
|
||||
["keyword.operator.blade","as"],
|
||||
["source.blade"," "],
|
||||
["variable.blade","$user"],
|
||||
["parenthesis.end.blade",")"]
|
||||
],[
|
||||
"start",
|
||||
["text.xml"," "],
|
||||
["directive.declaration.blade","@"],
|
||||
["keyword.control.blade","continue"],
|
||||
["parenthesis.begin.blade","("],
|
||||
["variable.blade","$user"],
|
||||
["keyword.operator.blade","->"],
|
||||
["constant.other.property.blade","type"],
|
||||
["source.blade"," "],
|
||||
["keyword.operator.blade","=="],
|
||||
["source.blade"," 1"],
|
||||
["parenthesis.end.blade",")"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"start",
|
||||
["text.xml"," "],
|
||||
["meta.tag.punctuation.tag-open.xml","<"],
|
||||
["meta.tag.tag-name.xml","li"],
|
||||
["meta.tag.punctuation.tag-close.xml",">"],
|
||||
["injections.begin.blade","{{"],
|
||||
["source.blade"," "],
|
||||
["variable.blade","$user"],
|
||||
["keyword.operator.blade","->"],
|
||||
["constant.other.property.blade","name"],
|
||||
["source.blade"," "],
|
||||
["injections.end.blade","}}"],
|
||||
["meta.tag.punctuation.end-tag-open.xml","</"],
|
||||
["meta.tag.tag-name.xml","li"],
|
||||
["meta.tag.punctuation.tag-close.xml",">"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"start",
|
||||
["text.xml"," "],
|
||||
["directive.declaration.blade","@"],
|
||||
["keyword.control.blade","break"],
|
||||
["parenthesis.begin.blade","("],
|
||||
["variable.blade","$user"],
|
||||
["keyword.operator.blade","->"],
|
||||
["constant.other.property.blade","number"],
|
||||
["source.blade"," "],
|
||||
["keyword.operator.blade","=="],
|
||||
["source.blade"," 5"],
|
||||
["parenthesis.end.blade",")"]
|
||||
],[
|
||||
"start",
|
||||
["text.xml"," "],
|
||||
["directive.declaration.blade","@"],
|
||||
["keyword.control.blade","endforeach"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"start",
|
||||
["text.xml"," "],
|
||||
["meta.tag.punctuation.tag-open.xml","<"],
|
||||
["meta.tag.tag-name.xml","div"],
|
||||
["meta.tag.punctuation.tag-close.xml",">"]
|
||||
],[
|
||||
"start",
|
||||
["text.xml"," "],
|
||||
["directive.declaration.blade","@"],
|
||||
["keyword.directives.blade","include"],
|
||||
["parenthesis.begin.blade","("],
|
||||
["punctuation.definition.string.begin.blade","'"],
|
||||
["string.quoted.double.blade","shared.errors"],
|
||||
["punctuation.definition.string.end.blade","'"],
|
||||
["parenthesis.end.blade",")"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"start",
|
||||
["text.xml"," "],
|
||||
["meta.tag.punctuation.tag-open.xml","<"],
|
||||
["meta.tag.form.tag-name.xml","form"],
|
||||
["meta.tag.punctuation.tag-close.xml",">"]
|
||||
],[
|
||||
"start",
|
||||
["text.xml"," "],
|
||||
["comment.start.xml","<!--"],
|
||||
["comment.xml"," Form Contents "],
|
||||
["comment.end.xml","-->"]
|
||||
],[
|
||||
"start",
|
||||
["text.xml"," "],
|
||||
["meta.tag.punctuation.end-tag-open.xml","</"],
|
||||
["meta.tag.form.tag-name.xml","form"],
|
||||
["meta.tag.punctuation.tag-close.xml",">"]
|
||||
],[
|
||||
"start",
|
||||
["text.xml"," "],
|
||||
["meta.tag.punctuation.end-tag-open.xml","</"],
|
||||
["meta.tag.tag-name.xml","div"],
|
||||
["meta.tag.punctuation.tag-close.xml",">"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"start",
|
||||
["text.xml"," "],
|
||||
["directive.declaration.blade","@"],
|
||||
["keyword.directives.blade","includeIf"],
|
||||
["parenthesis.begin.blade","("],
|
||||
["punctuation.definition.string.begin.blade","'"],
|
||||
["string.quoted.double.blade","view.name"],
|
||||
["punctuation.definition.string.end.blade","'"],
|
||||
["keyword.operator.blade",","],
|
||||
["source.blade"," ["],
|
||||
["punctuation.definition.string.begin.blade","'"],
|
||||
["string.quoted.double.blade","some"],
|
||||
["punctuation.definition.string.end.blade","'"],
|
||||
["source.blade"," "],
|
||||
["keyword.operator.blade","=>"],
|
||||
["source.blade"," "],
|
||||
["punctuation.definition.string.begin.blade","'"],
|
||||
["string.quoted.double.blade","data"],
|
||||
["punctuation.definition.string.end.blade","'"],
|
||||
["source.blade","]"],
|
||||
["parenthesis.end.blade",")"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"start",
|
||||
["text.xml"," "],
|
||||
["directive.declaration.blade","@"],
|
||||
["keyword.directives.blade","env"],
|
||||
["parenthesis.begin.blade","("],
|
||||
["punctuation.definition.string.begin.blade","'"],
|
||||
["string.quoted.double.blade","local"],
|
||||
["punctuation.definition.string.end.blade","'"],
|
||||
["parenthesis.end.blade",")"]
|
||||
],[
|
||||
"start",
|
||||
["text.xml"," "],
|
||||
["punctuation.definition.comment.blade","// The application is in the local environment..."]
|
||||
],[
|
||||
"start",
|
||||
["text.xml"," "],
|
||||
["directive.declaration.blade","@"],
|
||||
["keyword.directives.blade","elseenv"],
|
||||
["parenthesis.begin.blade","("],
|
||||
["punctuation.definition.string.begin.blade","'"],
|
||||
["string.quoted.double.blade","testing"],
|
||||
["punctuation.definition.string.end.blade","'"],
|
||||
["parenthesis.end.blade",")"]
|
||||
],[
|
||||
"start",
|
||||
["text.xml"," "],
|
||||
["punctuation.definition.comment.blade","// The application is in the testing environment..."]
|
||||
],[
|
||||
"start",
|
||||
["text.xml"," "],
|
||||
["directive.declaration.blade","@"],
|
||||
["keyword.control.blade","else"]
|
||||
],[
|
||||
"start",
|
||||
["text.xml"," "],
|
||||
["punctuation.definition.comment.blade","// The application is not in the local or testing environment..."]
|
||||
],[
|
||||
"start",
|
||||
["text.xml"," "],
|
||||
["directive.declaration.blade","@"],
|
||||
["keyword.directives.blade","endenv"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"start",
|
||||
["text.xml"," "],
|
||||
["meta.tag.punctuation.tag-open.xml","<"],
|
||||
["meta.tag.tag-name.xml","div"],
|
||||
["text.tag-whitespace.xml"," "],
|
||||
["entity.other.attribute-name.xml","class"],
|
||||
["keyword.operator.attribute-equals.xml","="],
|
||||
["string.attribute-value.xml","\"container\""],
|
||||
["meta.tag.punctuation.tag-close.xml",">"]
|
||||
],[
|
||||
"start",
|
||||
["text.xml"," "],
|
||||
["directive.declaration.blade","@"],
|
||||
["keyword.directives.blade","yield"],
|
||||
["parenthesis.begin.blade","("],
|
||||
["punctuation.definition.string.begin.blade","'"],
|
||||
["string.quoted.double.blade","content"],
|
||||
["punctuation.definition.string.end.blade","'"],
|
||||
["parenthesis.end.blade",")"]
|
||||
],[
|
||||
"start",
|
||||
["text.xml"," "],
|
||||
["meta.tag.punctuation.end-tag-open.xml","</"],
|
||||
["meta.tag.tag-name.xml","div"],
|
||||
["meta.tag.punctuation.tag-close.xml",">"]
|
||||
],[
|
||||
"start",
|
||||
["text.xml"," "],
|
||||
["meta.tag.punctuation.end-tag-open.xml","</"],
|
||||
["meta.tag.tag-name.xml","body"],
|
||||
["meta.tag.punctuation.tag-close.xml",">"]
|
||||
],[
|
||||
"start",
|
||||
["meta.tag.punctuation.end-tag-open.xml","</"],
|
||||
["meta.tag.tag-name.xml","html"],
|
||||
["meta.tag.punctuation.tag-close.xml",">"]
|
||||
]]
|
|
@ -0,0 +1,722 @@
|
|||
[[
|
||||
"start",
|
||||
["keyword","Red"],
|
||||
["text"," "],
|
||||
["paren.block-start","["],
|
||||
["paren.block-end","]"]
|
||||
],[
|
||||
"start",
|
||||
["variable.set-word","info:"],
|
||||
["text"," "],
|
||||
["keyword.native","func"],
|
||||
["text"," "],
|
||||
["paren.block-start","["],
|
||||
["variable.lit-word","'fn"],
|
||||
["text"," "],
|
||||
["variable.refinement","/name"],
|
||||
["text"," "],
|
||||
["variable.refinement","/intro"],
|
||||
["text"," "],
|
||||
["variable.refinement","/args"],
|
||||
["text"," "],
|
||||
["variable.refinement","/refinements"],
|
||||
["text"," "],
|
||||
["keyword","/local"],
|
||||
["text","s "],
|
||||
["variable.refinement","/return"],
|
||||
["text"," "],
|
||||
["variable.refinement","/spec"],
|
||||
["text"," "]
|
||||
],[
|
||||
"start",
|
||||
["text","\t"],
|
||||
["variable.refinement","/arg-num"],
|
||||
["text"," "],
|
||||
["variable.refinement","/arg-names"],
|
||||
["text"," "],
|
||||
["variable.refinement","/arg-types"],
|
||||
["text"," "],
|
||||
["variable.refinement","/ref-names"],
|
||||
["text"," "],
|
||||
["variable.refinement","/ref-types"],
|
||||
["text"," "],
|
||||
["variable.refinement","/ref-num"],
|
||||
["text"," "],
|
||||
["variable.refinement","/type"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t"],
|
||||
["keyword","/local"],
|
||||
["text"," "],
|
||||
["variable.word","intr"],
|
||||
["text"," "],
|
||||
["variable.word","ars"],
|
||||
["text"," "],
|
||||
["variable.word","refs"],
|
||||
["text"," "],
|
||||
["variable.word","locs"],
|
||||
["text"," "],
|
||||
["variable.word","ret"],
|
||||
["text"," "],
|
||||
["variable.word","arg"],
|
||||
["text"," "],
|
||||
["variable.word","ref"],
|
||||
["text"," "],
|
||||
["variable.word","typ"]
|
||||
],[
|
||||
"start",
|
||||
["paren.block-end","]"],
|
||||
["paren.block-start","["]
|
||||
],[
|
||||
"start",
|
||||
["text","\t"],
|
||||
["variable.set-word","intr:"],
|
||||
["text"," "],
|
||||
["keyword.action","copy"],
|
||||
["text"," "],
|
||||
["string","\"\""],
|
||||
["text"," "],
|
||||
["variable.set-word","ars:"],
|
||||
["text"," "],
|
||||
["keyword.action","make"],
|
||||
["text"," "],
|
||||
["constant.datatype!","map!"],
|
||||
["text"," "],
|
||||
["keyword.action","copy"],
|
||||
["text"," "],
|
||||
["paren.block-start","["],
|
||||
["paren.block-end","]"],
|
||||
["text"," "],
|
||||
["variable.set-word","refs:"],
|
||||
["text"," "],
|
||||
["keyword.action","make"],
|
||||
["text"," "],
|
||||
["constant.datatype!","map!"],
|
||||
["text"," "],
|
||||
["keyword.action","copy"],
|
||||
["text"," "],
|
||||
["paren.block-start","["],
|
||||
["paren.block-end","]"],
|
||||
["text"," "],
|
||||
["variable.set-word","locs:"],
|
||||
["text"," "],
|
||||
["keyword.action","copy"],
|
||||
["text"," "],
|
||||
["paren.block-start","["],
|
||||
["paren.block-end","]"],
|
||||
["text"," "],
|
||||
["variable.set-word","ret:"],
|
||||
["text"," "],
|
||||
["keyword.action","copy"],
|
||||
["text"," "],
|
||||
["paren.block-start","["],
|
||||
["paren.block-end","]"],
|
||||
["text"," "],
|
||||
["variable.set-word","typ:"],
|
||||
["text"," "],
|
||||
["variable.set-word","ref-arg:"],
|
||||
["text"," "],
|
||||
["variable.set-word","ref-arg-type:"],
|
||||
["text"," "],
|
||||
["constant.language","none"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t"],
|
||||
["keyword.control","if"],
|
||||
["text"," "],
|
||||
["keyword.function","lit-word?"],
|
||||
["text"," "],
|
||||
["variable.word","fn"],
|
||||
["text"," "],
|
||||
["paren.block-start","["],
|
||||
["variable.set-word","fn:"],
|
||||
["text"," "],
|
||||
["keyword.function","to-word"],
|
||||
["text"," "],
|
||||
["variable.word","fn"],
|
||||
["paren.block-end","]"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t"],
|
||||
["keyword.control","unless"],
|
||||
["text"," "],
|
||||
["keyword.action","find"],
|
||||
["text"," "],
|
||||
["paren.block-start","["],
|
||||
["constant.datatype!","op!"],
|
||||
["text"," "],
|
||||
["constant.datatype!","native!"],
|
||||
["text"," "],
|
||||
["constant.datatype!","function!"],
|
||||
["text"," "],
|
||||
["constant.datatype!","action!"],
|
||||
["paren.block-end","]"],
|
||||
["text"," "],
|
||||
["keyword.native","type?"],
|
||||
["variable.refinement","/word"],
|
||||
["text"," "],
|
||||
["keyword.native","get"],
|
||||
["text"," "],
|
||||
["variable.word","fn"],
|
||||
["text"," "],
|
||||
["paren.block-start","["]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t"],
|
||||
["keyword.function","cause-error"],
|
||||
["text"," "],
|
||||
["variable.lit-word","'user"],
|
||||
["text"," "],
|
||||
["variable.lit-word","'message"],
|
||||
["text"," "],
|
||||
["paren.block-start","["],
|
||||
["string","\"Only function types accepted!\""],
|
||||
["paren.block-end","]"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t"],
|
||||
["paren.block-end","]"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t"],
|
||||
["variable.set-word","out:"],
|
||||
["text"," "],
|
||||
["keyword.action","make"],
|
||||
["text"," "],
|
||||
["constant.datatype!","map!"],
|
||||
["text"," "],
|
||||
["keyword.action","copy"],
|
||||
["text"," "],
|
||||
["paren.block-start","["],
|
||||
["paren.block-end","]"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t"],
|
||||
["variable.set-word","specs:"],
|
||||
["text"," "],
|
||||
["keyword.function","spec-of"],
|
||||
["text"," "],
|
||||
["keyword.native","get"],
|
||||
["text"," "],
|
||||
["variable.word","fn"],
|
||||
["text"," "]
|
||||
],[
|
||||
"start",
|
||||
["text","\t"],
|
||||
["keyword.native","parse"],
|
||||
["text"," "],
|
||||
["variable.word","specs"],
|
||||
["text"," "],
|
||||
["paren.block-start","["]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t"],
|
||||
["variable.word","opt"],
|
||||
["text"," "],
|
||||
["paren.block-start","["],
|
||||
["keyword.native","set"],
|
||||
["text"," "],
|
||||
["variable.word","intr"],
|
||||
["text"," "],
|
||||
["constant.datatype!","string!"],
|
||||
["paren.block-end","]"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t"],
|
||||
["keyword.native","any"],
|
||||
["text"," "],
|
||||
["paren.block-start","["],
|
||||
["keyword.native","set"],
|
||||
["text"," "],
|
||||
["variable.word","arg"],
|
||||
["text"," "],
|
||||
["paren.block-start","["],
|
||||
["constant.datatype!","word!"],
|
||||
["text"," | "],
|
||||
["constant.datatype!","lit-word!"],
|
||||
["paren.block-end","]"],
|
||||
["text"," "],
|
||||
["variable.word","opt"],
|
||||
["text"," "],
|
||||
["paren.block-start","["],
|
||||
["keyword.native","set"],
|
||||
["text"," "],
|
||||
["variable.word","typ"],
|
||||
["text"," "],
|
||||
["constant.datatype!","block!"],
|
||||
["paren.block-end","]"],
|
||||
["text"," "],
|
||||
["variable.word","opt"],
|
||||
["text"," "],
|
||||
["constant.datatype!","string!"],
|
||||
["text"," "],
|
||||
["paren.parens-start","("],
|
||||
["keyword.action","put"],
|
||||
["text"," "],
|
||||
["variable.word","ars"],
|
||||
["text"," "],
|
||||
["variable.word","arg"],
|
||||
["text"," "],
|
||||
["keyword.control","either"],
|
||||
["text"," "],
|
||||
["variable.word","typ"],
|
||||
["text"," "],
|
||||
["paren.block-start","["],
|
||||
["variable.word","typ"],
|
||||
["paren.block-end","]"],
|
||||
["paren.block-start","[["],
|
||||
["constant.datatype!","any-type!"],
|
||||
["paren.block-end","]]"],
|
||||
["paren.parens-end",")"],
|
||||
["paren.block-end","]"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t"],
|
||||
["keyword.native","any"],
|
||||
["text"," "],
|
||||
["paren.block-start","["],
|
||||
["keyword.native","set"],
|
||||
["text"," "],
|
||||
["variable.word","ref"],
|
||||
["text"," "],
|
||||
["constant.datatype!","refinement!"],
|
||||
["text"," "],
|
||||
["paren.block-start","["]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t\t"],
|
||||
["keyword.control","if"],
|
||||
["text"," "],
|
||||
["paren.parens-start","("],
|
||||
["variable.word","ref"],
|
||||
["keyword.operator"," <> "],
|
||||
["keyword","/local"],
|
||||
["paren.parens-end",")"],
|
||||
["text"," "],
|
||||
["paren.parens-start","("],
|
||||
["keyword.action","put"],
|
||||
["text"," "],
|
||||
["variable.word","refs"],
|
||||
["text"," "],
|
||||
["keyword.function","to-lit-word"],
|
||||
["text"," "],
|
||||
["variable.word","ref"],
|
||||
["text"," "],
|
||||
["keyword.action","make"],
|
||||
["text"," "],
|
||||
["constant.datatype!","map!"],
|
||||
["text"," "],
|
||||
["keyword.action","copy"],
|
||||
["text"," "],
|
||||
["paren.block-start","["],
|
||||
["paren.block-end","]"],
|
||||
["paren.parens-end",")"],
|
||||
["text"," "]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t\t\t"],
|
||||
["variable.word","opt"],
|
||||
["text"," "],
|
||||
["constant.datatype!","string!"],
|
||||
["text"," "]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t\t\t"],
|
||||
["keyword.native","any"],
|
||||
["text"," "],
|
||||
["paren.block-start","["],
|
||||
["keyword.native","set"],
|
||||
["text"," "],
|
||||
["variable.word","ref-arg"],
|
||||
["text"," "],
|
||||
["constant.datatype!","word!"],
|
||||
["text"," "],
|
||||
["variable.word","opt"],
|
||||
["text"," "],
|
||||
["paren.block-start","["],
|
||||
["keyword.native","set"],
|
||||
["text"," "],
|
||||
["variable.word","ref-arg-type"],
|
||||
["text"," "],
|
||||
["constant.datatype!","block!"],
|
||||
["paren.block-end","]"],
|
||||
["text"," "]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t\t\t\t"],
|
||||
["paren.parens-start","("],
|
||||
["keyword.action","put"],
|
||||
["text"," "],
|
||||
["variable.word","refs"],
|
||||
["text","/"],
|
||||
["paren.parens-start","("],
|
||||
["keyword.function","to-word"],
|
||||
["text"," "],
|
||||
["variable.word","ref"],
|
||||
["paren.parens-end",")"],
|
||||
["text"," "],
|
||||
["keyword.function","to-lit-word"],
|
||||
["text"," "],
|
||||
["variable.word","ref-arg"],
|
||||
["text"," "],
|
||||
["keyword.control","either"],
|
||||
["text"," "],
|
||||
["variable.word","ref-arg-type"],
|
||||
["text"," "],
|
||||
["paren.block-start","["],
|
||||
["variable.word","ref-arg-type"],
|
||||
["paren.block-end","]"],
|
||||
["paren.block-start","[["],
|
||||
["constant.datatype!","any-type!"],
|
||||
["paren.block-end","]]"],
|
||||
["paren.parens-end",")"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t\t\t"],
|
||||
["paren.block-end","]"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t\t|\t"],
|
||||
["keyword.native","any"],
|
||||
["text"," "],
|
||||
["paren.block-start","["],
|
||||
["keyword.native","set"],
|
||||
["text"," "],
|
||||
["variable.word","loc"],
|
||||
["text"," "],
|
||||
["constant.datatype!","word!"],
|
||||
["text"," "],
|
||||
["paren.parens-start","("],
|
||||
["keyword.action","append"],
|
||||
["text"," "],
|
||||
["variable.word","locs"],
|
||||
["text"," "],
|
||||
["variable.word","loc"],
|
||||
["paren.parens-end",")"],
|
||||
["text"," "],
|
||||
["variable.word","opt"],
|
||||
["text"," "],
|
||||
["constant.datatype!","string!"],
|
||||
["paren.block-end","]"],
|
||||
["text"," "]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t\t\t"],
|
||||
["variable.word","opt"],
|
||||
["text"," "],
|
||||
["paren.block-start","["],
|
||||
["constant.datatype!","set-word!"],
|
||||
["text"," "],
|
||||
["keyword.native","set"],
|
||||
["text"," "],
|
||||
["variable.word","ret"],
|
||||
["text"," "],
|
||||
["constant.datatype!","block!"],
|
||||
["paren.block-end","]"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t"],
|
||||
["paren.block-end","]]"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t"],
|
||||
["paren.parens-start","("]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t"],
|
||||
["variable.set-word","out:"],
|
||||
["text"," "],
|
||||
["keyword.control","case"],
|
||||
["text"," "],
|
||||
["paren.block-start","["]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t\t"],
|
||||
["keyword.view.option","name"],
|
||||
["text","\t\t"],
|
||||
["paren.block-start","["],
|
||||
["keyword.function","to-word"],
|
||||
["text"," "],
|
||||
["variable.word","fn"],
|
||||
["paren.block-end","]"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t\t"],
|
||||
["variable.word","intro"],
|
||||
["text"," \t\t"],
|
||||
["paren.block-start","["],
|
||||
["variable.word","intr"],
|
||||
["paren.block-end","]"],
|
||||
["text"," "]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t\t"],
|
||||
["variable.word","args"],
|
||||
["text","\t\t"],
|
||||
["paren.block-start","["],
|
||||
["variable.word","ars"],
|
||||
["paren.block-end","]"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t\t"],
|
||||
["variable.word","arg-num"],
|
||||
["text","\t\t"],
|
||||
["paren.block-start","["],
|
||||
["keyword.action","length?"],
|
||||
["text"," "],
|
||||
["variable.word","ars"],
|
||||
["paren.block-end","]"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t\t"],
|
||||
["variable.word","arg-names"],
|
||||
["text"," \t"],
|
||||
["paren.block-start","["],
|
||||
["keyword.action","copy"],
|
||||
["text"," "],
|
||||
["keyword.function","keys-of"],
|
||||
["text"," "],
|
||||
["variable.word","ars"],
|
||||
["paren.block-end","]"],
|
||||
["text"," "]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t\t"],
|
||||
["variable.word","arg-types"],
|
||||
["text","\t"],
|
||||
["paren.block-start","["],
|
||||
["keyword.action","copy"],
|
||||
["text"," "],
|
||||
["keyword.function","values-of"],
|
||||
["text"," "],
|
||||
["variable.word","ars"],
|
||||
["paren.block-end","]"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t\t"],
|
||||
["variable.word","refinements"],
|
||||
["text"," "],
|
||||
["paren.block-start","["],
|
||||
["variable.word","refs"],
|
||||
["paren.block-end","]"],
|
||||
["text"," "]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t\t"],
|
||||
["variable.word","ref-names"],
|
||||
["text","\t"],
|
||||
["paren.block-start","["],
|
||||
["keyword.action","copy"],
|
||||
["text"," "],
|
||||
["keyword.function","keys-of"],
|
||||
["text"," "],
|
||||
["variable.word","refs"],
|
||||
["paren.block-end","]"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t\t"],
|
||||
["variable.word","ref-types"],
|
||||
["text","\t"],
|
||||
["paren.block-start","["],
|
||||
["keyword.action","copy"],
|
||||
["text"," "],
|
||||
["keyword.function","values-of"],
|
||||
["text"," "],
|
||||
["variable.word","refs"],
|
||||
["paren.block-end","]"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t\t"],
|
||||
["variable.word","ref-num"],
|
||||
["text","\t\t"],
|
||||
["paren.block-start","["],
|
||||
["keyword.action","length?"],
|
||||
["text"," "],
|
||||
["variable.word","refs"],
|
||||
["paren.block-end","]"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t\t"],
|
||||
["variable.word","locals"],
|
||||
["text"," \t\t"],
|
||||
["paren.block-start","["],
|
||||
["variable.word","locs"],
|
||||
["paren.block-end","]"],
|
||||
["text"," "]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t\t"],
|
||||
["keyword.control","return"],
|
||||
["text"," \t\t"],
|
||||
["paren.block-start","["],
|
||||
["variable.word","ret"],
|
||||
["paren.block-end","]"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t\t"],
|
||||
["variable.word","spec"],
|
||||
["text","\t\t"],
|
||||
["paren.block-start","["],
|
||||
["variable.word","specs"],
|
||||
["paren.block-end","]"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t\t"],
|
||||
["constant.language","true"],
|
||||
["text"," \t\t"],
|
||||
["paren.block-start","["]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t\t\t"],
|
||||
["keyword.action","make"],
|
||||
["text"," "],
|
||||
["constant.datatype!","object!"],
|
||||
["text"," "],
|
||||
["paren.block-start","["]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t\t\t\t"],
|
||||
["keyword.view.option","name"],
|
||||
["text",": \t\t"],
|
||||
["keyword.function","to-word"],
|
||||
["text"," "],
|
||||
["variable.word","fn"],
|
||||
["text"," "]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t\t\t\t"],
|
||||
["variable.set-word","intro:"],
|
||||
["text"," \t\t"],
|
||||
["variable.word","intr"],
|
||||
["text"," "]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t\t\t\t"],
|
||||
["variable.set-word","args:"],
|
||||
["text"," \t\t"],
|
||||
["variable.word","ars"],
|
||||
["text"," "]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t\t\t\t"],
|
||||
["variable.set-word","refinements:"],
|
||||
["text"," "],
|
||||
["variable.word","refs"],
|
||||
["text"," "]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t\t\t\t"],
|
||||
["variable.set-word","locals:"],
|
||||
["text"," \t"],
|
||||
["variable.word","locs"],
|
||||
["text"," "]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t\t\t\t"],
|
||||
["keyword.control","return"],
|
||||
["text",": \t"],
|
||||
["variable.word","ret"],
|
||||
["text"," "]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t\t\t\t"],
|
||||
["variable.set-word","spec:"],
|
||||
["text"," \t\t"],
|
||||
["variable.word","specs"],
|
||||
["text"," "]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t\t\t\t"],
|
||||
["variable.set-word","type:"],
|
||||
["text"," \t\t"],
|
||||
["keyword.native","type?"],
|
||||
["text"," "],
|
||||
["keyword.native","get"],
|
||||
["text"," "],
|
||||
["variable.word","fn"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t\t\t\t"],
|
||||
["variable.set-word","arg-num:"],
|
||||
["text"," \t"],
|
||||
["keyword.action","length?"],
|
||||
["text"," "],
|
||||
["variable.word","args"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t\t\t\t"],
|
||||
["variable.set-word","arg-names:"],
|
||||
["text"," \t"],
|
||||
["keyword.action","copy"],
|
||||
["text"," "],
|
||||
["keyword.function","keys-of"],
|
||||
["text"," "],
|
||||
["variable.word","args"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t\t\t\t"],
|
||||
["variable.set-word","arg-types:"],
|
||||
["text"," \t"],
|
||||
["keyword.action","copy"],
|
||||
["text"," "],
|
||||
["keyword.function","values-of"],
|
||||
["text"," "],
|
||||
["variable.word","args"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t\t\t\t"],
|
||||
["variable.set-word","ref-names:"],
|
||||
["text"," \t"],
|
||||
["keyword.action","copy"],
|
||||
["text"," "],
|
||||
["keyword.function","keys-of"],
|
||||
["text"," "],
|
||||
["variable.word","refinements"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t\t\t\t"],
|
||||
["variable.set-word","ref-types:"],
|
||||
["text"," \t"],
|
||||
["keyword.action","copy"],
|
||||
["text"," "],
|
||||
["keyword.function","values-of"],
|
||||
["text"," "],
|
||||
["variable.word","refinements"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t\t\t\t"],
|
||||
["variable.set-word","ref-num:"],
|
||||
["text","\t"],
|
||||
["keyword.action","length?"],
|
||||
["text"," "],
|
||||
["variable.word","refinements"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t\t\t"],
|
||||
["paren.block-end","]"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t\t"],
|
||||
["paren.block-end","]"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t\t"],
|
||||
["paren.block-end","]"],
|
||||
["paren.parens-end",")"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t"],
|
||||
["paren.block-end","]"]
|
||||
],[
|
||||
"start",
|
||||
["text","\t"],
|
||||
["variable.word","out"]
|
||||
],[
|
||||
"start",
|
||||
["paren.block-end","]"]
|
||||
],[
|
||||
"start"
|
||||
]]
|
|
@ -1,181 +0,0 @@
|
|||
[[
|
||||
"start",
|
||||
["entity.name.tag.slim","doctype"],
|
||||
["text"," html"]
|
||||
],[
|
||||
"start",
|
||||
["entity.name.tag.slim","html"]
|
||||
],[
|
||||
"start",
|
||||
["meta.tag"," "],
|
||||
["entity.name.tag.slim","head"]
|
||||
],[
|
||||
"start",
|
||||
["meta.tag"," "],
|
||||
["entity.name.tag.slim","title"],
|
||||
["text"," Slim Examples"]
|
||||
],[
|
||||
"entity.other.attribute-name.event.slim",
|
||||
["meta.tag"," "],
|
||||
["entity.name.tag.slim","meta"],
|
||||
["text"," "],
|
||||
["entity.other.attribute-name.event.slim","name"],
|
||||
["text","="],
|
||||
["punctuation.definition.string.begin.html","\""],
|
||||
["string.quoted.double.html","keywords"],
|
||||
["punctuation.definition.string.end.html","\""],
|
||||
["text"," "],
|
||||
["entity.other.attribute-name.event.slim","content"],
|
||||
["text","="],
|
||||
["punctuation.definition.string.begin.html","\""],
|
||||
["string.quoted.double.html","template language"],
|
||||
["punctuation.definition.string.end.html","\""]
|
||||
],[
|
||||
["entity.other.attribute-name.event.slim","entity.other.attribute-name.event.slim"],
|
||||
["text"," meta "],
|
||||
["entity.other.attribute-name.event.slim","name"],
|
||||
["text","="],
|
||||
["punctuation.definition.string.begin.html","\""],
|
||||
["string.quoted.double.html","author"],
|
||||
["punctuation.definition.string.end.html","\""],
|
||||
["text"," "],
|
||||
["entity.other.attribute-name.event.slim","content"],
|
||||
["text","="],
|
||||
["text","author"]
|
||||
],[
|
||||
["entity.other.attribute-name.event.slim","entity.other.attribute-name.event.slim","entity.other.attribute-name.event.slim","entity.other.attribute-name.event.slim","entity.other.attribute-name.event.slim","entity.other.attribute-name.event.slim"],
|
||||
["text"," link "],
|
||||
["entity.other.attribute-name.event.slim","rel"],
|
||||
["text","="],
|
||||
["punctuation.definition.string.begin.html","\""],
|
||||
["string.quoted.double.html","icon"],
|
||||
["punctuation.definition.string.end.html","\""],
|
||||
["text"," "],
|
||||
["entity.other.attribute-name.event.slim","type"],
|
||||
["text","="],
|
||||
["punctuation.definition.string.begin.html","\""],
|
||||
["string.quoted.double.html","image/png"],
|
||||
["punctuation.definition.string.end.html","\""],
|
||||
["text"," "],
|
||||
["entity.other.attribute-name.event.slim","href"],
|
||||
["text","="],
|
||||
["text","file_path("],
|
||||
["punctuation.definition.string.begin.html","\""],
|
||||
["string.quoted.double.html","favicon.png"],
|
||||
["punctuation.definition.string.end.html","\""],
|
||||
["text",")"]
|
||||
],[
|
||||
["entity.other.attribute-name.event.slim","entity.other.attribute-name.event.slim","entity.other.attribute-name.event.slim","entity.other.attribute-name.event.slim"],
|
||||
["text"," javascript:"]
|
||||
],[
|
||||
["entity.other.attribute-name.event.slim","entity.other.attribute-name.event.slim"],
|
||||
["text"," alert("],
|
||||
["punctuation.definition.string.begin.html","'"],
|
||||
["string.quoted.single.html","Slim supports embedded javascript!"],
|
||||
["punctuation.definition.string.end.html","'"],
|
||||
["text",")"]
|
||||
],[
|
||||
"entity.other.attribute-name.event.slim"
|
||||
],[
|
||||
"start",
|
||||
["text"," body"]
|
||||
],[
|
||||
"start",
|
||||
["meta.tag"," "],
|
||||
["entity.name.tag.slim","h1"],
|
||||
["text"," Markup examples"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"start",
|
||||
["meta.tag"," "],
|
||||
["entity.name.tag.slim","#"],
|
||||
["entity.other.attribute-name.event.slim","content"]
|
||||
],[
|
||||
"start",
|
||||
["meta.tag"," "],
|
||||
["entity.name.tag.slim","p"],
|
||||
["text"," This example shows you how a basic Slim file looks."]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"start",
|
||||
["text"," "],
|
||||
["meta.line.ruby.slim","== yield"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"start",
|
||||
["text"," "],
|
||||
["meta.line.ruby.slim","- if items.any?"]
|
||||
],[
|
||||
"start",
|
||||
["meta.tag"," "],
|
||||
["entity.name.tag.slim","table"],
|
||||
["punctuation.separator.key-value.html","#"],
|
||||
["entity.other.attribute-name.html","items"]
|
||||
],[
|
||||
"start",
|
||||
["text"," "],
|
||||
["meta.line.ruby.slim","- for item in items"]
|
||||
],[
|
||||
"start",
|
||||
["meta.tag"," "],
|
||||
["entity.name.tag.slim","tr"]
|
||||
],[
|
||||
"start",
|
||||
["meta.tag"," "],
|
||||
["entity.name.tag.slim","td"],
|
||||
["punctuation.separator.key-value.html","."],
|
||||
["entity.other.attribute-name.html","name"],
|
||||
["text"," "],
|
||||
["meta.line.ruby.slim","= item.name"]
|
||||
],[
|
||||
"start",
|
||||
["meta.tag"," "],
|
||||
["entity.name.tag.slim","td"],
|
||||
["punctuation.separator.key-value.html","."],
|
||||
["entity.other.attribute-name.html","price"],
|
||||
["text"," "],
|
||||
["meta.line.ruby.slim","= item.price"]
|
||||
],[
|
||||
"start",
|
||||
["text"," "],
|
||||
["meta.line.ruby.slim","- else"]
|
||||
],[
|
||||
"start",
|
||||
["meta.tag"," "],
|
||||
["entity.name.tag.slim","p"],
|
||||
["text"," No items found. Please add some inventory."]
|
||||
],[
|
||||
"start",
|
||||
["meta.tag"," "],
|
||||
["entity.name.tag.slim","Thank"],
|
||||
["text"," you!"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"start",
|
||||
["meta.tag"," "],
|
||||
["entity.name.tag.slim","div"],
|
||||
["text"," "],
|
||||
["entity.other.attribute-name.event.slim","id"],
|
||||
["text","="],
|
||||
["punctuation.definition.string.begin.html","\""],
|
||||
["string.quoted.double.html","footer"],
|
||||
["punctuation.definition.string.end.html","\""]
|
||||
],[
|
||||
"start",
|
||||
["text"," "],
|
||||
["meta.line.ruby.slim","== render 'footer'"]
|
||||
],[
|
||||
"start",
|
||||
["text"," | Copyright © "],
|
||||
["punctuation.section.embedded.ruby","#{"],
|
||||
["source.ruby.embedded.html","@year"],
|
||||
["punctuation.section.embedded.ruby","}"],
|
||||
["text"," "],
|
||||
["punctuation.section.embedded.ruby","#{"],
|
||||
["source.ruby.embedded.html","@author"],
|
||||
["punctuation.section.embedded.ruby","}"]
|
||||
]]
|
|
@ -0,0 +1,160 @@
|
|||
[[
|
||||
"start",
|
||||
["keyword.html.tags.slim","doctype html"]
|
||||
],[
|
||||
"start",
|
||||
["keyword.html.tags.slim","html"]
|
||||
],[
|
||||
"start",
|
||||
["keyword.html.tags.slim"," head"]
|
||||
],[
|
||||
"start",
|
||||
["keyword.html.tags.slim"," title"],
|
||||
["text"," Slim Examples"]
|
||||
],[
|
||||
"start",
|
||||
["keyword.html.tags.slim"," meta"],
|
||||
["text"," name"],
|
||||
["keyword.operator.equals.slim","="],
|
||||
["string","\"keywords\""],
|
||||
["text"," content"],
|
||||
["keyword.operator.equals.slim","="],
|
||||
["string","\"template language\""]
|
||||
],[
|
||||
"start",
|
||||
["keyword.html.tags.slim"," meta"],
|
||||
["text"," name"],
|
||||
["keyword.operator.equals.slim","="],
|
||||
["string","\"author\""],
|
||||
["text"," content"],
|
||||
["keyword.operator.equals.slim","="],
|
||||
["text","author"]
|
||||
],[
|
||||
"start",
|
||||
["keyword.html.tags.slim"," link"],
|
||||
["text"," rel"],
|
||||
["keyword.operator.equals.slim","="],
|
||||
["string","\"icon\""],
|
||||
["text"," type"],
|
||||
["keyword.operator.equals.slim","="],
|
||||
["string","\"image/png\""],
|
||||
["text"," href"],
|
||||
["keyword.operator.equals.slim","="],
|
||||
["text","file_path"],
|
||||
["paren","("],
|
||||
["string","\"favicon.png\""],
|
||||
["paren",")"]
|
||||
],[
|
||||
["language-embed",[],[" ","javascript"],"start"],
|
||||
["keyword"," javascript:"]
|
||||
],[
|
||||
["language-embed","no_regex",[" ","javascript"],"start"],
|
||||
["text"," "],
|
||||
["text"," "],
|
||||
["support.function","alert"],
|
||||
["paren.lparen","("],
|
||||
["string","'Slim supports embedded javascript!'"],
|
||||
["paren.rparen",")"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"start",
|
||||
["keyword.html.tags.slim"," body"]
|
||||
],[
|
||||
"start",
|
||||
["keyword.html.tags.slim"," h1"],
|
||||
["text"," Markup examples"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"start",
|
||||
["keyword.slim"," #content"]
|
||||
],[
|
||||
"start",
|
||||
["keyword.html.tags.slim"," p"],
|
||||
["text"," This example shows you how a basic Slim file looks."]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"start",
|
||||
["keyword.control.slim"," =="],
|
||||
["text"," "],
|
||||
["list.ruby.operators.slim","yield"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"start",
|
||||
["keyword.control.slim"," -"],
|
||||
["text"," "],
|
||||
["list.ruby.operators.slim","if"],
|
||||
["text"," items.any?"]
|
||||
],[
|
||||
"start",
|
||||
["keyword.html.tags.slim"," table#items"]
|
||||
],[
|
||||
"start",
|
||||
["keyword.control.slim"," -"],
|
||||
["text"," "],
|
||||
["list.ruby.operators.slim","for"],
|
||||
["text"," item "],
|
||||
["list.ruby.operators.slim","in"],
|
||||
["text"," items"]
|
||||
],[
|
||||
"start",
|
||||
["keyword.html.tags.slim"," tr"]
|
||||
],[
|
||||
"start",
|
||||
["keyword.html.tags.slim"," td.name"],
|
||||
["text"," "],
|
||||
["keyword.operator.equals.slim","="],
|
||||
["text"," item.name"]
|
||||
],[
|
||||
"start",
|
||||
["keyword.html.tags.slim"," td.price"],
|
||||
["text"," "],
|
||||
["keyword.operator.equals.slim","="],
|
||||
["text"," item.price"]
|
||||
],[
|
||||
"start",
|
||||
["keyword.control.slim"," -"],
|
||||
["text"," "],
|
||||
["list.ruby.operators.slim","else"]
|
||||
],[
|
||||
"start",
|
||||
["keyword.html.tags.slim"," p"],
|
||||
["text"," No items found. Please add some inventory."]
|
||||
],[
|
||||
"start",
|
||||
["text"," Thank you!"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"start",
|
||||
["keyword.html.tags.slim"," div"],
|
||||
["text"," id"],
|
||||
["keyword.operator.equals.slim","="],
|
||||
["string","\"footer\""]
|
||||
],[
|
||||
"start",
|
||||
["keyword.control.slim"," =="],
|
||||
["text"," render "],
|
||||
["string","'footer'"]
|
||||
],[
|
||||
["mlString",6],
|
||||
["string"," | Copyright © #{@year} #{@author}"]
|
||||
],[
|
||||
["mlString",6],
|
||||
["indent"," "],
|
||||
["string","indenting test"]
|
||||
],[
|
||||
"start"
|
||||
],[
|
||||
"start",
|
||||
["keyword.control.slim"," -"],
|
||||
["text"," "],
|
||||
["class.variable.slim","@page_current"],
|
||||
["text"," "],
|
||||
["keyword.operator.ruby.embedded.slim","="],
|
||||
["text"," "],
|
||||
["list.meta.slim","true"]
|
||||
]]
|
|
@ -0,0 +1,55 @@
|
|||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Distributed under the BSD license:
|
||||
*
|
||||
* Copyright (c) 2012, 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 FSharpHighlightRules = require("./fsharp_highlight_rules").FSharpHighlightRules;
|
||||
|
||||
var Mode = function () {
|
||||
TextMode.call(this);
|
||||
this.HighlightRules = FSharpHighlightRules;
|
||||
};
|
||||
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
|
||||
(function () {
|
||||
this.lineCommentStart = "//";
|
||||
this.blockComment = {start: "(*", end: "*)"};
|
||||
|
||||
|
||||
this.$id = "ace/mode/fsharp";
|
||||
}).call(Mode.prototype);
|
||||
|
||||
exports.Mode = Mode;
|
||||
});
|
|
@ -0,0 +1,168 @@
|
|||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Distributed under the BSD license:
|
||||
*
|
||||
* Copyright (c) 2012, 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 TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
||||
var FSharpHighlightRules = function () {
|
||||
|
||||
var keywordMapper = this.createKeywordMapper({
|
||||
"variable": "this",
|
||||
"keyword": 'abstract|assert|base|begin|class|default|delegate|done|downcast|downto|elif\
|
||||
|else|exception|extern|false|finally|function|global|inherit|inline|interface|internal|lazy|match\
|
||||
|member|module|mutable|namespace|open|or|override|private|public|rec|return|return!|select|static\
|
||||
|struct|then|to|true|try|typeof|upcast|use|use!|val|void|when|while|with|yield|yield!|__SOURCE_DIRECTORY__\
|
||||
|as|asr|land|lor|lsl|lsr|lxor|mod|sig|atomic|break|checked|component|const|constraint|constructor|continue\
|
||||
|eager|event|external|fixed|functor|include|method|mixin|object|parallel|process|protected|pure|sealed|tailcall\
|
||||
|trait|virtual|volatile|and|do|end|for|fun|if|in|let|let!|new|not|null|of|endif',
|
||||
"constant": "true|false"
|
||||
}, "identifier");
|
||||
|
||||
var floatNumber = "(?:(?:(?:(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.))|(?:\\d+))(?:[eE][+-]?\\d+))|(?:(?:(?:\\d+)?(?:\\.\\d+))|(?:(?:\\d+)\\.)))";
|
||||
|
||||
this.$rules = {
|
||||
"start": [
|
||||
{
|
||||
token: "variable.classes",
|
||||
regex: '\\[\\<[.]*\\>\\]'
|
||||
},
|
||||
{
|
||||
token: "comment",
|
||||
regex: '//.*$'
|
||||
},
|
||||
{
|
||||
token: "comment.start",
|
||||
regex: /\(\*/,
|
||||
push: "blockComment"
|
||||
},
|
||||
{
|
||||
token: "string",
|
||||
regex: "'.'"
|
||||
},
|
||||
{
|
||||
token: "string",
|
||||
regex: '"""',
|
||||
next : [{
|
||||
token : "constant.language.escape",
|
||||
regex : /\\./,
|
||||
next : "qqstring"
|
||||
}, {
|
||||
token : "string",
|
||||
regex : '"""',
|
||||
next : "start"
|
||||
}, {
|
||||
defaultToken: "string"
|
||||
}]
|
||||
},
|
||||
{
|
||||
token: "string",
|
||||
regex: '"',
|
||||
next : [{
|
||||
token : "constant.language.escape",
|
||||
regex : /\\./,
|
||||
next : "qqstring"
|
||||
}, {
|
||||
token : "string",
|
||||
regex : '"',
|
||||
next : "start"
|
||||
}, {
|
||||
defaultToken: "string"
|
||||
}]
|
||||
},
|
||||
{
|
||||
token: ["verbatim.string", "string"],
|
||||
regex: '(@?)(")',
|
||||
stateName : "qqstring",
|
||||
next : [{
|
||||
token : "constant.language.escape",
|
||||
regex : '""'
|
||||
}, {
|
||||
token : "string",
|
||||
regex : '"',
|
||||
next : "start"
|
||||
}, {
|
||||
defaultToken: "string"
|
||||
}]
|
||||
},
|
||||
{
|
||||
token: "constant.float",
|
||||
regex: "(?:" + floatNumber + "|\\d+)[jJ]\\b"
|
||||
},
|
||||
{
|
||||
token: "constant.float",
|
||||
regex: floatNumber
|
||||
},
|
||||
{
|
||||
token: "constant.integer",
|
||||
regex: "(?:(?:(?:[1-9]\\d*)|(?:0))|(?:0[oO]?[0-7]+)|(?:0[xX][\\dA-Fa-f]+)|(?:0[bB][01]+))\\b"
|
||||
},
|
||||
{
|
||||
token: ["keyword.type", "variable"],
|
||||
regex: "(type\\s)([a-zA-Z0-9_$\-]*\\b)"
|
||||
},
|
||||
{
|
||||
token: keywordMapper,
|
||||
regex: "[a-zA-Z_$][a-zA-Z0-9_$]*\\b"
|
||||
},
|
||||
{
|
||||
token: "keyword.operator",
|
||||
regex: "\\+\\.|\\-\\.|\\*\\.|\\/\\.|#|;;|\\+|\\-|\\*|\\*\\*\\/|\\/\\/|%|<<|>>|&|\\||\\^|~|<|>|<=|=>|==|!=|<>|<-|="
|
||||
},
|
||||
{
|
||||
token: "paren.lpar",
|
||||
regex: "[[({]"
|
||||
},
|
||||
{
|
||||
token: "paren.rpar",
|
||||
regex: "[\\])}]"
|
||||
}
|
||||
],
|
||||
blockComment: [{
|
||||
regex: /\(\*/,
|
||||
token: "comment.start",
|
||||
push: "blockComment"
|
||||
}, {
|
||||
regex: /\*\)/,
|
||||
token: "comment.end",
|
||||
next: "pop"
|
||||
}, {
|
||||
defaultToken: "comment"
|
||||
}]
|
||||
};
|
||||
this.normalizeRules();
|
||||
};
|
||||
|
||||
|
||||
oop.inherits(FSharpHighlightRules, TextHighlightRules);
|
||||
|
||||
exports.FSharpHighlightRules = FSharpHighlightRules;
|
||||
});
|
|
@ -43,9 +43,12 @@ var Mode = function() {
|
|||
this.HighlightRules = MarkdownHighlightRules;
|
||||
|
||||
this.createModeDelegates({
|
||||
"js-": JavaScriptMode,
|
||||
"xml-": XmlMode,
|
||||
"html-": HtmlMode
|
||||
javascript: require("./javascript").Mode,
|
||||
html: require("./html").Mode,
|
||||
bash: require("./sh").Mode,
|
||||
sh: require("./sh").Mode,
|
||||
xml: require("./xml").Mode,
|
||||
css: require("./css").Mode
|
||||
});
|
||||
|
||||
this.foldingRules = new MarkdownFoldMode();
|
||||
|
|
|
@ -31,30 +31,62 @@
|
|||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var modes = require("../config").$modes;
|
||||
|
||||
var oop = require("../lib/oop");
|
||||
var lang = require("../lib/lang");
|
||||
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
||||
var JavaScriptHighlightRules = require("./javascript_highlight_rules").JavaScriptHighlightRules;
|
||||
var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
|
||||
var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
|
||||
var CssHighlightRules = require("./css_highlight_rules").CssHighlightRules;
|
||||
|
||||
var escaped = function(ch) {
|
||||
return "(?:[^" + lang.escapeRegExp(ch) + "\\\\]|\\\\.)*";
|
||||
};
|
||||
|
||||
function github_embed(tag, prefix) {
|
||||
return { // Github style block
|
||||
token : "support.function",
|
||||
regex : "^\\s*```" + tag + "\\s*$",
|
||||
push : prefix + "start"
|
||||
};
|
||||
}
|
||||
|
||||
var MarkdownHighlightRules = function() {
|
||||
HtmlHighlightRules.call(this);
|
||||
// regexp must not have capturing parentheses
|
||||
// regexps are ordered -> the first match is used
|
||||
var codeBlockStartRule = {
|
||||
token : "support.function",
|
||||
regex : /^\s*(```+[^`]*|~~~+[^~]*)$/,
|
||||
onMatch: function(value, state, stack, line) {
|
||||
var m = value.match(/^(\s*)([`~]+)(.*)/);
|
||||
var language = /[\w-]+|$/.exec(m[3])[0];
|
||||
// TODO lazy-load modes
|
||||
if (!modes[language])
|
||||
language = "";
|
||||
stack.unshift("githubblock", [], [m[1], m[2], language], state);
|
||||
return this.token;
|
||||
},
|
||||
next : "githubblock"
|
||||
};
|
||||
var codeBlockRules = [{
|
||||
token : "support.function",
|
||||
regex : ".*",
|
||||
onMatch: function(value, state, stack, line) {
|
||||
var embedState = stack[1];
|
||||
var indent = stack[2][0];
|
||||
var endMarker = stack[2][1];
|
||||
var language = stack[2][2];
|
||||
|
||||
var m = /^(\s*)(`+|~+)\s*$/.exec(value);
|
||||
if (
|
||||
m && m[1].length < indent.length + 3
|
||||
&& m[2].length >= endMarker.length && m[2][0] == endMarker[0]
|
||||
) {
|
||||
stack.splice(0, 3);
|
||||
this.next = stack.shift();
|
||||
return this.token;
|
||||
}
|
||||
this.next = "";
|
||||
if (language && modes[language]) {
|
||||
var data = modes[language].getTokenizer().getLineTokens(value, embedState.slice(0));
|
||||
stack[1] = data.state;
|
||||
return data.tokens;
|
||||
}
|
||||
return this.token;
|
||||
}
|
||||
}];
|
||||
|
||||
this.$rules["start"].unshift({
|
||||
token : "empty_line",
|
||||
|
@ -73,15 +105,8 @@ var MarkdownHighlightRules = function() {
|
|||
regex : /^#{1,6}(?=\s|$)/,
|
||||
next : "header"
|
||||
},
|
||||
github_embed("(?:javascript|js)", "jscode-"),
|
||||
github_embed("xml", "xmlcode-"),
|
||||
github_embed("html", "htmlcode-"),
|
||||
github_embed("css", "csscode-"),
|
||||
{ // Github style block
|
||||
token : "support.function",
|
||||
regex : "^\\s*```\\s*\\S*(?:{.*?\\})?\\s*$",
|
||||
next : "githubblock"
|
||||
}, { // block quote
|
||||
codeBlockStartRule,
|
||||
{ // block quote
|
||||
token : "string.blockquote",
|
||||
regex : "^\\s*>\\s*(?:[*+-]|\\d+\\.)?\\s+",
|
||||
next : "blockquote"
|
||||
|
@ -165,11 +190,9 @@ var MarkdownHighlightRules = function() {
|
|||
next : "listblock-start"
|
||||
}, {
|
||||
include : "basic", noEscape: true
|
||||
}, { // Github style block
|
||||
token : "support.function",
|
||||
regex : "^\\s*```\\s*[a-zA-Z]*(?:{.*?\\})?\\s*$",
|
||||
next : "githubblock"
|
||||
}, {
|
||||
},
|
||||
codeBlockStartRule,
|
||||
{
|
||||
defaultToken : "list" //do not use markup.list to allow stling leading `*` differntly
|
||||
} ],
|
||||
|
||||
|
@ -187,39 +210,9 @@ var MarkdownHighlightRules = function() {
|
|||
defaultToken : "string.blockquote"
|
||||
} ],
|
||||
|
||||
"githubblock" : [ {
|
||||
token : "support.function",
|
||||
regex : "^\\s*```",
|
||||
next : "start"
|
||||
}, {
|
||||
defaultToken : "support.function"
|
||||
} ]
|
||||
"githubblock" : codeBlockRules
|
||||
});
|
||||
|
||||
this.embedRules(JavaScriptHighlightRules, "jscode-", [{
|
||||
token : "support.function",
|
||||
regex : "^\\s*```",
|
||||
next : "pop"
|
||||
}]);
|
||||
|
||||
this.embedRules(HtmlHighlightRules, "htmlcode-", [{
|
||||
token : "support.function",
|
||||
regex : "^\\s*```",
|
||||
next : "pop"
|
||||
}]);
|
||||
|
||||
this.embedRules(CssHighlightRules, "csscode-", [{
|
||||
token : "support.function",
|
||||
regex : "^\\s*```",
|
||||
next : "pop"
|
||||
}]);
|
||||
|
||||
this.embedRules(XmlHighlightRules, "xmlcode-", [{
|
||||
token : "support.function",
|
||||
regex : "^\\s*```",
|
||||
next : "pop"
|
||||
}]);
|
||||
|
||||
this.normalizeRules();
|
||||
};
|
||||
oop.inherits(MarkdownHighlightRules, TextHighlightRules);
|
||||
|
|
|
@ -0,0 +1,60 @@
|
|||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Distributed under the BSD license:
|
||||
*
|
||||
* Copyright (c) 2012, 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 PHPLaravelBladeHighlightRules = require("./php_laravel_blade_highlight_rules").PHPLaravelBladeHighlightRules;
|
||||
var PHPMode = require("./php").Mode;
|
||||
var JavaScriptMode = require("./javascript").Mode;
|
||||
var CssMode = require("./css").Mode;
|
||||
var HtmlMode = require("./html").Mode;
|
||||
|
||||
var Mode = function() {
|
||||
PHPMode.call(this);
|
||||
|
||||
this.HighlightRules = PHPLaravelBladeHighlightRules;
|
||||
this.createModeDelegates({
|
||||
"js-": JavaScriptMode,
|
||||
"css-": CssMode,
|
||||
"html-": HtmlMode
|
||||
});
|
||||
};
|
||||
oop.inherits(Mode, PHPMode);
|
||||
|
||||
(function() {
|
||||
|
||||
this.$id = "ace/mode/php_laravel_blade";
|
||||
}).call(Mode.prototype);
|
||||
|
||||
exports.Mode = Mode;
|
||||
});
|
200
plugins/node_modules/ace/lib/ace/mode/php_laravel_blade_highlight_rules.js
wygenerowano
vendored
100644
200
plugins/node_modules/ace/lib/ace/mode/php_laravel_blade_highlight_rules.js
wygenerowano
vendored
100644
|
@ -0,0 +1,200 @@
|
|||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Distributed under the BSD license:
|
||||
*
|
||||
* Copyright (c) 2012, 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 PhpHighlightRules = require("./php_highlight_rules").PhpHighlightRules;
|
||||
|
||||
var PHPLaravelBladeHighlightRules = function() {
|
||||
PhpHighlightRules.call(this);
|
||||
|
||||
var bladeRules = {
|
||||
start: [{
|
||||
include: "comments"
|
||||
}, {
|
||||
include: "directives"
|
||||
}, {
|
||||
include: "parenthesis"
|
||||
}],
|
||||
comments: [{
|
||||
token: "punctuation.definition.comment.blade",
|
||||
regex: "(\\/\\/(.)*)|(\\#(.)*)",
|
||||
next: "pop"
|
||||
}, {
|
||||
token: "punctuation.definition.comment.begin.php",
|
||||
regex: "(?:\\/\\*)",
|
||||
push: [{
|
||||
token: "punctuation.definition.comment.end.php",
|
||||
regex: "(?:\\*\\/)",
|
||||
next: "pop"
|
||||
}, {
|
||||
defaultToken: "comment.block.blade"
|
||||
}]
|
||||
}, {
|
||||
token: "punctuation.definition.comment.begin.blade",
|
||||
regex: "(?:\\{\\{\\-\\-)",
|
||||
push: [{
|
||||
token: "punctuation.definition.comment.end.blade",
|
||||
regex: "(?:\\-\\-\\}\\})",
|
||||
next: "pop"
|
||||
}, {
|
||||
defaultToken: "comment.block.blade"
|
||||
}]
|
||||
}],
|
||||
parenthesis: [{
|
||||
token: "parenthesis.begin.blade",
|
||||
regex: "\\(",
|
||||
push: [{
|
||||
token: "parenthesis.end.blade",
|
||||
regex: "\\)",
|
||||
next: "pop"
|
||||
}, {
|
||||
include: "strings"
|
||||
}, {
|
||||
include: "variables"
|
||||
}, {
|
||||
include: "lang"
|
||||
}, {
|
||||
include: "parenthesis"
|
||||
}, {
|
||||
defaultToken: "source.blade"
|
||||
}]
|
||||
}],
|
||||
directives: [{
|
||||
token: ["directive.declaration.blade", "keyword.directives.blade"],
|
||||
regex: "(@)(endunless|endisset|endempty|endauth|endguest|endcomponent|endslot|endalert|endverbatim|endsection|show|php|endphp|endpush|endprepend|endenv|endforelse|isset|empty|component|slot|alert|json|verbatim|section|auth|guest|hasSection|forelse|includeIf|includeWhen|includeFirst|each|push|stack|prepend|inject|env|elseenv|unless|yield|extends|parent|include|acfrepeater|block|can|cannot|choice|debug|elsecan|elsecannot|embed|hipchat|lang|layout|macro|macrodef|minify|partial|render|servers|set|slack|story|task|unset|wpposts|acfend|after|append|breakpoint|endafter|endcan|endcannot|endembed|endmacro|endmarkdown|endminify|endpartial|endsetup|endstory|endtask|endunless|markdown|overwrite|setup|stop|wpempty|wpend|wpquery)"
|
||||
|
||||
}, {
|
||||
token: ["directive.declaration.blade", "keyword.control.blade"],
|
||||
regex: "(@)(if|else|elseif|endif|foreach|endforeach|switch|case|break|default|endswitch|for|endfor|while|endwhile|continue)"
|
||||
}, {
|
||||
token: ["directive.ignore.blade", "injections.begin.blade"],
|
||||
regex: "(@?)(\\{\\{)",
|
||||
push: [{
|
||||
token: "injections.end.blade",
|
||||
regex: "\\}\\}",
|
||||
next: "pop"
|
||||
}, {
|
||||
include: "strings"
|
||||
}, {
|
||||
include: "variables"
|
||||
}, {
|
||||
defaultToken: "source.blade"
|
||||
}]
|
||||
}, {
|
||||
token: "injections.unescaped.begin.blade",
|
||||
regex: "\\{\\!\\!",
|
||||
push: [{
|
||||
token: "injections.unescaped.end.blade",
|
||||
regex: "\\!\\!\\}",
|
||||
next: "pop"
|
||||
}, {
|
||||
include: "strings"
|
||||
}, {
|
||||
include: "variables"
|
||||
}, {
|
||||
defaultToken: "source.blade"
|
||||
}]
|
||||
}
|
||||
|
||||
],
|
||||
|
||||
lang: [{
|
||||
token: "keyword.operator.blade",
|
||||
regex: "(?:!=|!|<=|>=|<|>|===|==|=|\\+\\+|\\;|\\,|%|&&|\\|\\|)|\\b(?:and|or|eq|neq|ne|gte|gt|ge|lte|lt|le|not|mod|as)\\b"
|
||||
}, {
|
||||
token: "constant.language.blade",
|
||||
regex: "\\b(?:TRUE|FALSE|true|false)\\b"
|
||||
}],
|
||||
strings: [{
|
||||
token: "punctuation.definition.string.begin.blade",
|
||||
regex: "\"",
|
||||
push: [{
|
||||
token: "punctuation.definition.string.end.blade",
|
||||
regex: "\"",
|
||||
next: "pop"
|
||||
}, {
|
||||
token: "string.character.escape.blade",
|
||||
regex: "\\\\."
|
||||
}, {
|
||||
defaultToken: "string.quoted.single.blade"
|
||||
}]
|
||||
}, {
|
||||
token: "punctuation.definition.string.begin.blade",
|
||||
regex: "'",
|
||||
push: [{
|
||||
token: "punctuation.definition.string.end.blade",
|
||||
regex: "'",
|
||||
next: "pop"
|
||||
}, {
|
||||
token: "string.character.escape.blade",
|
||||
regex: "\\\\."
|
||||
}, {
|
||||
defaultToken: "string.quoted.double.blade"
|
||||
}]
|
||||
}],
|
||||
variables: [{
|
||||
token: "variable.blade",
|
||||
regex: "\\$([a-zA-Z_][a-zA-Z0-9_]*)\\b"
|
||||
}, {
|
||||
token: ["keyword.operator.blade", "constant.other.property.blade"],
|
||||
regex: "(->)([a-zA-Z_][a-zA-Z0-9_]*)\\b"
|
||||
}, {
|
||||
token: ["keyword.operator.blade",
|
||||
"meta.function-call.object.blade",
|
||||
"punctuation.definition.variable.blade",
|
||||
"variable.blade",
|
||||
"punctuation.definition.variable.blade"
|
||||
],
|
||||
regex: "(->)([a-zA-Z_][a-zA-Z0-9_]*)(\\()(.*?)(\\))"
|
||||
}]
|
||||
};
|
||||
|
||||
var bladeStart = bladeRules.start;
|
||||
|
||||
for (var rule in this.$rules) {
|
||||
this.$rules[rule].unshift.apply(this.$rules[rule], bladeStart);
|
||||
}
|
||||
|
||||
Object.keys(bladeRules).forEach(function(x) {
|
||||
if (!this.$rules[x])
|
||||
this.$rules[x] = bladeRules[x];
|
||||
}, this);
|
||||
|
||||
this.normalizeRules();
|
||||
};
|
||||
|
||||
|
||||
oop.inherits(PHPLaravelBladeHighlightRules, PhpHighlightRules);
|
||||
|
||||
exports.PHPLaravelBladeHighlightRules = PHPLaravelBladeHighlightRules;
|
||||
});
|
|
@ -0,0 +1,61 @@
|
|||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Distributed under the BSD license:
|
||||
*
|
||||
* Copyright (c) 2012, 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 SlimHighlightRules = require("./slim_highlight_rules").SlimHighlightRules;
|
||||
|
||||
var Mode = function() {
|
||||
TextMode.call(this);
|
||||
this.HighlightRules = SlimHighlightRules;
|
||||
this.createModeDelegates({
|
||||
javascript: require("./javascript").Mode,
|
||||
markdown: require("./markdown").Mode,
|
||||
coffee: require("./coffee").Mode,
|
||||
scss: require("./scss").Mode,
|
||||
sass: require("./sass").Mode,
|
||||
less: require("./less").Mode,
|
||||
ruby: require("./ruby").Mode,
|
||||
css: require("./css").Mode
|
||||
});
|
||||
};
|
||||
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
(function() {
|
||||
|
||||
this.$id = "ace/mode/slim";
|
||||
}).call(Mode.prototype);
|
||||
|
||||
exports.Mode = Mode;
|
||||
});
|
|
@ -0,0 +1,235 @@
|
|||
/* ***** BEGIN LICENSE BLOCK *****
|
||||
* Distributed under the BSD license:
|
||||
*
|
||||
* Copyright (c) 2012, 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 modes = require("../config").$modes;
|
||||
|
||||
var oop = require("../lib/oop");
|
||||
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
||||
var SlimHighlightRules = function() {
|
||||
|
||||
this.$rules = {
|
||||
"start": [
|
||||
{
|
||||
token: "keyword",
|
||||
regex: /^(\s*)(\w+):\s*/,
|
||||
onMatch: function(value, state, stack, line) {
|
||||
var indent = /^\s*/.exec(line)[0];
|
||||
var m = value.match(/^(\s*)(\w+):/);
|
||||
var language = m[2];
|
||||
if (!/^(javascript|ruby|coffee|markdown|css|scss|sass|less)$/.test(language))
|
||||
language = "";
|
||||
stack.unshift("language-embed", [], [indent, language], state);
|
||||
return this.token;
|
||||
},
|
||||
stateName: "language-embed",
|
||||
next: [{
|
||||
token: "string",
|
||||
regex: /^(\s*)/,
|
||||
onMatch: function(value, state, stack, line) {
|
||||
var indent = stack[2][0];
|
||||
if (indent.length >= value.length) {
|
||||
stack.splice(0, 3);
|
||||
this.next = stack.shift();
|
||||
return this.token;
|
||||
}
|
||||
this.next = "";
|
||||
return [{type: "text", value: indent}];
|
||||
},
|
||||
next: ""
|
||||
}, {
|
||||
token: "string",
|
||||
regex: /.+/,
|
||||
onMatch: function(value, state, stack, line) {
|
||||
var indent = stack[2][0];
|
||||
var language = stack[2][1];
|
||||
var embedState = stack[1];
|
||||
|
||||
if (modes[language]) {
|
||||
var data = modes[language].getTokenizer().getLineTokens(line.slice(indent.length), embedState.slice(0));
|
||||
stack[1] = data.state;
|
||||
return data.tokens;
|
||||
}
|
||||
return this.token;
|
||||
}
|
||||
}]
|
||||
},
|
||||
{
|
||||
token: 'constant.begin.javascript.filter.slim',
|
||||
regex: '^(\\s*)():$'
|
||||
}, {
|
||||
token: 'constant.begin..filter.slim',
|
||||
regex: '^(\\s*)(ruby):$'
|
||||
}, {
|
||||
token: 'constant.begin.coffeescript.filter.slim',
|
||||
regex: '^(\\s*)():$'
|
||||
}, {
|
||||
token: 'constant.begin..filter.slim',
|
||||
regex: '^(\\s*)(markdown):$'
|
||||
}, {
|
||||
token: 'constant.begin.css.filter.slim',
|
||||
regex: '^(\\s*)():$'
|
||||
}, {
|
||||
token: 'constant.begin.scss.filter.slim',
|
||||
regex: '^(\\s*)():$'
|
||||
}, {
|
||||
token: 'constant.begin..filter.slim',
|
||||
regex: '^(\\s*)(sass):$'
|
||||
}, {
|
||||
token: 'constant.begin..filter.slim',
|
||||
regex: '^(\\s*)(less):$'
|
||||
}, {
|
||||
token: 'constant.begin..filter.slim',
|
||||
regex: '^(\\s*)(erb):$'
|
||||
}, {
|
||||
token: 'keyword.html.tags.slim',
|
||||
regex: '^(\\s*)((:?\\*(\\w)+)|doctype html|abbr|acronym|address|applet|area|article|aside|audio|base|basefont|bdo|big|blockquote|body|br|button|canvas|caption|center|cite|code|col|colgroup|command|datalist|dd|del|details|dialog|dfn|dir|div|dl|dt|embed|fieldset|figure|font|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hgroup|hr|html|i|iframe|img|input|ins|keygen|kbd|label|legend|link|li|map|mark|menu|meta|meter|nav|noframes|noscript|object|ol|optgroup|option|output|p|param|pre|progress|q|rp|rt|ruby|samp|script|section|select|small|source|span|strike|strong|style|sub|sup|table|tbody|td|textarea|tfoot|th|thead|time|title|tr|tt|ul|var|video|xmp|b|u|s|em|a)(?:([.#](\\w|\\.)+)+\\s?)?\\b'
|
||||
|
||||
}, {
|
||||
token: 'keyword.slim',
|
||||
regex: '^(\\s*)(?:([.#](\\w|\\.)+)+\\s?)'
|
||||
}, {
|
||||
token: "string",
|
||||
regex: /^(\s*)('|\||\/|(\/!))\s*/,
|
||||
onMatch: function(val, state, stack, line) {
|
||||
var indent = /^\s*/.exec(line)[0];
|
||||
if (stack.length < 1) {
|
||||
stack.push(this.next);
|
||||
}
|
||||
else {
|
||||
stack[0] = "mlString";
|
||||
}
|
||||
|
||||
if (stack.length < 2) {
|
||||
stack.push(indent.length);
|
||||
}
|
||||
else {
|
||||
stack[1] = indent.length;
|
||||
}
|
||||
return this.token;
|
||||
},
|
||||
next: "mlString"
|
||||
}, {
|
||||
token: 'keyword.control.slim',
|
||||
regex: '^(\\s*)(\\-|==|=)',
|
||||
push: [{
|
||||
token: 'control.end.slim',
|
||||
regex: '$',
|
||||
next: "pop"
|
||||
}, {
|
||||
include: "rubyline"
|
||||
}, {
|
||||
include: "misc"
|
||||
}]
|
||||
|
||||
}, {
|
||||
token: 'paren',
|
||||
regex: '\\(',
|
||||
push: [{
|
||||
token: 'paren',
|
||||
regex: '\\)',
|
||||
next: "pop"
|
||||
}, {
|
||||
include: "misc"
|
||||
}]
|
||||
|
||||
}, {
|
||||
token: 'paren',
|
||||
regex: '\\[',
|
||||
push: [{
|
||||
token: 'paren',
|
||||
regex: '\\]',
|
||||
next: "pop"
|
||||
}, {
|
||||
include: "misc"
|
||||
}]
|
||||
}, {
|
||||
include: "misc"
|
||||
}
|
||||
],
|
||||
"mlString": [{
|
||||
token: "indent",
|
||||
regex: /^\s*/,
|
||||
onMatch: function(val, state, stack) {
|
||||
var curIndent = stack[1];
|
||||
|
||||
if (curIndent >= val.length) {
|
||||
this.next = "start";
|
||||
stack.splice(0);
|
||||
}
|
||||
else {
|
||||
this.next = "mlString";
|
||||
}
|
||||
return this.token;
|
||||
},
|
||||
next: "start"
|
||||
}, {
|
||||
defaultToken: "string"
|
||||
}],
|
||||
"rubyline": [{
|
||||
token: "keyword.operator.ruby.embedded.slim",
|
||||
regex: "(==|=)(<>|><|<'|'<|<|>)?|-"
|
||||
}, {
|
||||
token: "list.ruby.operators.slim",
|
||||
regex: "(\\b)(for|in|do|if|else|elsif|unless|while|yield|not|and|or)\\b"
|
||||
}, {
|
||||
token: "string",
|
||||
regex: "['](.)*?[']"
|
||||
}, {
|
||||
token: "string",
|
||||
regex: "[\"](.)*?[\"]"
|
||||
}],
|
||||
"misc": [{
|
||||
token: 'class.variable.slim',
|
||||
regex: '\\@([a-zA-Z_][a-zA-Z0-9_]*)\\b'
|
||||
}, {
|
||||
token: "list.meta.slim",
|
||||
regex: "(\\b)(true|false|nil)(\\b)"
|
||||
}, {
|
||||
token: 'keyword.operator.equals.slim',
|
||||
regex: '='
|
||||
}, {
|
||||
token: "string",
|
||||
regex: "['](.)*?[']"
|
||||
}, {
|
||||
token: "string",
|
||||
regex: "[\"](.)*?[\"]"
|
||||
}]
|
||||
};
|
||||
this.normalizeRules();
|
||||
};
|
||||
|
||||
|
||||
oop.inherits(SlimHighlightRules, TextHighlightRules);
|
||||
|
||||
exports.SlimHighlightRules = SlimHighlightRules;
|
||||
});
|
|
@ -30,6 +30,7 @@
|
|||
|
||||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
var config = require("../config");
|
||||
|
||||
var Tokenizer = require("../tokenizer").Tokenizer;
|
||||
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
||||
|
@ -268,8 +269,15 @@ var Mode = function() {
|
|||
this.$modes = {};
|
||||
for (var i in mapping) {
|
||||
if (mapping[i]) {
|
||||
var Mode = mapping[i];
|
||||
var id = Mode.prototype.$id;
|
||||
var mode = config.$modes[id];
|
||||
if (!mode)
|
||||
config.$modes[id] = mode = new Mode();
|
||||
if (!config.$modes[i])
|
||||
config.$modes[i] = mode;
|
||||
this.$embeds.push(i);
|
||||
this.$modes[i] = new mapping[i]();
|
||||
this.$modes[i] = mode;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -289,8 +297,16 @@ var Mode = function() {
|
|||
|
||||
this.$delegator = function(method, args, defaultHandler) {
|
||||
var state = args[0];
|
||||
if (typeof state != "string")
|
||||
if (typeof state != "string") {
|
||||
if (Array.isArray(state[2])) {
|
||||
var language = state[2][state[2].length - 1];
|
||||
var mode = this.$modes[language];
|
||||
if (mode)
|
||||
return mode[method].apply(mode, [state[1]].concat([].slice.call(args, 1)));
|
||||
}
|
||||
state = state[0];
|
||||
}
|
||||
|
||||
for (var i = 0; i < this.$embeds.length; i++) {
|
||||
if (!this.$modes[this.$embeds[i]]) continue;
|
||||
|
||||
|
|
|
@ -1,14 +1,5 @@
|
|||
snippet <?
|
||||
<?php
|
||||
|
||||
${1}
|
||||
snippet ec
|
||||
echo ${1};
|
||||
snippet <?e
|
||||
<?php echo ${1} ?>
|
||||
# this one is for php5.4
|
||||
snippet <?=
|
||||
<?=${1}?>
|
||||
snippet ns
|
||||
namespace ${1:Foo\Bar\Baz};
|
||||
${2}
|
||||
|
@ -39,7 +30,7 @@ snippet m
|
|||
${7}
|
||||
}
|
||||
# setter method
|
||||
snippet sm
|
||||
snippet sm
|
||||
/**
|
||||
* Sets the value of ${1:foo}
|
||||
*
|
||||
|
@ -92,7 +83,7 @@ snippet S
|
|||
$_SERVER['${1:variable}']${2}
|
||||
snippet SS
|
||||
$_SESSION['${1:variable}']${2}
|
||||
|
||||
|
||||
# the following are old ones
|
||||
snippet inc
|
||||
include '${1:file}';${2}
|
||||
|
@ -193,7 +184,7 @@ snippet doc_h
|
|||
* @copyright ${4:$2}, `strftime('%d %B, %Y')`
|
||||
* @package ${5:default}
|
||||
*/
|
||||
|
||||
|
||||
# Interface
|
||||
snippet interface
|
||||
/**
|
||||
|
@ -241,10 +232,6 @@ snippet if
|
|||
if (${1:/* condition */}) {
|
||||
${2:// code...}
|
||||
}
|
||||
snippet ifil
|
||||
<?php if (${1:/* condition */}): ?>
|
||||
${2:<!-- code... -->}
|
||||
<?php endif; ?>
|
||||
snippet ife
|
||||
if (${1:/* condition */}) {
|
||||
${2:// code...}
|
||||
|
@ -252,13 +239,6 @@ snippet ife
|
|||
${3:// code...}
|
||||
}
|
||||
${4}
|
||||
snippet ifeil
|
||||
<?php if (${1:/* condition */}): ?>
|
||||
${2:<!-- html... -->}
|
||||
<?php else: ?>
|
||||
${3:<!-- html... -->}
|
||||
<?php endif; ?>
|
||||
${4}
|
||||
snippet else
|
||||
else {
|
||||
${1:// code...}
|
||||
|
@ -289,18 +269,10 @@ snippet foreach
|
|||
foreach ($${1:variable} as $${2:value}) {
|
||||
${3:// code...}
|
||||
}
|
||||
snippet foreachil
|
||||
<?php foreach ($${1:variable} as $${2:value}): ?>
|
||||
${3:<!-- html... -->}
|
||||
<?php endforeach; ?>
|
||||
snippet foreachk
|
||||
foreach ($${1:variable} as $${2:key} => $${3:value}) {
|
||||
${4:// code...}
|
||||
}
|
||||
snippet foreachkil
|
||||
<?php foreach ($${1:variable} as $${2:key} => $${3:value}): ?>
|
||||
${4:<!-- html... -->}
|
||||
<?php endforeach; ?>
|
||||
# $... = array (...)
|
||||
snippet array
|
||||
$${1:arrayName} = array('${2}' => ${3});${4}
|
||||
|
@ -325,8 +297,8 @@ snippet vd
|
|||
snippet vdd
|
||||
var_dump(${1}); die(${2:});
|
||||
snippet http_redirect
|
||||
header ("HTTP/1.1 301 Moved Permanently");
|
||||
header ("Location: ".URL);
|
||||
header ("HTTP/1.1 301 Moved Permanently");
|
||||
header ("Location: ".URL);
|
||||
exit();
|
||||
# Getters & Setters
|
||||
snippet gs
|
||||
|
@ -356,7 +328,7 @@ snippet gs
|
|||
snippet ags
|
||||
/**
|
||||
* ${1:description}
|
||||
*
|
||||
*
|
||||
* @${7}
|
||||
*/
|
||||
${2:protected} $${3:foo};
|
||||
|
@ -375,3 +347,37 @@ snippet rett
|
|||
return true;
|
||||
snippet retf
|
||||
return false;
|
||||
scope html
|
||||
snippet <?
|
||||
<?php
|
||||
|
||||
${1}
|
||||
snippet <?e
|
||||
<?php echo ${1} ?>
|
||||
# this one is for php5.4
|
||||
snippet <?=
|
||||
<?=${1}?>
|
||||
snippet ifil
|
||||
<?php if (${1:/* condition */}): ?>
|
||||
${2:<!-- code... -->}
|
||||
<?php endif; ?>
|
||||
snippet ifeil
|
||||
<?php if (${1:/* condition */}): ?>
|
||||
${2:<!-- html... -->}
|
||||
<?php else: ?>
|
||||
${3:<!-- html... -->}
|
||||
<?php endif; ?>
|
||||
${4}
|
||||
snippet foreachil
|
||||
<?php foreach ($${1:variable} as $${2:value}): ?>
|
||||
${3:<!-- html... -->}
|
||||
<?php endforeach; ?>
|
||||
snippet foreachkil
|
||||
<?php foreach ($${1:variable} as $${2:key} => $${3:value}): ?>
|
||||
${4:<!-- html... -->}
|
||||
<?php endforeach; ?>
|
||||
scope html-tag
|
||||
snippet ifil\n\
|
||||
<?php if (${1:true}): ?>${2:code}<?php endif; ?>
|
||||
snippet ifeil\n\
|
||||
<?php if (${1:true}): ?>${2:code}<?php else: ?>${3:code}<?php endif; ?>${4}
|
||||
|
|
|
@ -176,7 +176,7 @@ var Tokenizer = function(rules) {
|
|||
|
||||
this.removeCapturingGroups = function(src) {
|
||||
var r = src.replace(
|
||||
/\[(?:\\.|[^\]])*?\]|\\.|\(\?[:=!]|(\()/g,
|
||||
/\\.|\[(?:\\.|[^\\\]])*|\(\?[:=!]|(\()/g,
|
||||
function(x, y) {return y ? "(?:" : x;}
|
||||
);
|
||||
return r;
|
||||
|
|
|
@ -418,6 +418,7 @@ var VirtualRenderer = function(container, theme) {
|
|||
dom.setStyle(this.scrollBarH.element.style, "left", gutterWidth + "px");
|
||||
dom.setStyle(this.scroller.style, "left", gutterWidth + this.margin.left + "px");
|
||||
size.scrollerWidth = Math.max(0, width - gutterWidth - this.scrollBarV.getWidth() - this.margin.h);
|
||||
dom.setStyle(this.$gutter.style, "left", this.margin.left + "px");
|
||||
|
||||
var right = this.scrollBarV.getWidth() + "px";
|
||||
dom.setStyle(this.scrollBarH.element.style, "right", right);
|
||||
|
@ -848,7 +849,7 @@ var VirtualRenderer = function(container, theme) {
|
|||
if (changes & this.CHANGE_H_SCROLL)
|
||||
this.$updateScrollBarH();
|
||||
|
||||
dom.translate(this.$gutter, this.margin.left, -config.offset);
|
||||
// dom.translate(this.$gutter, this.margin.left, -config.offset);
|
||||
dom.translate(this.content, -this.scrollLeft, -config.offset);
|
||||
|
||||
var width = config.width + 2 * this.$padding + "px";
|
||||
|
|
|
@ -2,22 +2,42 @@
|
|||
|
||||
var http = require("http")
|
||||
, path = require("path")
|
||||
, mime = require("mime")
|
||||
, url = require("url")
|
||||
, fs = require("fs")
|
||||
, port = process.env.PORT || 8888
|
||||
, ip = process.env.IP || "0.0.0.0";
|
||||
|
||||
function lookupMime(filename) {
|
||||
var ext = /[^\/\\.]*$/.exec(filename)[0];
|
||||
return {
|
||||
js: "application/javascript",
|
||||
ico: "image/x-icon",
|
||||
css: "text/css",
|
||||
svg: "image/svg+xml",
|
||||
png: "image/png",
|
||||
jpg: "image/jpg",
|
||||
html: "text/html",
|
||||
jpeg: "image/jpeg"
|
||||
}[ext];
|
||||
}
|
||||
|
||||
// compatibility with node 0.6
|
||||
if (!fs.exists)
|
||||
fs.exists = path.exists;
|
||||
|
||||
var allowSave = process.argv.indexOf("--allow-save") != -1;
|
||||
if (allowSave)
|
||||
console.warn("writing files from browser is enabled");
|
||||
|
||||
http.createServer(function(req, res) {
|
||||
var uri = unescape(url.parse(req.url).pathname)
|
||||
, filename = path.join(process.cwd(), uri);
|
||||
var uri = unescape(url.parse(req.url).pathname);
|
||||
var filename = path.join(process.cwd(), uri);
|
||||
|
||||
if (req.method == "OPTIONS") {
|
||||
writeHead(res, 200);
|
||||
return res.end();
|
||||
}
|
||||
|
||||
if (req.method == "PUT") {
|
||||
if (!allowSave)
|
||||
return error(res, 404, "Saving not allowed pass --allow-save to enable");
|
||||
|
@ -28,46 +48,71 @@ http.createServer(function(req, res) {
|
|||
if (!exists)
|
||||
return error(res, 404, "404 Not Found\n" + filename);
|
||||
|
||||
if (fs.statSync(filename).isDirectory()) {
|
||||
var files = fs.readdirSync(filename);
|
||||
res.writeHead(200, {"Content-Type": "text/html"});
|
||||
|
||||
files.push(".", "..");
|
||||
var html = files.map(function(name) {
|
||||
var href = uri + "/" + name;
|
||||
href = href.replace(/[\/\\]+/g, "/").replace(/\/$/g, "");
|
||||
try {
|
||||
var stat = fs.statSync(filename + "/" + name);
|
||||
if (stat.isDirectory())
|
||||
href += "/";
|
||||
return "<a href='" + href + "'>" + name + "</a><br>";
|
||||
} catch(e) {}
|
||||
}).filter(Boolean);
|
||||
|
||||
res._hasBody && res.write(html.join(""));
|
||||
res.end();
|
||||
return;
|
||||
}
|
||||
if (fs.statSync(filename).isDirectory())
|
||||
return serveDirectory(filename, uri, req, res);
|
||||
|
||||
fs.readFile(filename, "binary", function(err, file) {
|
||||
if (err) {
|
||||
res.writeHead(500, { "Content-Type": "text/plain" });
|
||||
writeHead(res, 500, "text/plain");
|
||||
res.write(err + "\n");
|
||||
res.end();
|
||||
return;
|
||||
}
|
||||
|
||||
var contentType = mime.lookup(filename) || "text/plain";
|
||||
res.writeHead(200, { "Content-Type": contentType });
|
||||
var contentType = lookupMime(filename);
|
||||
writeHead(res, 200, contentType);
|
||||
res.write(file, "binary");
|
||||
res.end();
|
||||
});
|
||||
});
|
||||
}).listen(port, ip);
|
||||
|
||||
function writeHead(res, code, contentType) {
|
||||
var headers = {
|
||||
"Access-Control-Allow-Origin": "file://",
|
||||
"Access-Control-Allow-Methods": "PUT, GET, OPTIONS, HEAD"
|
||||
};
|
||||
headers["Content-Type"] = contentType || "text/plain";
|
||||
res.writeHead(code, headers);
|
||||
}
|
||||
|
||||
function serveDirectory(filename, uri, req, res) {
|
||||
var files = fs.readdirSync(filename);
|
||||
writeHead(res, 200, "text/html");
|
||||
|
||||
files.push("..", ".");
|
||||
var html = files.map(function(name) {
|
||||
try {
|
||||
var stat = fs.statSync(filename + "/" + name);
|
||||
} catch(e) {}
|
||||
var index = name == "." ? 2 : name == ".." ? 3 : stat.isDirectory() ? 1 : 0;
|
||||
return { name: name, index: index, size: stat.size };
|
||||
}).filter(Boolean).sort(function(a, b) {
|
||||
if (a.index == b.index)
|
||||
return a.name.localeCompare(b.name);
|
||||
return b.index - a.index;
|
||||
}).map(function(stat) {
|
||||
var name = stat.name;
|
||||
if (stat.index) name += "/";
|
||||
var size = ""
|
||||
if (!stat.size) size = ""
|
||||
else if (stat.size < 1024) size = stat.size + "b";
|
||||
else if (stat.size < 1024 * 1024) size = (stat.size / 1024).toFixed(2) + "kb";
|
||||
else size = (stat.size / 1024 / 1024).toFixed(2) + "mb";
|
||||
return "<tr>"
|
||||
+ "<td> " + size + " </td>"
|
||||
+ "<td><a href='" + name + "'>" + name + "</a></td>"
|
||||
+ "</tr>";
|
||||
}).join("");
|
||||
html = "<table>" + html + "</table>"
|
||||
|
||||
res._hasBody && res.write(html);
|
||||
res.end();
|
||||
}
|
||||
|
||||
function error(res, status, message, error) {
|
||||
console.error(error || message);
|
||||
res.writeHead(status, { "Content-Type": "text/plain" });
|
||||
writeHead(res, status, "text/plain");
|
||||
res.write(message);
|
||||
res.end();
|
||||
}
|
||||
|
@ -87,7 +132,7 @@ function save(req, res, filePath) {
|
|||
catch (e) {
|
||||
return error(res, 404, "Could't save file", e);
|
||||
}
|
||||
res.statusCode = 200;
|
||||
writeHead(res, 200);
|
||||
res.end("OK");
|
||||
console.log("saved ", filePath);
|
||||
});
|
||||
|
|
|
@ -491,7 +491,7 @@ function transformRegExp(str, rule) {
|
|||
|
||||
str = str.replace(/(\\[xu]){([a-fA-F\d]+)}/g, '$1$2');
|
||||
|
||||
str = convertCharacterTypes(str, rule);
|
||||
str = convertCharacterTypes(str);
|
||||
|
||||
checkForNamedCaptures(str);
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue