Merge remote-tracking branch 'remotes/origin/master' into v-1.2

Conflicts:
	build
	lib/ace/document.js
This commit is contained in:
nightwing 2014-03-31 00:49:41 +04:00
commit ec97ad7904
97 changed files with 4349 additions and 3474 deletions

View file

@ -1,3 +1,15 @@
2014.03.08 Version 1.1.3
* New Features
- Allow syntax checkers to be loaded from CDN (Derk-Jan Hartman)
- Add ColdFusion behavior (Abram Adams)
- add showLineNumbers option
- Add html syntax checker (danyaPostfactum)
* new language modes
- Gherkin (Patrick Nevels)
- Smarty
2013.12.02 Version 1.1.2 2013.12.02 Version 1.1.2
* New Features * New Features
@ -11,7 +23,6 @@
- add support for autocompletion and snippets (gjtorikyan danyaPostfactum and others) - add support for autocompletion and snippets (gjtorikyan danyaPostfactum and others)
- add option to merge similar changes in undo history - add option to merge similar changes in undo history
- add scrollPastEnd option - add scrollPastEnd option
- 6a87d97 Merge pull request #1494 from danyaPostfactum/snippetcompleter
- use html5 dragndrop for text dragging (danyaPostfactum) - use html5 dragndrop for text dragging (danyaPostfactum)
* API Changes * API Changes

View file

@ -293,27 +293,30 @@ function getWriteFilters(options, projectType, main) {
if (options.noconflict) if (options.noconflict)
filters.push(namespace(options.ns)); filters.push(namespace(options.ns));
if (options.exportModule && projectType == "main" || projectType == "ext") {
filters.push(exportAce(options.ns, options.exportModule,
options.noconflict ? options.ns : "", projectType == "ext" && main));
}
if (options.compress) if (options.compress)
filters.push(copy.filter.uglifyjs); filters.push(copy.filter.uglifyjs);
// copy.filter.uglifyjs.options.ascii = true; doesn't work with some uglify.js versions // copy.filter.uglifyjs.options.ascii_only = true; doesn't work with some uglify.js versions
filters.push(function(text) { filters.push(function(text) {
var t1 = text.replace(/[\x80-\uffff]/g, function(c) { var text = text.replace(/[\x00-\x08\x0b\x0c\x0e\x19\x80-\uffff]/g, function(c) {
c = c.charCodeAt(0).toString(16); c = c.charCodeAt(0).toString(16);
if (c.length == 1)
return "\\x0" + c;
if (c.length == 2) if (c.length == 2)
return "\\x" + c; return "\\x" + c;
if (c.length == 3) if (c.length == 3)
c = "0" + c; return "\\u0" + c;
return "\\u" + c; return "\\u" + c;
}); });
return text; return text;
}); });
if (options.exportModule && projectType == "main" || projectType == "ext") {
filters.push(exportAce(options.ns, options.exportModule,
options.noconflict ? options.ns : "", projectType == "ext" && main));
}
return filters; return filters;
} }
@ -550,15 +553,6 @@ var detectTextModules = function(input, source) {
detectTextModules.onRead = true; detectTextModules.onRead = true;
copy.filter.addDefines = detectTextModules; copy.filter.addDefines = detectTextModules;
function generateThemesModule(themes) {
var themelist = [
'define(function(require, exports, module) {',
'\n\nmodule.exports.themes = ' + JSON.stringify(themes, null, ' '),
';\n\n});'
].join('');
fs.writeFileSync(__dirname + '/lib/ace/ext/themelist_utils/themes.js', themelist, 'utf8');
}
function inlineTextModules(text) { function inlineTextModules(text) {
var deps = []; var deps = [];
return text.replace(/, *['"]ace\/requirejs\/text!(.*?)['"]| require\(['"](?:ace|[.\/]+)\/requirejs\/text!(.*?)['"]\)/g, function(_, dep, call) { return text.replace(/, *['"]ace\/requirejs\/text!(.*?)['"]| require\(['"](?:ace|[.\/]+)\/requirejs\/text!(.*?)['"]\)/g, function(_, dep, call) {
@ -574,14 +568,38 @@ function inlineTextModules(text) {
}); });
call = textModules[dep]; call = textModules[dep];
// if (deps.length > 1)
// console.log(call.length)
if (call) if (call)
return " " + call; return " " + call;
} }
}); });
} }
var CommonJsProject = copy.createCommonJsProject({roots:[]}).constructor;
CommonJsProject.prototype.getCurrentModules = function() {
function isDep(child, parent) {
if (!modules[parent])
return false;
var deps = modules[parent].deps;
if (deps[child]) return true;
return Object.keys(deps).some(function(x) {
return isDep(child, x)
});
}
var depMap = {}, modules = this.currentModules;
return Object.keys(this.currentModules).map(function(moduleName) {
module = modules[moduleName];
module.id = moduleName;
module.isSpecial = !/define\(\'[^']*',/.test(module.source);
return module;
}).sort(function(a, b) {
if (a.isSpecial) return -1;
if (b.isSpecial) return 1;
if (isDep(a.id, b.id)) return -1;
if (isDep(b.id, a.id)) return 1;
return Object.keys(a.deps).length - Object.keys(b.deps).length || a.id.localeCompare(b.id)
});
};
// TODO: replace with project.clone once it is fixed in dryice // TODO: replace with project.clone once it is fixed in dryice
function cloneProject(project) { function cloneProject(project) {
var clone = copy.createCommonJsProject({ var clone = copy.createCommonJsProject({
@ -602,16 +620,12 @@ function cloneProject(project) {
} }
function copyFileSync(srcFile, destFile) { function copyFileSync(srcFile, destFile) {
var BUF_LENGTH = 64*1024, var BUF_LENGTH = 64*1024;
buf = new Buffer(BUF_LENGTH), var buf = new Buffer(BUF_LENGTH);
bytesRead = BUF_LENGTH, var bytesRead = BUF_LENGTH;
pos = 0, var pos = 0;
fdr = null, var fdr = fs.openSync(srcFile, 'r');
fdw = null; var fdw = fs.openSync(destFile, 'w');
fdr = fs.openSync(srcFile, 'r');
fdw = fs.openSync(destFile, 'w');
while (bytesRead === BUF_LENGTH) { while (bytesRead === BUF_LENGTH) {
bytesRead = fs.readSync(fdr, buf, 0, BUF_LENGTH, pos); bytesRead = fs.readSync(fdr, buf, 0, BUF_LENGTH, pos);
@ -652,13 +666,12 @@ function exportAce(ns, module, requireBase, extModule) {
requireBase = requireBase || "window"; requireBase = requireBase || "window";
module = module || "ace/ace"; module = module || "ace/ace";
return function(text) { return function(text) {
var template = function() { var template = function() {
(function() { (function() {
REQUIRE_NS.require(["MODULE"], function(a) { REQUIRE_NS.require(["MODULE"], function(a) {
a && a.config.init(); a && a.config.init(true);
if (!window.NS) if (!window.NS)
window.NS = {}; window.NS = a;
for (var key in a) if (a.hasOwnProperty(key)) for (var key in a) if (a.hasOwnProperty(key))
NS[key] = a[key]; NS[key] = a[key];
}); });
@ -674,6 +687,8 @@ function exportAce(ns, module, requireBase, extModule) {
}; };
} }
text = text.replace(/function init\(packaged\) {/, "init(true);$&\n");
return (text + ";" + template return (text + ";" + template
.toString() .toString()
.replace(/MODULE/g, module) .replace(/MODULE/g, module)
@ -696,6 +711,15 @@ function updateModes() {
}) })
} }
function generateThemesModule(themes) {
var themelist = [
'define(function(require, exports, module) {',
'\n\nmodule.exports.themes = ' + JSON.stringify(themes, null, ' '),
';\n\n});'
].join('');
fs.writeFileSync(__dirname + '/lib/ace/ext/themelist_utils/themes.js', themelist, 'utf8');
}
if (!module.parent) if (!module.parent)
main(process.argv); main(process.argv);
else else

View file

@ -8,7 +8,7 @@ Ace is a standalone code editor written in JavaScript. Our goal is to create a b
Features Features
-------- --------
* Syntax highlighting for over 40 languages (TextMate/Sublime/_.tmlanguage_ files can be imported) * Syntax highlighting for over 110 languages (TextMate/Sublime/_.tmlanguage_ files can be imported)
* Over 20 themes (TextMate/Sublime/_.tmtheme_ files can be imported) * Over 20 themes (TextMate/Sublime/_.tmtheme_ files can be imported)
* Automatic indent and outdent * Automatic indent and outdent
* An optional command line * An optional command line

View file

@ -251,7 +251,7 @@ commands.addCommand({
} }
}); });
var keybindings = { var keybindings = {
ace: null, // Null = use "default" keymapping ace: null, // Null = use "default" keymapping
vim: require("ace/keyboard/vim").handler, vim: require("ace/keyboard/vim").handler,
emacs: "ace/keyboard/emacs", emacs: "ace/keyboard/emacs",
@ -317,7 +317,7 @@ doclist.history.index = 0;
doclist.cycleOpen = function(editor, dir) { doclist.cycleOpen = function(editor, dir) {
var h = this.history; var h = this.history;
h.index += dir; h.index += dir;
if (h.index >= h.length) if (h.index >= h.length)
h.index = 0; h.index = 0;
else if (h.index <= 0) else if (h.index <= 0)
h.index = h.length - 1; h.index = h.length - 1;
@ -499,7 +499,7 @@ bindDropdown("split", function(value) {
sp.setSplits(1); sp.setSplits(1);
} else { } else {
var newEditor = (sp.getSplits() == 1); var newEditor = (sp.getSplits() == 1);
sp.setOrientation(value == "below" ? sp.BELOW : sp.BESIDE); sp.setOrientation(value == "below" ? sp.BELOW : sp.BESIDE);
sp.setSplits(2); sp.setSplits(2);
if (newEditor) { if (newEditor) {
@ -592,7 +592,11 @@ env.editSnippets = function() {
require("ace/ext/language_tools"); require("ace/ext/language_tools");
env.editor.setOptions({ env.editor.setOptions({
enableBasicAutocompletion: true, enableBasicAutocompletion: true,
enableLiveAutocomplete: true,
enableSnippets: true enableSnippets: true
}); });
var beautify = require("ace/ext/beautify");
env.editor.commands.addCommands(beautify.commands);
}); });

View file

@ -33,4 +33,10 @@ brackets ((((()))))
print (add $ (int 1) (int 2)) print (add $ (int 1) (int 2))
print $ unwrap $ print $ unwrap $
map (a $ int 1) (b $ int 2) map (a $ int 1) (b $ int 2)
print a
int 1
, b c
int 2
, d

View file

@ -0,0 +1,28 @@
@these @are @tags
Feature: Serve coffee
Coffee should not be served until paid for
Coffee should not be served until the button has been pressed
If there is no coffee left then money should be refunded
Scenario Outline: Eating
Given there are <start> cucumbers
When I eat <eat> cucumbers
Then I should have <left> cucumbers
Examples:
| start | eat | left |
| 12 | 5 | 7 |
| 20 | 5 | 15 |
Scenario: Buy last coffee
Given there are 1 coffees left in the machine
And I have deposited 1$
When I press the coffee button
Then I should be served a "coffee"
# this a comment
"""
this is a
pystring
"""

View file

@ -8,7 +8,7 @@ integer someIntNormal = 3672;
integer someIntHex = 0x00000000; integer someIntHex = 0x00000000;
integer someIntMath = PI_BY_TWO; integer someIntMath = PI_BY_TWO;
integer event = 5673; // unimplemented reserved keyword! integer event = 5673; // invalid.illegal
key someKeyTexture = TEXTURE_DEFAULT; key someKeyTexture = TEXTURE_DEFAULT;
string someStringSpecial = EOF; string someStringSpecial = EOF;
@ -53,12 +53,12 @@ default
someIntHex = 0x00000000; someIntHex = 0x00000000;
someIntMath = PI_BY_TWO; someIntMath = PI_BY_TWO;
event = 5673; // unimplemented reserved keyword! event = 5673; // invalid.illegal
someKeyTexture = TEXTURE_DEFAULT; someKeyTexture = TEXTURE_DEFAULT;
someStringSpecial = EOF; someStringSpecial = EOF;
llCloud(ZERO_VECTOR); // invalid deprecated function! llSetInventoryPermMask("some item", MASK_NEXT, PERM_ALL); // reserved.godmode
llWhisper(PUBLIC_CHANNEL, "Leaving \"default\" now..."); llWhisper(PUBLIC_CHANNEL, "Leaving \"default\" now...");
state other; state other;

View file

@ -87,7 +87,7 @@ console.log(addResult);
</p> </p>
<h2>Features</h2> <h2>Features</h2>
<ul class="content-list"> <ul class="content-list">
<li><a href="http://pcwalton.blogspot.com/2010/11/syntax-highlighting-specification.html">Syntax highlighting</a> for over 60 languages (TextMate/Sublime Text<em>.tmlanguage</em> files can be imported)</li> <li><a href="http://pcwalton.blogspot.com/2010/11/syntax-highlighting-specification.html">Syntax highlighting</a> for over 110 languages (TextMate/Sublime Text<em>.tmlanguage</em> files can be imported)</li>
<li>Over 20 themes (TextMate/Sublime Text <em>.tmtheme</em> files can be imported)</li> <li>Over 20 themes (TextMate/Sublime Text <em>.tmtheme</em> files can be imported)</li>
<li>Automatic indent and outdent</li> <li>Automatic indent and outdent</li>
<li>An optional command line</li> <li>An optional command line</li>
@ -793,7 +793,7 @@ if (match) {
<a href="http://plnkr.co/edit/">Plunker</a> <a href="http://plnkr.co/edit/">Plunker</a>
</li> </li>
<li> <li>
<img src="http://zedapp.org/content/images/2013/Nov/Icon-1.png" style="left: -1px;top: -20px;width: 103px;"> <img src="http://zedapp.s3.amazonaws.com/uploads/2014/02/zed-small.png" style="left: -1px;top: -20px;width: 103px;">
<a href="http://zedapp.org">Zed</a> <a href="http://zedapp.org">Zed</a>
</li> </li>
<li> <li>

View file

@ -40,6 +40,7 @@ var snippetManager = require("./snippets").snippetManager;
var Autocomplete = function() { var Autocomplete = function() {
this.autoInsert = true; this.autoInsert = true;
this.autoSelect = true;
this.keyboardHandler = new HashHandler(); this.keyboardHandler = new HashHandler();
this.keyboardHandler.bindKeys(this.commands); this.keyboardHandler.bindKeys(this.commands);
@ -47,13 +48,15 @@ var Autocomplete = function() {
this.changeListener = this.changeListener.bind(this); this.changeListener = this.changeListener.bind(this);
this.mousedownListener = this.mousedownListener.bind(this); this.mousedownListener = this.mousedownListener.bind(this);
this.mousewheelListener = this.mousewheelListener.bind(this); this.mousewheelListener = this.mousewheelListener.bind(this);
this.changeTimer = lang.delayedCall(function() { this.changeTimer = lang.delayedCall(function() {
this.updateCompletions(true); this.updateCompletions(true);
}.bind(this)) }.bind(this))
}; };
(function() { (function() {
this.gatherCompletionsId = 0;
this.$init = function() { this.$init = function() {
this.popup = new AcePopup(document.body || document.documentElement); this.popup = new AcePopup(document.body || document.documentElement);
this.popup.on("click", function(e) { this.popup.on("click", function(e) {
@ -69,15 +72,16 @@ var Autocomplete = function() {
this.popup.setData(this.completions.filtered); this.popup.setData(this.completions.filtered);
var renderer = editor.renderer; var renderer = editor.renderer;
this.popup.setRow(this.autoSelect ? 0 : -1);
if (!keepPopupPosition) { if (!keepPopupPosition) {
this.popup.setRow(0); this.popup.setTheme(editor.getTheme());
this.popup.setFontSize(editor.getFontSize()); this.popup.setFontSize(editor.getFontSize());
var lineHeight = renderer.layerConfig.lineHeight; var lineHeight = renderer.layerConfig.lineHeight;
var pos = renderer.$cursorLayer.getPixelPosition(this.base, true); var pos = renderer.$cursorLayer.getPixelPosition(this.base, true);
pos.left -= this.popup.getTextLeftOffset(); pos.left -= this.popup.getTextLeftOffset();
var rect = editor.container.getBoundingClientRect(); var rect = editor.container.getBoundingClientRect();
pos.top += rect.top - renderer.layerConfig.offset; pos.top += rect.top - renderer.layerConfig.offset;
pos.left += rect.left - editor.renderer.scrollLeft; pos.left += rect.left - editor.renderer.scrollLeft;
@ -94,7 +98,11 @@ var Autocomplete = function() {
this.editor.off("mousedown", this.mousedownListener); this.editor.off("mousedown", this.mousedownListener);
this.editor.off("mousewheel", this.mousewheelListener); this.editor.off("mousewheel", this.mousewheelListener);
this.changeTimer.cancel(); this.changeTimer.cancel();
if (this.popup && this.popup.isOpen) {
this.gatherCompletionsId = this.gatherCompletionsId + 1;
}
if (this.popup) if (this.popup)
this.popup.hide(); this.popup.hide();
@ -145,6 +153,7 @@ var Autocomplete = function() {
data = this.popup.getData(this.popup.getRow()); data = this.popup.getData(this.popup.getRow());
if (!data) if (!data)
return false; return false;
if (data.completer && data.completer.insertMatch) { if (data.completer && data.completer.insertMatch) {
data.completer.insertMatch(this.editor); data.completer.insertMatch(this.editor);
} else { } else {
@ -171,7 +180,11 @@ var Autocomplete = function() {
"Esc": function(editor) { editor.completer.detach(); }, "Esc": function(editor) { editor.completer.detach(); },
"Space": function(editor) { editor.completer.detach(); editor.insert(" ");}, "Space": function(editor) { editor.completer.detach(); editor.insert(" ");},
"Return": function(editor) { editor.completer.insertMatch(); }, "Return": function(editor) {
if (editor.completer.popup.getRow() == -1)
return false;
editor.completer.insertMatch();
},
"Shift-Return": function(editor) { editor.completer.insertMatch(true); }, "Shift-Return": function(editor) { editor.completer.insertMatch(true); },
"Tab": function(editor) { editor.completer.insertMatch(); }, "Tab": function(editor) { editor.completer.insertMatch(); },
@ -182,33 +195,36 @@ var Autocomplete = function() {
this.gatherCompletions = function(editor, callback) { this.gatherCompletions = function(editor, callback) {
var session = editor.getSession(); var session = editor.getSession();
var pos = editor.getCursorPosition(); var pos = editor.getCursorPosition();
var line = session.getLine(pos.row); var line = session.getLine(pos.row);
var prefix = util.retrievePrecedingIdentifier(line, pos.column); var prefix = util.retrievePrecedingIdentifier(line, pos.column);
this.base = editor.getCursorPosition(); this.base = editor.getCursorPosition();
this.base.column -= prefix.length; this.base.column -= prefix.length;
var matches = []; var matches = [];
util.parForEach(editor.completers, function(completer, next) { var total = editor.completers.length;
editor.completers.forEach(function(completer, i) {
completer.getCompletions(editor, session, pos, prefix, function(err, results) { completer.getCompletions(editor, session, pos, prefix, function(err, results) {
if (!err) if (!err)
matches = matches.concat(results); matches = matches.concat(results);
next(); // Fetch prefix again, because they may have changed by now
}); var pos = editor.getCursorPosition();
}, function() { var line = session.getLine(pos.row);
callback(null, { callback(null, {
prefix: prefix, prefix: util.retrievePrecedingIdentifier(line, pos.column),
matches: matches matches: matches,
finished: (--total === 0)
}); });
}); });
});
return true; return true;
}; };
this.showPopup = function(editor) { this.showPopup = function(editor) {
if (this.editor) if (this.editor)
this.detach(); this.detach();
this.activated = true; this.activated = true;
this.editor = editor; this.editor = editor;
@ -223,10 +239,10 @@ var Autocomplete = function() {
editor.on("blur", this.blurListener); editor.on("blur", this.blurListener);
editor.on("mousedown", this.mousedownListener); editor.on("mousedown", this.mousedownListener);
editor.on("mousewheel", this.mousewheelListener); editor.on("mousewheel", this.mousewheelListener);
this.updateCompletions(); this.updateCompletions();
}; };
this.updateCompletions = function(keepPopupPosition) { this.updateCompletions = function(keepPopupPosition) {
if (keepPopupPosition && this.base && this.completions) { if (keepPopupPosition && this.base && this.completions) {
var pos = this.editor.getCursorPosition(); var pos = this.editor.getCursorPosition();
@ -236,25 +252,62 @@ var Autocomplete = function() {
this.completions.setFilter(prefix); this.completions.setFilter(prefix);
if (!this.completions.filtered.length) if (!this.completions.filtered.length)
return this.detach(); return this.detach();
if (this.completions.filtered.length == 1
&& this.completions.filtered[0].value == prefix
&& !this.completions.filtered[0].snippet)
return this.detach();
this.openPopup(this.editor, prefix, keepPopupPosition); this.openPopup(this.editor, prefix, keepPopupPosition);
return; return;
} }
// Save current gatherCompletions session, session is close when a match is insert
var _id = this.gatherCompletionsId;
this.gatherCompletions(this.editor, function(err, results) { this.gatherCompletions(this.editor, function(err, results) {
// Only detach if result gathering is finished
var doDetach = function() {
if (!results.finished) return;
return this.detach();
}.bind(this);
// Calcul prefix
var session = this.editor.getSession();
var pos = this.editor.getCursorPosition();
var line = session.getLine(pos.row);
var prefix = util.retrievePrecedingIdentifier(line, pos.column);
// Results matches
var matches = results && results.matches; var matches = results && results.matches;
if (!matches || !matches.length) if (!matches || !matches.length)
return this.detach(); return this.detach();
// TODO reenable this when we have proper change tracking // TODO reenable this when we have proper change tracking
// if (matches.length == 1) // if (matches.length == 1)
// return this.insertMatch(matches[0]); // return this.insertMatch(matches[0]);
// No prefix or no results -> close
if (!prefix || !prefix.length || !matches || !matches.length)
return doDetach();
// Wrong prefix or wrong session -> ignore
if (prefix.indexOf(results.prefix) != 0 || _id != this.gatherCompletionsId)
return;
this.completions = new FilteredList(matches); this.completions = new FilteredList(matches);
this.completions.setFilter(results.prefix); this.completions.setFilter(prefix);
var filtered = this.completions.filtered; var filtered = this.completions.filtered;
// No results
if (!filtered.length) if (!filtered.length)
return this.detach(); return doDetach();
// One result equals to the prefix
if (filtered.length == 1 && filtered[0].value == prefix && !filtered[0].snippet)
return doDetach();
// Autoinsert if one result
if (this.autoInsert && filtered.length == 1) if (this.autoInsert && filtered.length == 1)
return this.insertMatch(filtered[0]); return this.insertMatch(filtered[0]);
this.openPopup(this.editor, results.prefix, keepPopupPosition);
this.openPopup(this.editor, prefix, keepPopupPosition);
}.bind(this)); }.bind(this));
}; };
@ -299,16 +352,16 @@ var FilteredList = function(array, filterText, mutateData) {
matches = matches.sort(function(a, b) { matches = matches.sort(function(a, b) {
return b.exactMatch - a.exactMatch || b.score - a.score; return b.exactMatch - a.exactMatch || b.score - a.score;
}); });
// make unique // make unique
var prev = null; var prev = null;
matches = matches.filter(function(item){ matches = matches.filter(function(item){
var caption = item.value || item.caption || item.snippet; var caption = item.value || item.caption || item.snippet;
if (caption === prev) return false; if (caption === prev) return false;
prev = caption; prev = caption;
return true; return true;
}); });
this.filtered = matches; this.filtered = matches;
}; };
this.filterCompletions = function(items, needle) { this.filterCompletions = function(items, needle) {

View file

@ -43,7 +43,7 @@ var $singleLineEditor = function(el) {
var renderer = new Renderer(el); var renderer = new Renderer(el);
renderer.$maxLines = 4; renderer.$maxLines = 4;
var editor = new Editor(renderer); var editor = new Editor(renderer);
editor.setHighlightActiveLine(false); editor.setHighlightActiveLine(false);
@ -59,13 +59,13 @@ var $singleLineEditor = function(el) {
var AcePopup = function(parentNode) { var AcePopup = function(parentNode) {
var el = dom.createElement("div"); var el = dom.createElement("div");
var popup = new $singleLineEditor(el); var popup = new $singleLineEditor(el);
if (parentNode) if (parentNode)
parentNode.appendChild(el); parentNode.appendChild(el);
el.style.display = "none"; el.style.display = "none";
popup.renderer.content.style.cursor = "default"; popup.renderer.content.style.cursor = "default";
popup.renderer.setStyle("ace_autocomplete"); popup.renderer.setStyle("ace_autocomplete");
popup.setOption("displayIndentGuides", false); popup.setOption("displayIndentGuides", false);
var noop = function(){}; var noop = function(){};
@ -86,8 +86,7 @@ var AcePopup = function(parentNode) {
popup.on("mousedown", function(e) { popup.on("mousedown", function(e) {
var pos = e.getDocumentPosition(); var pos = e.getDocumentPosition();
popup.moveCursorToPosition(pos); popup.selection.moveToPosition(pos);
popup.selection.clearSelection();
selectionMarker.start.row = selectionMarker.end.row = pos.row; selectionMarker.start.row = selectionMarker.end.row = pos.row;
e.stop(); e.stop();
}); });
@ -155,11 +154,11 @@ var AcePopup = function(parentNode) {
popup.getHoveredRow = function() { popup.getHoveredRow = function() {
return hoverMarker.start.row; return hoverMarker.start.row;
}; };
event.addListener(popup.container, "mouseout", hideHoverMarker); event.addListener(popup.container, "mouseout", hideHoverMarker);
popup.on("hide", hideHoverMarker); popup.on("hide", hideHoverMarker);
popup.on("changeSelection", hideHoverMarker); popup.on("changeSelection", hideHoverMarker);
popup.session.doc.getLength = function() { popup.session.doc.getLength = function() {
return popup.data.length; return popup.data.length;
}; };
@ -203,7 +202,7 @@ var AcePopup = function(parentNode) {
}; };
bgTokenizer.$updateOnChange = noop; bgTokenizer.$updateOnChange = noop;
bgTokenizer.start = noop; bgTokenizer.start = noop;
popup.session.$computeWidth = function() { popup.session.$computeWidth = function() {
return this.screenWidth = 0; return this.screenWidth = 0;
} }
@ -211,7 +210,7 @@ var AcePopup = function(parentNode) {
// public // public
popup.isOpen = false; popup.isOpen = false;
popup.isTopdown = false; popup.isTopdown = false;
popup.data = []; popup.data = [];
popup.setData = function(list) { popup.setData = function(list) {
popup.data = list || []; popup.data = list || [];
@ -236,7 +235,7 @@ var AcePopup = function(parentNode) {
popup._signal("select"); popup._signal("select");
} }
}; };
popup.on("changeSelection", function() { popup.on("changeSelection", function() {
if (popup.isOpen) if (popup.isOpen)
popup.setRow(popup.selection.lead.row); popup.setRow(popup.selection.lead.row);
@ -268,22 +267,22 @@ var AcePopup = function(parentNode) {
el.style.display = ""; el.style.display = "";
this.renderer.$textLayer.checkForSizeChanges(); this.renderer.$textLayer.checkForSizeChanges();
var left = pos.left; var left = pos.left;
if (left + el.offsetWidth > screenWidth) if (left + el.offsetWidth > screenWidth)
left = screenWidth - el.offsetWidth; left = screenWidth - el.offsetWidth;
el.style.left = left + "px"; el.style.left = left + "px";
this._signal("show"); this._signal("show");
lastMouseEvent = null; lastMouseEvent = null;
popup.isOpen = true; popup.isOpen = true;
}; };
popup.getTextLeftOffset = function() { popup.getTextLeftOffset = function() {
return this.$borderSize + this.renderer.$padding + this.$imageSize; return this.$borderSize + this.renderer.$padding + this.$imageSize;
}; };
popup.$imageSize = 0; popup.$imageSize = 0;
popup.$borderSize = 1; popup.$borderSize = 1;
@ -291,19 +290,24 @@ var AcePopup = function(parentNode) {
}; };
dom.importCssString("\ dom.importCssString("\
.ace_autocomplete.ace-tm .ace_marker-layer .ace_active-line {\ .ace_editor.ace_autocomplete .ace_marker-layer .ace_active-line {\
background-color: #CAD6FA;\ background-color: #CAD6FA;\
z-index: 1;\ z-index: 1;\
}\ }\
.ace_autocomplete.ace-tm .ace_line-hover {\ .ace_editor.ace_autocomplete .ace_line-hover {\
border: 1px solid #abbffe;\ border: 1px solid #abbffe;\
margin-top: -1px;\ margin-top: -1px;\
background: rgba(233,233,253,0.4);\ background: rgba(233,233,253,0.4);\
}\ }\
.ace_autocomplete .ace_line-hover {\ .ace_editor.ace_autocomplete .ace_line-hover {\
position: absolute;\ position: absolute;\
z-index: 2;\ z-index: 2;\
}\ }\
.ace_editor.ace_autocomplete .ace_scroller {\
background: none;\
border: none;\
box-shadow: none;\
}\
.ace_rightAlignedText {\ .ace_rightAlignedText {\
color: gray;\ color: gray;\
display: inline-block;\ display: inline-block;\
@ -312,11 +316,11 @@ dom.importCssString("\
text-align: right;\ text-align: right;\
z-index: -1;\ z-index: -1;\
}\ }\
.ace_autocomplete .ace_completion-highlight{\ .ace_editor.ace_autocomplete .ace_completion-highlight{\
color: #000;\ color: #000;\
text-shadow: 0 0 0.01em;\ text-shadow: 0 0 0.01em;\
}\ }\
.ace_autocomplete {\ .ace_editor.ace_autocomplete {\
width: 280px;\ width: 280px;\
z-index: 200000;\ z-index: 200000;\
background: #fbfbfb;\ background: #fbfbfb;\

View file

@ -29,7 +29,7 @@
* ***** END LICENSE BLOCK ***** */ * ***** END LICENSE BLOCK ***** */
define(function(require, exports, module) { define(function(require, exports, module) {
var Range = require("ace/range").Range; var Range = require("../range").Range;
var splitRegex = /[^a-zA-Z_0-9\$\-]+/; var splitRegex = /[^a-zA-Z_0-9\$\-]+/;
@ -75,4 +75,4 @@ define(function(require, exports, module) {
}; };
})); }));
}; };
}); });

View file

@ -94,14 +94,14 @@ exports.iSearchCommands = [{
}, { }, {
name: "extendSearchTerm", name: "extendSearchTerm",
exec: function(iSearch, string) { exec: function(iSearch, string) {
iSearch.addChar(string); iSearch.addString(string);
}, },
readOnly: true, readOnly: true,
isIncrementalSearchCommand: true isIncrementalSearchCommand: true
}, { }, {
name: "extendSearchTermSpace", name: "extendSearchTermSpace",
bindKey: "space", bindKey: "space",
exec: function(iSearch) { iSearch.addChar(' '); }, exec: function(iSearch) { iSearch.addString(' '); },
readOnly: true, readOnly: true,
isIncrementalSearchCommand: true isIncrementalSearchCommand: true
}, { }, {
@ -134,6 +134,34 @@ exports.iSearchCommands = [{
}, },
readOnly: true, readOnly: true,
isIncrementalSearchCommand: true isIncrementalSearchCommand: true
}, {
name: "yankNextWord",
bindKey: "Ctrl-w",
exec: function(iSearch) {
var ed = iSearch.$editor,
range = ed.selection.getRangeOfMovements(function(sel) { sel.moveCursorWordRight(); }),
string = ed.session.getTextRange(range);
iSearch.addString(string);
},
readOnly: true,
isIncrementalSearchCommand: true
}, {
name: "yankNextChar",
bindKey: "Ctrl-Alt-y",
exec: function(iSearch) {
var ed = iSearch.$editor,
range = ed.selection.getRangeOfMovements(function(sel) { sel.moveCursorRight(); }),
string = ed.session.getTextRange(range);
iSearch.addString(string);
},
readOnly: true,
isIncrementalSearchCommand: true
}, {
name: 'recenterTopBottom',
bindKey: 'Ctrl-l',
exec: function(iSearch) { iSearch.$editor.execCommand('recenterTopBottom'); },
readOnly: true,
isIncrementalSearchCommand: true
}]; }];
function IncrementalSearchKeyboardHandler(iSearch) { function IncrementalSearchKeyboardHandler(iSearch) {
@ -163,6 +191,8 @@ oop.inherits(IncrementalSearchKeyboardHandler, HashHandler);
var handleKeyboard$super = this.handleKeyboard; var handleKeyboard$super = this.handleKeyboard;
this.handleKeyboard = function(data, hashId, key, keyCode) { this.handleKeyboard = function(data, hashId, key, keyCode) {
if (((hashId === 1/*ctrl*/ || hashId === 8/*command*/) && key === 'v')
|| (hashId === 1/*ctrl*/ && key === 'y')) return null;
var cmd = handleKeyboard$super.call(this, data, hashId, key, keyCode); var cmd = handleKeyboard$super.call(this, data, hashId, key, keyCode);
if (cmd.command) { return cmd; } if (cmd.command) { return cmd; }
if (hashId == -1) { if (hashId == -1) {

View file

@ -144,8 +144,8 @@ exports.loadModule = function(moduleName, onLoad) {
// initialization // initialization
exports.init = function() { function init(packaged) {
options.packaged = require.packaged || module.packaged || (global.define && define.packaged); options.packaged = packaged || require.packaged || module.packaged || (global.define && define.packaged);
if (!global.document) if (!global.document)
return ""; return "";
@ -190,6 +190,8 @@ exports.init = function() {
exports.set(key, scriptOptions[key]); exports.set(key, scriptOptions[key]);
}; };
exports.init = init;
function deHyphenate(str) { function deHyphenate(str) {
return str.replace(/-(.)/g, function(m, m1) { return m1.toUpperCase(); }); return str.replace(/-(.)/g, function(m, m1) { return m1.toUpperCase(); });
} }

View file

@ -121,6 +121,7 @@ var Document = function(textOrLines) {
this.$detectNewLine = function(text) { this.$detectNewLine = function(text) {
var match = text.match(/^.*?(\r\n|\r|\n)/m); var match = text.match(/^.*?(\r\n|\r|\n)/m);
this.$autoNewLine = match ? match[1] : "\n"; this.$autoNewLine = match ? match[1] : "\n";
this._signal("changeNewLineMode");
}; };
/** /**
@ -137,11 +138,11 @@ var Document = function(textOrLines) {
case "unix": case "unix":
return "\n"; return "\n";
default: default:
return this.$autoNewLine; return this.$autoNewLine || "\n";
} }
}; };
this.$autoNewLine = "\n"; this.$autoNewLine = "";
this.$newLineMode = "auto"; this.$newLineMode = "auto";
/** /**
* [Sets the new line mode.]{: #Document.setNewLineMode.desc} * [Sets the new line mode.]{: #Document.setNewLineMode.desc}
@ -153,6 +154,7 @@ var Document = function(textOrLines) {
return; return;
this.$newLineMode = newLineMode; this.$newLineMode = newLineMode;
this._signal("changeNewLineMode");
}; };
/** /**

View file

@ -281,13 +281,13 @@ var EditSession = function(text, mode) {
**/ **/
this.setValue = function(text) { this.setValue = function(text) {
this.doc.setValue(text); this.doc.setValue(text);
this.selection.moveCursorTo(0, 0); this.selection.moveTo(0, 0);
this.selection.clearSelection();
this.$resetRowCache(0); this.$resetRowCache(0);
this.$deltas = []; this.$deltas = [];
this.$deltasDoc = []; this.$deltasDoc = [];
this.$deltasFold = []; this.$deltasFold = [];
this.setUndoManager(this.$undoManager);
this.getUndoManager().reset(); this.getUndoManager().reset();
}; };
@ -412,7 +412,7 @@ var EditSession = function(text, mode) {
} }
self.mergeUndoDeltas = false; self.mergeUndoDeltas = false;
self.$deltas = []; self.$deltas = [];
} };
this.$informUndoManager = lang.delayedCall(this.$syncInformUndoManager); this.$informUndoManager = lang.delayedCall(this.$syncInformUndoManager);
} }
}; };
@ -470,7 +470,7 @@ var EditSession = function(text, mode) {
* @param {Number} tabSize The new tab size * @param {Number} tabSize The new tab size
**/ **/
this.setTabSize = function(tabSize) { this.setTabSize = function(tabSize) {
this.setOption("tabSize", tabSize) this.setOption("tabSize", tabSize);
}; };
/** /**
* Returns the current tab size. * Returns the current tab size.
@ -486,7 +486,7 @@ var EditSession = function(text, mode) {
* *
**/ **/
this.isTabStop = function(position) { this.isTabStop = function(position) {
return this.$useSoftTabs && (position.column % this.$tabSize == 0); return this.$useSoftTabs && (position.column % this.$tabSize === 0);
}; };
this.$overwrite = false; this.$overwrite = false;
@ -500,7 +500,7 @@ var EditSession = function(text, mode) {
* *
**/ **/
this.setOverwrite = function(overwrite) { this.setOverwrite = function(overwrite) {
this.setOption("overwrite", overwrite) this.setOption("overwrite", overwrite);
}; };
/** /**
@ -622,14 +622,14 @@ var EditSession = function(text, mode) {
clazz : clazz, clazz : clazz,
inFront: !!inFront, inFront: !!inFront,
id: id id: id
} };
if (inFront) { if (inFront) {
this.$frontMarkers[id] = marker; this.$frontMarkers[id] = marker;
this._signal("changeFrontMarker") this._signal("changeFrontMarker");
} else { } else {
this.$backMarkers[id] = marker; this.$backMarkers[id] = marker;
this._signal("changeBackMarker") this._signal("changeBackMarker");
} }
return id; return id;
@ -652,10 +652,10 @@ var EditSession = function(text, mode) {
if (inFront) { if (inFront) {
this.$frontMarkers[id] = marker; this.$frontMarkers[id] = marker;
this._signal("changeFrontMarker") this._signal("changeFrontMarker");
} else { } else {
this.$backMarkers[id] = marker; this.$backMarkers[id] = marker;
this._signal("changeBackMarker") this._signal("changeBackMarker");
} }
return marker; return marker;
@ -696,7 +696,7 @@ var EditSession = function(text, mode) {
this.$searchHighlight = this.addDynamicMarker(highlight); this.$searchHighlight = this.addDynamicMarker(highlight);
} }
this.$searchHighlight.setRegexp(re); this.$searchHighlight.setRegexp(re);
} };
// experimental // experimental
this.highlightLines = function(startRow, endRow, clazz, inFront) { this.highlightLines = function(startRow, endRow, clazz, inFront) {
@ -1043,14 +1043,14 @@ var EditSession = function(text, mode) {
}; };
this.getLineWidgetMaxWidth = function() { this.getLineWidgetMaxWidth = function() {
if (this.lineWidgetsWidth != null) return this.lineWidgetsWidth if (this.lineWidgetsWidth != null) return this.lineWidgetsWidth;
var width = 0; var width = 0;
this.lineWidgets.forEach(function(w) { this.lineWidgets.forEach(function(w) {
if (w && w.screenWidth > width) if (w && w.screenWidth > width)
width = w.screenWidth; width = w.screenWidth;
}); });
return this.lineWidgetWidth = width; return this.lineWidgetWidth = width;
} };
this.$computeWidth = function(force) { this.$computeWidth = function(force) {
if (this.$modified || force) { if (this.$modified || force) {
@ -1278,7 +1278,7 @@ var EditSession = function(text, mode) {
// Check if this range and the last undo range has something in common. // Check if this range and the last undo range has something in common.
// If true, merge the ranges. // If true, merge the ranges.
if (lastUndoRange != null) { if (lastUndoRange != null) {
if (Range.comparePoints(lastUndoRange.start, range.start) == 0) { if (Range.comparePoints(lastUndoRange.start, range.start) === 0) {
lastUndoRange.start.column += range.end.column - range.start.column; lastUndoRange.start.column += range.end.column - range.start.column;
lastUndoRange.end.column += range.end.column - range.start.column; lastUndoRange.end.column += range.end.column - range.start.column;
} }
@ -1562,10 +1562,7 @@ var EditSession = function(text, mode) {
// If wrapMode is activaed, the wrapData array has to be initialized. // If wrapMode is activaed, the wrapData array has to be initialized.
if (useWrapMode) { if (useWrapMode) {
var len = this.getLength(); var len = this.getLength();
this.$wrapData = []; this.$wrapData = Array(len);
for (var i = 0; i < len; i++) {
this.$wrapData.push([]);
}
this.$updateWrapData(0, len - 1); this.$updateWrapData(0, len - 1);
} }
@ -1714,16 +1711,10 @@ var EditSession = function(text, mode) {
lastRow = firstRow; lastRow = firstRow;
} else { } else {
var args; var args = Array(len);
if (useWrapMode) { args.unshift(firstRow, 0);
args = [firstRow, 0]; var arr = useWrapMode ? this.$wrapData : this.$rowLengthCache
for (var i = 0; i < len; i++) args.push([]); arr.splice.apply(arr, args);
this.$wrapData.splice.apply(this.$wrapData, args);
} else {
args = Array(len);
args.unshift(firstRow, 0);
this.$rowLengthCache.splice.apply(this.$rowLengthCache, args);
}
// If some new line is added inside of a foldLine, then split // If some new line is added inside of a foldLine, then split
// the fold line up. // the fold line up.
@ -1828,8 +1819,7 @@ var EditSession = function(text, mode) {
lines[foldLine.end.row].length + 1 lines[foldLine.end.row].length + 1
); );
wrapData[foldLine.start.row] wrapData[foldLine.start.row] = this.$computeWrapSplits(tokens, wrapLimit, tabSize);
= this.$computeWrapSplits(tokens, wrapLimit, tabSize);
row = foldLine.end.row + 1; row = foldLine.end.row + 1;
} }
} }
@ -2018,9 +2008,6 @@ var EditSession = function(text, mode) {
* The first position indicates the number of columns for `str` on screen.<br/> * The first position indicates the number of columns for `str` on screen.<br/>
* The second value contains the position of the document column that this function read until. * The second value contains the position of the document column that this function read until.
* *
*
*
*
**/ **/
this.$getStringScreenWidth = function(str, maxScreenColumn, screenColumn) { this.$getStringScreenWidth = function(str, maxScreenColumn, screenColumn) {
if (maxScreenColumn == 0) if (maxScreenColumn == 0)
@ -2321,14 +2308,16 @@ var EditSession = function(text, mode) {
// Clamp textLine if in wrapMode. // Clamp textLine if in wrapMode.
if (this.$useWrapMode) { if (this.$useWrapMode) {
var wrapRow = this.$wrapData[foldStartRow]; var wrapRow = this.$wrapData[foldStartRow];
var screenRowOffset = 0; if (wrapRow) {
while (textLine.length >= wrapRow[screenRowOffset]) { var screenRowOffset = 0;
screenRow ++; while (textLine.length >= wrapRow[screenRowOffset]) {
screenRowOffset++; screenRow ++;
screenRowOffset++;
}
textLine = textLine.substring(
wrapRow[screenRowOffset - 1] || 0, textLine.length
);
} }
textLine = textLine.substring(
wrapRow[screenRowOffset - 1] || 0, textLine.length
);
} }
return { return {
@ -2382,7 +2371,8 @@ var EditSession = function(text, mode) {
var foldStart = fold ? fold.start.row :Infinity; var foldStart = fold ? fold.start.row :Infinity;
while (row < lastRow) { while (row < lastRow) {
screenRows += this.$wrapData[row].length + 1; var splits = this.$wrapData[row];
screenRows += splits ? splits.length + 1 : 1;
row ++; row ++;
if (row > foldStart) { if (row > foldStart) {
row = fold.end.row+1; row = fold.end.row+1;
@ -2398,14 +2388,17 @@ var EditSession = function(text, mode) {
return screenRows; return screenRows;
}; };
// For every keystroke this gets called once per char in the whole doc!!
// Wouldn't hurt to make it a bit faster for c >= 0x1100
/** /**
* @private * @private
* *
*/ */
this.$setFontMetrics = function(fm) {
// todo
}
// For every keystroke this gets called once per char in the whole doc!!
// Wouldn't hurt to make it a bit faster for c >= 0x1100
function isFullWidth(c) { function isFullWidth(c) {
if (c < 0x1100) if (c < 0x1100)
return false; return false;

View file

@ -289,14 +289,13 @@ var Editor = function(renderer, session) {
* Sets a new editsession to use. This method also emits the `'changeSession'` event. * Sets a new editsession to use. This method also emits the `'changeSession'` event.
* @param {EditSession} session The new session to use * @param {EditSession} session The new session to use
* *
*
**/ **/
this.setSession = function(session) { this.setSession = function(session) {
if (this.session == session) if (this.session == session)
return; return;
if (this.session) { var oldSession = this.session;
var oldSession = this.session; if (oldSession) {
this.session.removeEventListener("change", this.$onDocumentChange); this.session.removeEventListener("change", this.$onDocumentChange);
this.session.removeEventListener("changeMode", this.$onChangeMode); this.session.removeEventListener("changeMode", this.$onChangeMode);
this.session.removeEventListener("tokenizerUpdate", this.$onTokenizerUpdate); this.session.removeEventListener("tokenizerUpdate", this.$onTokenizerUpdate);
@ -318,76 +317,80 @@ var Editor = function(renderer, session) {
} }
this.session = session; this.session = session;
if (session) {
this.$onDocumentChange = this.onDocumentChange.bind(this); this.$onDocumentChange = this.onDocumentChange.bind(this);
session.addEventListener("change", this.$onDocumentChange); session.addEventListener("change", this.$onDocumentChange);
this.renderer.setSession(session); this.renderer.setSession(session);
this.$onChangeMode = this.onChangeMode.bind(this); this.$onChangeMode = this.onChangeMode.bind(this);
session.addEventListener("changeMode", this.$onChangeMode); session.addEventListener("changeMode", this.$onChangeMode);
this.$onTokenizerUpdate = this.onTokenizerUpdate.bind(this); this.$onTokenizerUpdate = this.onTokenizerUpdate.bind(this);
session.addEventListener("tokenizerUpdate", this.$onTokenizerUpdate); session.addEventListener("tokenizerUpdate", this.$onTokenizerUpdate);
this.$onChangeTabSize = this.renderer.onChangeTabSize.bind(this.renderer); this.$onChangeTabSize = this.renderer.onChangeTabSize.bind(this.renderer);
session.addEventListener("changeTabSize", this.$onChangeTabSize); session.addEventListener("changeTabSize", this.$onChangeTabSize);
this.$onChangeWrapLimit = this.onChangeWrapLimit.bind(this); this.$onChangeWrapLimit = this.onChangeWrapLimit.bind(this);
session.addEventListener("changeWrapLimit", this.$onChangeWrapLimit); session.addEventListener("changeWrapLimit", this.$onChangeWrapLimit);
this.$onChangeWrapMode = this.onChangeWrapMode.bind(this); this.$onChangeWrapMode = this.onChangeWrapMode.bind(this);
session.addEventListener("changeWrapMode", this.$onChangeWrapMode); session.addEventListener("changeWrapMode", this.$onChangeWrapMode);
this.$onChangeFold = this.onChangeFold.bind(this); this.$onChangeFold = this.onChangeFold.bind(this);
session.addEventListener("changeFold", this.$onChangeFold); session.addEventListener("changeFold", this.$onChangeFold);
this.$onChangeFrontMarker = this.onChangeFrontMarker.bind(this); this.$onChangeFrontMarker = this.onChangeFrontMarker.bind(this);
this.session.addEventListener("changeFrontMarker", this.$onChangeFrontMarker); this.session.addEventListener("changeFrontMarker", this.$onChangeFrontMarker);
this.$onChangeBackMarker = this.onChangeBackMarker.bind(this); this.$onChangeBackMarker = this.onChangeBackMarker.bind(this);
this.session.addEventListener("changeBackMarker", this.$onChangeBackMarker); this.session.addEventListener("changeBackMarker", this.$onChangeBackMarker);
this.$onChangeBreakpoint = this.onChangeBreakpoint.bind(this); this.$onChangeBreakpoint = this.onChangeBreakpoint.bind(this);
this.session.addEventListener("changeBreakpoint", this.$onChangeBreakpoint); this.session.addEventListener("changeBreakpoint", this.$onChangeBreakpoint);
this.$onChangeAnnotation = this.onChangeAnnotation.bind(this); this.$onChangeAnnotation = this.onChangeAnnotation.bind(this);
this.session.addEventListener("changeAnnotation", this.$onChangeAnnotation); this.session.addEventListener("changeAnnotation", this.$onChangeAnnotation);
this.$onCursorChange = this.onCursorChange.bind(this); this.$onCursorChange = this.onCursorChange.bind(this);
this.session.addEventListener("changeOverwrite", this.$onCursorChange); this.session.addEventListener("changeOverwrite", this.$onCursorChange);
this.$onScrollTopChange = this.onScrollTopChange.bind(this); this.$onScrollTopChange = this.onScrollTopChange.bind(this);
this.session.addEventListener("changeScrollTop", this.$onScrollTopChange); this.session.addEventListener("changeScrollTop", this.$onScrollTopChange);
this.$onScrollLeftChange = this.onScrollLeftChange.bind(this); this.$onScrollLeftChange = this.onScrollLeftChange.bind(this);
this.session.addEventListener("changeScrollLeft", this.$onScrollLeftChange); this.session.addEventListener("changeScrollLeft", this.$onScrollLeftChange);
this.selection = session.getSelection(); this.selection = session.getSelection();
this.selection.addEventListener("changeCursor", this.$onCursorChange); this.selection.addEventListener("changeCursor", this.$onCursorChange);
this.$onSelectionChange = this.onSelectionChange.bind(this); this.$onSelectionChange = this.onSelectionChange.bind(this);
this.selection.addEventListener("changeSelection", this.$onSelectionChange); this.selection.addEventListener("changeSelection", this.$onSelectionChange);
this.onChangeMode(); this.onChangeMode();
this.$blockScrolling += 1; this.$blockScrolling += 1;
this.onCursorChange(); this.onCursorChange();
this.$blockScrolling -= 1; this.$blockScrolling -= 1;
this.onScrollTopChange(); this.onScrollTopChange();
this.onScrollLeftChange(); this.onScrollLeftChange();
this.onSelectionChange(); this.onSelectionChange();
this.onChangeFrontMarker(); this.onChangeFrontMarker();
this.onChangeBackMarker(); this.onChangeBackMarker();
this.onChangeBreakpoint(); this.onChangeBreakpoint();
this.onChangeAnnotation(); this.onChangeAnnotation();
this.session.getUseWrapMode() && this.renderer.adjustWrapLimit(); this.session.getUseWrapMode() && this.renderer.adjustWrapLimit();
this.renderer.updateFull(); this.renderer.updateFull();
}
this._signal("changeSession", { this._signal("changeSession", {
session: session, session: session,
oldSession: oldSession oldSession: oldSession
}); });
oldSession && oldSession._signal("changeEditor", {oldEditor: this});
session && session._signal("changeEditor", {editor: this});
}; };
/** /**
@ -452,11 +455,10 @@ var Editor = function(renderer, session) {
/** /**
* {:VirtualRenderer.setTheme} * {:VirtualRenderer.setTheme}
* @param {String} theme The path to a theme * @param {String} theme The path to a theme
* * @param {Function} cb optional callback called when theme is loaded
*
**/ **/
this.setTheme = function(theme) { this.setTheme = function(theme, cb) {
this.renderer.setTheme(theme); this.renderer.setTheme(theme, cb);
}; };
/** /**
@ -654,7 +656,7 @@ var Editor = function(renderer, session) {
if (this.$highlightActiveLine) { if (this.$highlightActiveLine) {
if ((this.$selectionStyle != "line" || !this.selection.isMultiLine())) if ((this.$selectionStyle != "line" || !this.selection.isMultiLine()))
highlight = this.getCursorPosition(); highlight = this.getCursorPosition();
if (this.renderer.$maxLines && this.session.getLength() === 1) if (this.renderer.$maxLines && this.session.getLength() === 1 && !(this.renderer.$minLines > 1))
highlight = false; highlight = false;
} }
@ -840,14 +842,13 @@ var Editor = function(renderer, session) {
* Inserts `text` into wherever the cursor is pointing. * Inserts `text` into wherever the cursor is pointing.
* @param {String} text The new text to add * @param {String} text The new text to add
* *
*
**/ **/
this.insert = function(text) { this.insert = function(text, pasted) {
var session = this.session; var session = this.session;
var mode = session.getMode(); var mode = session.getMode();
var cursor = this.getCursorPosition(); var cursor = this.getCursorPosition();
if (this.getBehavioursEnabled()) { if (this.getBehavioursEnabled() && !pasted) {
// Get a transform if the current mode wants one. // Get a transform if the current mode wants one.
var transform = mode.transformAction(session.getState(cursor.row), 'insertion', this, session, text); var transform = mode.transformAction(session.getState(cursor.row), 'insertion', this, session, text);
if (transform) { if (transform) {
@ -1928,8 +1929,7 @@ var Editor = function(renderer, session) {
else else
this.selection.selectTo(pos.row, pos.column); this.selection.selectTo(pos.row, pos.column);
} else { } else {
this.clearSelection(); this.selection.moveTo(pos.row, pos.column);
this.moveCursorTo(pos.row, pos.column);
} }
} }
}; };
@ -1964,8 +1964,7 @@ var Editor = function(renderer, session) {
* @related Editor.moveCursorTo * @related Editor.moveCursorTo
**/ **/
this.navigateTo = function(row, column) { this.navigateTo = function(row, column) {
this.clearSelection(); this.selection.moveTo(row, column);
this.moveCursorTo(row, column);
}; };
/** /**
@ -1980,8 +1979,7 @@ var Editor = function(renderer, session) {
return this.moveCursorToPosition(selectionStart); return this.moveCursorToPosition(selectionStart);
} }
this.selection.clearSelection(); this.selection.clearSelection();
times = times || 1; this.selection.moveCursorBy(-times || -1, 0);
this.selection.moveCursorBy(-times, 0);
}; };
/** /**
@ -1996,8 +1994,7 @@ var Editor = function(renderer, session) {
return this.moveCursorToPosition(selectionEnd); return this.moveCursorToPosition(selectionEnd);
} }
this.selection.clearSelection(); this.selection.clearSelection();
times = times || 1; this.selection.moveCursorBy(times || 1, 0);
this.selection.moveCursorBy(times, 0);
}; };
/** /**
@ -2141,8 +2138,7 @@ var Editor = function(renderer, session) {
this.$blockScrolling += 1; this.$blockScrolling += 1;
var selection = this.getSelectionRange(); var selection = this.getSelectionRange();
this.clearSelection(); this.selection.moveTo(0, 0);
this.selection.moveCursorTo(0, 0);
for (var i = ranges.length - 1; i >= 0; --i) { for (var i = ranges.length - 1; i >= 0; --i) {
if(this.$tryReplace(ranges[i], replacement)) { if(this.$tryReplace(ranges[i], replacement)) {

57
lib/ace/ext/beautify.js Normal file
View file

@ -0,0 +1,57 @@
/* ***** 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 ***** */
// [WIP]
define(function(require, exports, module) {
"use strict";
var TokenIterator = require("ace/token_iterator").TokenIterator;
var phpTransform = require("./beautify/php_rules").transform;
exports.beautify = function(session) {
var iterator = new TokenIterator(session, 0, 0);
var token = iterator.getCurrentToken();
var context = session.$modeId.split("/").pop();
var code = phpTransform(iterator, context);
session.doc.setValue(code);
};
exports.commands = [{
name: "beautify",
exec: function(editor) {
exports.beautify(editor.session);
},
bindKey: "Ctrl-Shift-B"
}]
});

View file

@ -0,0 +1,366 @@
/* ***** 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 TokenIterator = require("ace/token_iterator").TokenIterator;
exports.newLines = [{
type: 'support.php_tag',
value: '<?php'
}, {
type: 'support.php_tag',
value: '<?'
}, {
type: 'support.php_tag',
value: '?>'
}, {
type: 'paren.lparen',
value: '{',
indent: true
}, {
type: 'paren.rparen',
breakBefore: true,
value: '}',
indent: false
}, {
type: 'paren.rparen',
breakBefore: true,
value: '})',
indent: false,
dontBreak: true
}, {
type: 'comment'
}, {
type: 'text',
value: ';'
}, {
type: 'text',
value: ':',
context: 'php'
}, {
type: 'keyword',
value: 'case',
indent: true,
dontBreak: true
}, {
type: 'keyword',
value: 'default',
indent: true,
dontBreak: true
}, {
type: 'keyword',
value: 'break',
indent: false,
dontBreak: true
}, {
type: 'punctuation.doctype.end',
value: '>'
}, {
type: 'meta.tag.punctuation.end',
value: '>'
}, {
type: 'meta.tag.punctuation.begin',
value: '<',
blockTag: true,
indent: true,
dontBreak: true
}, {
type: 'meta.tag.punctuation.begin',
value: '</',
indent: false,
breakBefore: true,
dontBreak: true
}, {
type: 'punctuation.operator',
value: ';'
}];
exports.spaces = [{
type: 'xml-pe',
prepend: true
},{
type: 'entity.other.attribute-name',
prepend: true
}, {
type: 'storage.type',
value: 'var',
append: true
}, {
type: 'storage.type',
value: 'function',
append: true
}, {
type: 'keyword.operator',
value: '='
}, {
type: 'keyword',
value: 'as',
prepend: true,
append: true
}, {
type: 'keyword',
value: 'function',
append: true
}, {
type: 'support.function',
next: /[^\(]/,
append: true
}, {
type: 'keyword',
value: 'or',
append: true,
prepend: true
}, {
type: 'keyword',
value: 'and',
append: true,
prepend: true
}, {
type: 'keyword',
value: 'case',
append: true
}, {
type: 'keyword.operator',
value: '||',
append: true,
prepend: true
}, {
type: 'keyword.operator',
value: '&&',
append: true,
prepend: true
}];
exports.singleTags = ['!doctype','area','base','br','hr','input','img','link','meta'];
exports.transform = function(iterator, maxPos, context) {
var token = iterator.getCurrentToken();
var newLines = exports.newLines;
var spaces = exports.spaces;
var singleTags = exports.singleTags;
var code = '';
var indentation = 0;
var dontBreak = false;
var tag;
var lastTag;
var lastToken = {};
var nextTag;
var nextToken = {};
var breakAdded = false;
var value = '';
while (token!==null) {
console.log(token);
if( !token ){
token = iterator.stepForward();
continue;
}
//change syntax
//php
if( token.type == 'support.php_tag' && token.value != '?>' ){
context = 'php';
}
else if( token.type == 'support.php_tag' && token.value == '?>' ){
context = 'html';
}
//css
else if( token.type == 'meta.tag.name.style' && context != 'css' ){
context = 'css';
}
else if( token.type == 'meta.tag.name.style' && context == 'css' ){
context = 'html';
}
//js
else if( token.type == 'meta.tag.name.script' && context != 'js' ){
context = 'js';
}
else if( token.type == 'meta.tag.name.script' && context == 'js' ){
context = 'html';
}
nextToken = iterator.stepForward();
//tag name
if (nextToken && nextToken.type.indexOf('meta.tag.name') == 0) {
nextTag = nextToken.value;
}
//don't linebreak
if ( lastToken.type == 'support.php_tag' && lastToken.value == '<?=') {
dontBreak = true;
}
//lowercase
if (token.type == 'meta.tag.name') {
token.value = token.value.toLowerCase();
}
//trim spaces
if (token.type == 'text') {
token.value = token.value.trim();
}
//skip empty tokens
if (!token.value) {
token = nextToken;
continue;
}
//put spaces back in
value = token.value;
for (var i in spaces) {
if (
token.type == spaces[i].type &&
(!spaces[i].value || token.value == spaces[i].value) &&
(
nextToken &&
(!spaces[i].next || spaces[i].next.test(nextToken.value))
)
) {
if (spaces[i].prepend) {
value = ' ' + token.value;
}
if (spaces[i].append) {
value += ' ';
}
}
}
//tag name
if (token.type.indexOf('meta.tag.name') == 0) {
tag = token.value;
//console.log(tag);
}
//new line before
breakAdded = false;
//outdent
for (i in newLines) {
if (
token.type == newLines[i].type &&
(
!newLines[i].value ||
token.value == newLines[i].value
) &&
(
!newLines[i].blockTag ||
singleTags.indexOf(nextTag) === -1
) &&
(
!newLines[i].context ||
newLines[i].context === context
)
) {
if (newLines[i].indent === false) {
indentation--;
}
if (
newLines[i].breakBefore &&
( !newLines[i].prev || newLines[i].prev.test(lastToken.value) )
) {
code += "\n";
breakAdded = true;
//indent
for (i = 0; i < indentation; i++) {
code += "\t";
}
}
break;
}
}
if (dontBreak===false) {
for (i in newLines) {
if (
lastToken.type == newLines[i].type &&
(
!newLines[i].value || lastToken.value == newLines[i].value
) &&
(
!newLines[i].blockTag ||
singleTags.indexOf(tag) === -1
) &&
(
!newLines[i].context ||
newLines[i].context === context
)
) {
if (newLines[i].indent === true) {
indentation++;
}
if (!newLines[i].dontBreak && !breakAdded) {
code += "\n";
//indent
for (i = 0; i < indentation; i++) {
code += "\t";
}
}
break;
}
}
}
code += value;
//linebreaks back on after end short php tag
if ( lastToken.type == 'support.php_tag' && lastToken.value == '?>' ) {
dontBreak = false;
}
//next token
lastTag = tag;
lastToken = token;
token = nextToken;
if (token===null) {
break;
}
}
return code;
};
});

View file

@ -130,8 +130,7 @@ AceEmmetEditor.prototype = {
*/ */
setCaretPos: function(index){ setCaretPos: function(index){
var pos = this.ace.indexToPosition(index); var pos = this.ace.indexToPosition(index);
this.ace.clearSelection(); this.ace.selection.moveToPosition(pos);
this.ace.selection.moveCursorToPosition(pos);
}, },
/** /**

View file

@ -122,8 +122,7 @@ exports.showErrorMarker = function(editor, dir) {
}; };
} }
editor.session.unfold(pos.row); editor.session.unfold(pos.row);
editor.selection.moveCursorToPosition(pos); editor.selection.moveToPosition(pos);
editor.selection.clearSelection();
var w = { var w = {
row: pos.row, row: pos.row,
@ -143,12 +142,12 @@ exports.showErrorMarker = function(editor, dir) {
el.className = "error_widget " + gutterAnno.className; el.className = "error_widget " + gutterAnno.className;
el.innerHTML = gutterAnno.text.join("<br>"); el.innerHTML = gutterAnno.text.join("<br>");
var kb = { el.appendChild(dom.createElement("div"));
handleKeyboard:function(_,hashId, keyString) {
if (hashId === 0 && keyString === "esc") { var kb = function(_, hashId, keyString) {
w.destroy(); if (hashId === 0 && (keyString === "esc" || keyString === "return")) {
return true; w.destroy();
} return {command: "null"};
} }
}; };

View file

@ -34,6 +34,7 @@ define(function(require, exports, module) {
var snippetManager = require("../snippets").snippetManager; var snippetManager = require("../snippets").snippetManager;
var Autocomplete = require("../autocomplete").Autocomplete; var Autocomplete = require("../autocomplete").Autocomplete;
var config = require("../config"); var config = require("../config");
var util = require("../autocomplete/util");
var textCompleter = require("../autocomplete/text_completer"); var textCompleter = require("../autocomplete/text_completer");
var keyWordCompleter = { var keyWordCompleter = {
@ -114,6 +115,58 @@ var loadSnippetFile = function(id) {
}); });
}; };
var doLiveAutocomplete = function(e) {
var editor = e.editor;
var session = editor.getSession();
var pos = editor.getCursorPosition();
var line = session.getLine(pos.row);
var hasCompleter = (editor.completer && editor.completer.activated);
var text = e.args || "";
// Is the user entering text
// we only want to automatically show the autocomplete dialog
// whenever the user is typing in text not pasting, deleting, ...
var typing = (e.command.name === "insertstring" && text.length === 1);
// We don't want to autocomplete with no prefix
if(
e.command.name === 'backspace' &&
util.retrievePrecedingIdentifier(line, pos.column) === ''
) {
if(hasCompleter) editor.completer.detach();
return;
}
// we don't want to autocomplete on paste events
if(!typing) {
return;
}
// The prefix to autocomplete for
var prefix = util.retrievePrecedingIdentifier(line, pos.column);
// Only autocomplete if there's a prefix that can be matched
if(prefix !== '' && !(hasCompleter)) {
if (!editor.completer) {
// Create new autocompleter
editor.completer = new Autocomplete();
// Disable autoInsert
editor.completer.autoInsert = false;
}
editor.completer.showPopup(editor);
// needed for firefox on mac
editor.completer.cancelContextMenu();
} else if(prefix === '' && hasCompleter) {
// When the prefix is empty
// close the autocomplete dialog
editor.completer.detach();
}
};
var Editor = require("../editor").Editor; var Editor = require("../editor").Editor;
require("../config").defineOptions(Editor.prototype, "editor", { require("../config").defineOptions(Editor.prototype, "editor", {
enableBasicAutocompletion: { enableBasicAutocompletion: {
@ -127,6 +180,17 @@ require("../config").defineOptions(Editor.prototype, "editor", {
}, },
value: false value: false
}, },
enableLiveAutocomplete: {
set: function(val) {
if (val) {
// On each change automatically trigger the autocomplete
this.commands.on('afterExec', doLiveAutocomplete);
} else {
this.commands.removeListener('afterExec', doLiveAutocomplete);
}
},
value: false
},
enableSnippets: { enableSnippets: {
set: function(val) { set: function(val) {
if (val) { if (val) {

View file

@ -68,6 +68,7 @@ var supportedModes = {
EJS: ["ejs"], EJS: ["ejs"],
Forth: ["frt|fs|ldr"], Forth: ["frt|fs|ldr"],
FTL: ["ftl"], FTL: ["ftl"],
Gherkin: ["feature"],
Glsl: ["glsl|frag|vert"], Glsl: ["glsl|frag|vert"],
golang: ["go"], golang: ["go"],
Groovy: ["groovy"], Groovy: ["groovy"],

View file

@ -72,6 +72,8 @@ oop.inherits(IncrementalSearch, Search);
this.$options.needle = ''; this.$options.needle = '';
this.$options.backwards = backwards; this.$options.backwards = backwards;
ed.keyBinding.addKeyboardHandler(this.$keyboardHandler); ed.keyBinding.addKeyboardHandler(this.$keyboardHandler);
// we need to completely intercept paste, just registering an event handler does not work
this.$originalEditorOnPaste = ed.onPaste; ed.onPaste = this.onPaste.bind(this);
this.$mousedownHandler = ed.addEventListener('mousedown', this.onMouseDown.bind(this)); this.$mousedownHandler = ed.addEventListener('mousedown', this.onMouseDown.bind(this));
this.selectionFix(ed); this.selectionFix(ed);
this.statusMessage(true); this.statusMessage(true);
@ -79,11 +81,13 @@ oop.inherits(IncrementalSearch, Search);
this.deactivate = function(reset) { this.deactivate = function(reset) {
this.cancelSearch(reset); this.cancelSearch(reset);
this.$editor.keyBinding.removeKeyboardHandler(this.$keyboardHandler); var ed = this.$editor;
ed.keyBinding.removeKeyboardHandler(this.$keyboardHandler);
if (this.$mousedownHandler) { if (this.$mousedownHandler) {
this.$editor.removeEventListener('mousedown', this.$mousedownHandler); ed.removeEventListener('mousedown', this.$mousedownHandler);
delete this.$mousedownHandler; delete this.$mousedownHandler;
} }
ed.onPaste = this.$originalEditorOnPaste;
this.message(''); this.message('');
} }
@ -150,9 +154,9 @@ oop.inherits(IncrementalSearch, Search);
return found; return found;
} }
this.addChar = function(c) { this.addString = function(s) {
return this.highlightAndFindWithNeedle(false, function(needle) { return this.highlightAndFindWithNeedle(false, function(needle) {
return needle + c; return needle + s;
}); });
} }
@ -181,6 +185,10 @@ oop.inherits(IncrementalSearch, Search);
return true; return true;
} }
this.onPaste = function(text) {
this.addString(text);
}
this.statusMessage = function(found) { this.statusMessage = function(found) {
var options = this.$options, msg = ''; var options = this.$options, msg = '';
msg += options.backwards ? 'reverse-' : ''; msg += options.backwards ? 'reverse-' : '';

View file

@ -95,17 +95,17 @@ module.exports = {
"test: find simple text incrementally" : function() { "test: find simple text incrementally" : function() {
iSearch.activate(editor); iSearch.activate(editor);
var range = iSearch.addChar('1'), // "1" var range = iSearch.addString('1'), // "1"
highlightRanges = callHighlighterUpdate(editor.session); highlightRanges = callHighlighterUpdate(editor.session);
testRanges("Range: [0/3] -> [0/4]", [range], "range"); testRanges("Range: [0/3] -> [0/4]", [range], "range");
testRanges("Range: [0/3] -> [0/4],Range: [1/3] -> [1/4]", highlightRanges, "highlight"); testRanges("Range: [0/3] -> [0/4],Range: [1/3] -> [1/4]", highlightRanges, "highlight");
range = iSearch.addChar('2'); // "12" range = iSearch.addString('2'); // "12"
highlightRanges = callHighlighterUpdate(editor.session); highlightRanges = callHighlighterUpdate(editor.session);
testRanges("Range: [0/3] -> [0/5]", [range], "range"); testRanges("Range: [0/3] -> [0/5]", [range], "range");
testRanges("Range: [0/3] -> [0/5],Range: [1/3] -> [1/5]", highlightRanges, "highlight"); testRanges("Range: [0/3] -> [0/5],Range: [1/3] -> [1/5]", highlightRanges, "highlight");
range = iSearch.addChar('3'); // "123" range = iSearch.addString('3'); // "123"
highlightRanges = callHighlighterUpdate(editor.session); highlightRanges = callHighlighterUpdate(editor.session);
testRanges("Range: [0/3] -> [0/6]", [range], "range"); testRanges("Range: [0/3] -> [0/6]", [range], "range");
testRanges("Range: [0/3] -> [0/6]", highlightRanges, "highlight"); testRanges("Range: [0/3] -> [0/6]", highlightRanges, "highlight");
@ -118,7 +118,7 @@ module.exports = {
"test: forward / backward" : function() { "test: forward / backward" : function() {
iSearch.activate(editor); iSearch.activate(editor);
iSearch.addChar('1'); iSearch.addChar('2'); iSearch.addString('1'); iSearch.addString('2');
var range = iSearch.next(); var range = iSearch.next();
testRanges("Range: [1/3] -> [1/5]", [range], "range"); testRanges("Range: [1/3] -> [1/5]", [range], "range");
@ -131,18 +131,18 @@ module.exports = {
"test: cancelSearch" : function() { "test: cancelSearch" : function() {
iSearch.activate(editor); iSearch.activate(editor);
iSearch.addChar('1'); iSearch.addChar('2'); iSearch.addString('1'); iSearch.addString('2');
var range = iSearch.cancelSearch(true); var range = iSearch.cancelSearch(true);
testRanges("Range: [0/0] -> [0/0]", [range], "range"); testRanges("Range: [0/0] -> [0/0]", [range], "range");
iSearch.addChar('1'); range = iSearch.addChar('2'); iSearch.addString('1'); range = iSearch.addString('2');
testRanges("Range: [0/3] -> [0/5]", [range], "range"); testRanges("Range: [0/3] -> [0/5]", [range], "range");
}, },
"test: failing search keeps pos" : function() { "test: failing search keeps pos" : function() {
iSearch.activate(editor); iSearch.activate(editor);
iSearch.addChar('1'); iSearch.addChar('2'); iSearch.addString('1'); iSearch.addString('2');
var range = iSearch.addChar('x'); var range = iSearch.addString('x');
testRanges("", [range], "range"); testRanges("", [range], "range");
assert.position(editor.getCursorPosition(), 0, 5); assert.position(editor.getCursorPosition(), 0, 5);
}, },
@ -150,14 +150,14 @@ module.exports = {
"test: backwards search" : function() { "test: backwards search" : function() {
editor.moveCursorTo(1,0); editor.moveCursorTo(1,0);
iSearch.activate(editor, true); iSearch.activate(editor, true);
iSearch.addChar('1'); var range = iSearch.addChar('2');; iSearch.addString('1'); var range = iSearch.addString('2');;
testRanges("Range: [0/5] -> [0/3]", [range], "range"); testRanges("Range: [0/5] -> [0/3]", [range], "range");
assert.position(editor.getCursorPosition(), 0, 3); assert.position(editor.getCursorPosition(), 0, 3);
}, },
"test: forwards then backwards, same result, reoriented range" : function() { "test: forwards then backwards, same result, reoriented range" : function() {
iSearch.activate(editor); iSearch.activate(editor);
iSearch.addChar('1'); var range = iSearch.addChar('2');; iSearch.addString('1'); var range = iSearch.addString('2');;
testRanges("Range: [0/3] -> [0/5]", [range], "range"); testRanges("Range: [0/3] -> [0/5]", [range], "range");
assert.position(editor.getCursorPosition(), 0, 5); assert.position(editor.getCursorPosition(), 0, 5);
@ -168,7 +168,7 @@ module.exports = {
"test: reuse prev search via option" : function() { "test: reuse prev search via option" : function() {
iSearch.activate(editor); iSearch.activate(editor);
iSearch.addChar('1'); iSearch.addChar('2');; iSearch.addString('1'); iSearch.addString('2');;
assert.position(editor.getCursorPosition(), 0, 5); assert.position(editor.getCursorPosition(), 0, 5);
iSearch.deactivate(); iSearch.deactivate();
@ -179,14 +179,14 @@ module.exports = {
"test: don't extend selection range if selection is empty" : function() { "test: don't extend selection range if selection is empty" : function() {
iSearch.activate(editor); iSearch.activate(editor);
iSearch.addChar('1'); iSearch.addChar('2');; iSearch.addString('1'); iSearch.addString('2');;
testRanges("Range: [0/5] -> [0/5]", [editor.getSelectionRange()], "sel range"); testRanges("Range: [0/5] -> [0/5]", [editor.getSelectionRange()], "sel range");
}, },
"test: extend selection range if selection exists" : function() { "test: extend selection range if selection exists" : function() {
iSearch.activate(editor); iSearch.activate(editor);
editor.selection.selectTo(0, 1); editor.selection.selectTo(0, 1);
iSearch.addChar('1'); iSearch.addChar('2');; iSearch.addString('1'); iSearch.addString('2');;
testRanges("Range: [0/0] -> [0/5]", [editor.getSelectionRange()], "sel range"); testRanges("Range: [0/0] -> [0/5]", [editor.getSelectionRange()], "sel range");
}, },
@ -195,7 +195,7 @@ module.exports = {
editor.keyBinding.addKeyboardHandler(emacs.handler); editor.keyBinding.addKeyboardHandler(emacs.handler);
emacs.handler.commands.setMark.exec(editor); emacs.handler.commands.setMark.exec(editor);
iSearch.activate(editor); iSearch.activate(editor);
iSearch.addChar('1'); iSearch.addChar('2');; iSearch.addString('1'); iSearch.addString('2');;
testRanges("Range: [0/0] -> [0/5]", [editor.getSelectionRange()], "sel range"); testRanges("Range: [0/0] -> [0/5]", [editor.getSelectionRange()], "sel range");
} }

View file

@ -219,6 +219,10 @@ exports.handler.bindKey = function(key, command) {
}; };
exports.handler.handleKeyboard = function(data, hashId, key, keyCode) { exports.handler.handleKeyboard = function(data, hashId, key, keyCode) {
// if keyCode == -1 a non-printable key was pressed, such as just
// control. Handling those is currently not supported in this handler
if (keyCode === -1) return undefined;
var editor = data.editor; var editor = data.editor;
// insertstring data.count times // insertstring data.count times
if (hashId == -1) { if (hashId == -1) {

View file

@ -145,8 +145,8 @@ exports.handler = {
if (hashId == -1 || hashId == 1 || hashId === 0 && key.length > 1) { if (hashId == -1 || hashId == 1 || hashId === 0 && key.length > 1) {
if (cmds.inputBuffer.idle && startCommands[key]) if (cmds.inputBuffer.idle && startCommands[key])
return startCommands[key]; return startCommands[key];
cmds.inputBuffer.push(editor, key); var isHandled = cmds.inputBuffer.push(editor, key);
return {command: "null", passEvent: false}; return {command: "null", passEvent: !isHandled};
} // if no modifier || shift: wait for input. } // if no modifier || shift: wait for input.
else if (key.length == 1 && (hashId === 0 || hashId == 4)) { else if (key.length == 1 && (hashId === 0 || hashId == 4)) {
return {command: "null", passEvent: true}; return {command: "null", passEvent: true};

View file

@ -201,8 +201,7 @@ var actions = exports.actions = {
//editor.selection.selectLine(); //editor.selection.selectLine();
//editor.selection.selectLeft(); //editor.selection.selectLeft();
var row = editor.getCursorPosition().row; var row = editor.getCursorPosition().row;
editor.selection.clearSelection(); editor.selection.moveTo(row, 0);
editor.selection.moveCursorTo(row, 0);
editor.selection.selectLineEnd(); editor.selection.selectLineEnd();
editor.selection.visualLineStart = row; editor.selection.visualLineStart = row;
@ -582,13 +581,11 @@ var handleCursorMove = exports.onCursorMove = function(editor, e) {
var cursorRow = editor.getCursorPosition().row; var cursorRow = editor.getCursorPosition().row;
if(originRow <= cursorRow) { if(originRow <= cursorRow) {
var endLine = editor.session.getLine(cursorRow); var endLine = editor.session.getLine(cursorRow);
editor.selection.clearSelection(); editor.selection.moveTo(originRow, 0);
editor.selection.moveCursorTo(originRow, 0);
editor.selection.selectTo(cursorRow, endLine.length); editor.selection.selectTo(cursorRow, endLine.length);
} else { } else {
var endLine = editor.session.getLine(originRow); var endLine = editor.session.getLine(originRow);
editor.selection.clearSelection(); editor.selection.moveTo(originRow, endLine.length);
editor.selection.moveCursorTo(originRow, endLine.length);
editor.selection.selectTo(cursorRow, 0); editor.selection.selectTo(cursorRow, 0);
} }
} }

View file

@ -53,8 +53,7 @@ function Motion(m) {
var a = getPos(editor, range, count, param, false); var a = getPos(editor, range, count, param, false);
if (!a) if (!a)
return; return;
editor.clearSelection(); editor.selection.moveTo(a.row, a.column);
editor.moveCursorTo(a.row, a.column);
}; };
m.sel = function(editor, range, count, param) { m.sel = function(editor, range, count, param) {
var a = getPos(editor, range, count, param, true); var a = getPos(editor, range, count, param, true);

View file

@ -122,13 +122,11 @@ module.exports = {
}, },
copyLine: function(editor) { copyLine: function(editor) {
var pos = editor.getCursorPosition(); var pos = editor.getCursorPosition();
editor.selection.clearSelection(); editor.selection.moveTo(pos.row, pos.column);
editor.moveCursorTo(pos.row, pos.column);
editor.selection.selectLine(); editor.selection.selectLine();
registers._default.isLine = true; registers._default.isLine = true;
registers._default.text = editor.getCopyText().replace(/\n$/, ""); registers._default.text = editor.getCopyText().replace(/\n$/, "");
editor.selection.clearSelection(); editor.selection.moveTo(pos.row, pos.column);
editor.moveCursorTo(pos.row, pos.column);
} }
}; };
}); });

View file

@ -190,7 +190,7 @@ var Cursor = function(parentEl) {
for (var i = 0, n = selections.length; i < n; i++) { for (var i = 0, n = selections.length; i < n; i++) {
var pixelPos = this.getPixelPosition(selections[i].cursor, true); var pixelPos = this.getPixelPosition(selections[i].cursor, true);
if ((pixelPos.top > config.height + config.offset || if ((pixelPos.top > config.height + config.offset ||
pixelPos.top < -config.offset) && i > 1) { pixelPos.top < 0) && i > 1) {
continue; continue;
} }

View file

@ -0,0 +1,158 @@
/* ***** BEGIN LICENSE BLOCK *****
* Distributed under the BSD license:
*
* Copyright (c) 2010, Ajax.org B.V.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of Ajax.org B.V. nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* ***** END LICENSE BLOCK ***** */
define(function(require, exports, module) {
var oop = require("../lib/oop");
var dom = require("../lib/dom");
var lang = require("../lib/lang");
var EventEmitter = require("../lib/event_emitter").EventEmitter;
var CHAR_COUNT = 0;
var FontMetrics = exports.FontMetrics = function(parentEl, interval) {
this.el = dom.createElement("div");
this.$setMeasureNodeStyles(this.el.style, true);
this.$main = dom.createElement("div");
this.$setMeasureNodeStyles(this.$main.style);
this.$measureNode = dom.createElement("div");
this.$setMeasureNodeStyles(this.$measureNode.style);
this.el.appendChild(this.$main);
this.el.appendChild(this.$measureNode);
parentEl.appendChild(this.el);
if (!CHAR_COUNT)
this.$testFractionalRect();
this.$measureNode.textContent = lang.stringRepeat("X", CHAR_COUNT);
this.$characterSize = {width: 0, height: 0};
this.checkForSizeChanges();
};
(function() {
oop.implement(this, EventEmitter);
this.$characterSize = {width: 0, height: 0};
this.$testFractionalRect = function() {
var el = dom.createElement("div");
this.$setMeasureNodeStyles(el.style);
el.style.width = "0.2px";
document.documentElement.appendChild(el);
var w = el.getBoundingClientRect().width;
if (w > 0 && w < 1)
CHAR_COUNT = 1;
else
CHAR_COUNT = 100;
el.parentNode.removeChild(el);
};
this.$setMeasureNodeStyles = function(style, isRoot) {
style.width = style.height = "auto";
style.left = style.top = "-100px";
style.visibility = "hidden";
style.position = "fixed";
style.whiteSpace = "pre";
style.font = "inherit";
style.overflow = isRoot ? "hidden" : "visible";
};
this.checkForSizeChanges = function() {
var size = this.$measureSizes();
if (size && (this.$characterSize.width !== size.width || this.$characterSize.height !== size.height)) {
this.$measureNode.style.fontWeight = "bold";
var boldSize = this.$measureSizes();
this.$measureNode.style.fontWeight = "";
this.$characterSize = size;
this.charSizes = Object.create(null);
this.allowBoldFonts = boldSize && boldSize.width === size.width && boldSize.height === size.height;
this._emit("changeCharacterSize", {data: size});
}
};
this.$pollSizeChanges = function() {
if (this.$pollSizeChangesTimer)
return this.$pollSizeChangesTimer;
var self = this;
return this.$pollSizeChangesTimer = setInterval(function() {
self.checkForSizeChanges();
}, 500);
};
this.setPolling = function(val) {
if (val) {
this.$pollSizeChanges();
} else {
if (this.$pollSizeChangesTimer)
this.$pollSizeChangesTimer;
}
};
this.$measureSizes = function() {
var rect = this.$measureNode.getBoundingClientRect();
var size = {
height: rect.height,
width: rect.width / CHAR_COUNT
};
// Size and width can be null if the editor is not visible or
// detached from the document
if (size.width === 0 || size.height === 0)
return null;
return size;
};
this.$measureCharWidth = function(ch) {
this.$main.textContent = lang.stringRepeat(ch, CHAR_COUNT);
var rect = this.$main.getBoundingClientRect();
return rect.width / CHAR_COUNT;
};
this.getCharacterWidth = function(ch) {
var w = this.charSizes[ch];
if (w === undefined) {
this.charSizes[ch] = this.$measureCharWidth(ch) / this.$characterSize.width;
}
return w;
};
this.destroy = function() {
clearInterval(this.$pollSizeChangesTimer);
if (this.el && this.el.parentNode)
this.el.parentNode.removeChild(this.el);
};
}).call(FontMetrics.prototype);
});

View file

@ -119,7 +119,8 @@ var Gutter = function(parentEl) {
this.update = function(config) { this.update = function(config) {
var session = this.session; var session = this.session;
var firstRow = config.firstRow; var firstRow = config.firstRow;
var lastRow = Math.min(config.lastRow + 1, session.getLength() - 1); // needed to compensate var lastRow = Math.min(config.lastRow + config.gutterOffset, // needed to compensate for hor scollbar
session.getLength() - 1);
var fold = session.getNextFoldLine(firstRow); var fold = session.getNextFoldLine(firstRow);
var foldStart = fold ? fold.start.row : Infinity; var foldStart = fold ? fold.start.row : Infinity;
var foldWidgets = this.$showFoldWidgets && session.foldWidgets; var foldWidgets = this.$showFoldWidgets && session.foldWidgets;

View file

@ -41,154 +41,58 @@ var Text = function(parentEl) {
this.element = dom.createElement("div"); this.element = dom.createElement("div");
this.element.className = "ace_layer ace_text-layer"; this.element.className = "ace_layer ace_text-layer";
parentEl.appendChild(this.element); parentEl.appendChild(this.element);
this.$updateEolChar = this.$updateEolChar.bind(this);
this.$characterSize = {width: 0, height: 0};
this.checkForSizeChanges();
this.$pollSizeChanges();
}; };
(function() { (function() {
oop.implement(this, EventEmitter); oop.implement(this, EventEmitter);
this.EOF_CHAR = "\xB6"; //"&para;"; this.EOF_CHAR = "\xB6";
this.EOL_CHAR = "\xAC"; //"&not;"; this.EOL_CHAR_LF = "\xAC";
this.TAB_CHAR = "\u2192"; //"&rarr;" "\u21E5"; this.EOL_CHAR_CRLF = "\xa4";
this.SPACE_CHAR = "\xB7"; //"&middot;"; this.EOL_CHAR = this.EOL_CHAR_LF;
this.TAB_CHAR = "\u2192"; //"\u21E5";
this.SPACE_CHAR = "\xB7";
this.$padding = 0; this.$padding = 0;
this.$updateEolChar = function() {
var EOL_CHAR = this.session.doc.getNewLineCharacter() == "\n"
? this.EOL_CHAR_LF
: this.EOL_CHAR_CRLF;
if (this.EOL_CHAR != EOL_CHAR) {
this.EOL_CHAR = EOL_CHAR;
return true;
}
}
this.setPadding = function(padding) { this.setPadding = function(padding) {
this.$padding = padding; this.$padding = padding;
this.element.style.padding = "0 " + padding + "px"; this.element.style.padding = "0 " + padding + "px";
}; };
this.getLineHeight = function() { this.getLineHeight = function() {
return this.$characterSize.height || 0; return this.$fontMetrics.$characterSize.height || 0;
}; };
this.getCharacterWidth = function() { this.getCharacterWidth = function() {
return this.$characterSize.width || 0; return this.$fontMetrics.$characterSize.width || 0;
}; };
this.$setFontMetrics = function(measure) {
this.$fontMetrics = measure;
this.$fontMetrics.on("changeCharacterSize", function(e) {
this._signal("changeCharacterSize", e);
}.bind(this));
this.$pollSizeChanges();
}
this.checkForSizeChanges = function() { this.checkForSizeChanges = function() {
var size = this.$measureSizes(); this.$fontMetrics.checkForSizeChanges();
if (size && (this.$characterSize.width !== size.width || this.$characterSize.height !== size.height)) {
this.$measureNode.style.fontWeight = "bold";
var boldSize = this.$measureSizes();
this.$measureNode.style.fontWeight = "";
this.$characterSize = size;
this.allowBoldFonts = boldSize && boldSize.width === size.width && boldSize.height === size.height;
this._emit("changeCharacterSize", {data: size});
}
}; };
this.$pollSizeChanges = function() { this.$pollSizeChanges = function() {
var self = this; return this.$pollSizeChangesTimer = this.$fontMetrics.$pollSizeChanges();
this.$pollSizeChangesTimer = setInterval(function() {
self.checkForSizeChanges();
}, 500);
}; };
this.$fontStyles = {
fontFamily : 1,
fontSize : 1,
fontWeight : 1,
fontStyle : 1,
lineHeight : 1
};
this.$measureSizes = useragent.isIE || useragent.isOldGecko ? function() {
var n = 1000;
if (!this.$measureNode) {
var measureNode = this.$measureNode = dom.createElement("div");
var style = measureNode.style;
style.width = style.height = "auto";
style.left = style.top = (-n * 40) + "px";
style.visibility = "hidden";
style.position = "fixed";
style.overflow = "visible";
style.whiteSpace = "nowrap";
// in FF 3.6 monospace fonts can have a fixed sub pixel width.
// that's why we have to measure many characters
// Note: characterWidth can be a float!
measureNode.innerHTML = lang.stringRepeat("Xy", n);
if (this.element.ownerDocument.body) {
this.element.ownerDocument.body.appendChild(measureNode);
} else {
var container = this.element.parentNode;
while (!dom.hasCssClass(container, "ace_editor"))
container = container.parentNode;
container.appendChild(measureNode);
}
}
// Size and width can be null if the editor is not visible or
// detached from the document
if (!this.element.offsetWidth)
return null;
var style = this.$measureNode.style;
var computedStyle = dom.computedStyle(this.element);
for (var prop in this.$fontStyles)
style[prop] = computedStyle[prop];
var size = {
height: this.$measureNode.offsetHeight,
width: this.$measureNode.offsetWidth / (n * 2)
};
// Size and width can be null if the editor is not visible or
// detached from the document
if (size.width == 0 || size.height == 0)
return null;
return size;
}
: function() {
if (!this.$measureNode) {
var measureNode = this.$measureNode = dom.createElement("div");
var style = measureNode.style;
style.width = style.height = "auto";
style.left = style.top = -100 + "px";
style.visibility = "hidden";
style.position = "fixed";
style.overflow = "visible";
style.whiteSpace = "nowrap";
// fixes fractional fixed-width fonts; see http://git.io/CavZNw
measureNode.innerHTML = lang.stringRepeat("X", 100);
var container = this.element.parentNode;
while (container && !dom.hasCssClass(container, "ace_editor"))
container = container.parentNode;
if (!container)
return this.$measureNode = null;
container.appendChild(measureNode);
}
var rect = this.$measureNode.getBoundingClientRect();
var size = {
height: rect.height,
width: rect.width / 100
};
// Size and width can be null if the editor is not visible or
// detached from the document
if (size.width == 0 || size.height == 0)
return null;
return size;
};
this.setSession = function(session) { this.setSession = function(session) {
this.session = session; this.session = session;
this.$computeTabString(); this.$computeTabString();
@ -222,7 +126,7 @@ var Text = function(parentEl) {
var tabStr = this.$tabStrings = [0]; var tabStr = this.$tabStrings = [0];
for (var i = 1; i < tabSize + 1; i++) { for (var i = 1; i < tabSize + 1; i++) {
if (this.showInvisibles) { if (this.showInvisibles) {
tabStr.push("<span class='ace_invisible'>" tabStr.push("<span class='ace_invisible ace_invisible_tab'>"
+ this.TAB_CHAR + this.TAB_CHAR
+ lang.stringRepeat("\xa0", i - 1) + lang.stringRepeat("\xa0", i - 1)
+ "</span>"); + "</span>");
@ -233,8 +137,12 @@ var Text = function(parentEl) {
if (this.displayIndentGuides) { if (this.displayIndentGuides) {
this.$indentGuideRe = /\s\S| \t|\t |\s$/; this.$indentGuideRe = /\s\S| \t|\t |\s$/;
var className = "ace_indent-guide"; var className = "ace_indent-guide";
var spaceClass = "";
var tabClass = "";
if (this.showInvisibles) { if (this.showInvisibles) {
className += " ace_invisible"; className += " ace_invisible";
spaceClass = " ace_invisible_space";
tabClass = " ace_invisible_tab";
var spaceContent = lang.stringRepeat(this.SPACE_CHAR, this.tabSize); var spaceContent = lang.stringRepeat(this.SPACE_CHAR, this.tabSize);
var tabContent = this.TAB_CHAR + lang.stringRepeat("\xa0", this.tabSize - 1); var tabContent = this.TAB_CHAR + lang.stringRepeat("\xa0", this.tabSize - 1);
} else{ } else{
@ -242,8 +150,8 @@ var Text = function(parentEl) {
var tabContent = spaceContent; var tabContent = spaceContent;
} }
this.$tabStrings[" "] = "<span class='" + className + "'>" + spaceContent + "</span>"; this.$tabStrings[" "] = "<span class='" + className + spaceClass + "'>" + spaceContent + "</span>";
this.$tabStrings["\t"] = "<span class='" + className + "'>" + tabContent + "</span>"; this.$tabStrings["\t"] = "<span class='" + className + tabClass + "'>" + tabContent + "</span>";
} }
}; };
@ -417,7 +325,7 @@ var Text = function(parentEl) {
var replaceFunc = function(c, a, b, tabIdx, idx4) { var replaceFunc = function(c, a, b, tabIdx, idx4) {
if (a) { if (a) {
return self.showInvisibles ? return self.showInvisibles ?
"<span class='ace_invisible'>" + lang.stringRepeat(self.SPACE_CHAR, c.length) + "</span>" : "<span class='ace_invisible ace_invisible_space'>" + lang.stringRepeat(self.SPACE_CHAR, c.length) + "</span>" :
lang.stringRepeat("\xa0", c.length); lang.stringRepeat("\xa0", c.length);
} else if (c == "&") { } else if (c == "&") {
return "&#38;"; return "&#38;";
@ -429,14 +337,14 @@ var Text = function(parentEl) {
return self.$tabStrings[tabSize]; return self.$tabStrings[tabSize];
} else if (c == "\u3000") { } else if (c == "\u3000") {
// U+3000 is both invisible AND full-width, so must be handled uniquely // U+3000 is both invisible AND full-width, so must be handled uniquely
var classToUse = self.showInvisibles ? "ace_cjk ace_invisible" : "ace_cjk"; var classToUse = self.showInvisibles ? "ace_cjk ace_invisible ace_invisible_space" : "ace_cjk";
var space = self.showInvisibles ? self.SPACE_CHAR : ""; var space = self.showInvisibles ? self.SPACE_CHAR : "";
screenColumn += 1; screenColumn += 1;
return "<span class='" + classToUse + "' style='width:" + return "<span class='" + classToUse + "' style='width:" +
(self.config.characterWidth * 2) + (self.config.characterWidth * 2) +
"px'>" + space + "</span>"; "px'>" + space + "</span>";
} else if (b) { } else if (b) {
return "<span class='ace_invisible ace_invalid'>" + self.SPACE_CHAR + "</span>"; return "<span class='ace_invisible ace_invisible_space ace_invalid'>" + self.SPACE_CHAR + "</span>";
} else { } else {
screenColumn += 1; screenColumn += 1;
return "<span class='ace_cjk' style='width:" + return "<span class='ace_cjk' style='width:" +
@ -573,7 +481,7 @@ var Text = function(parentEl) {
row = foldLine.end.row row = foldLine.end.row
stringBuilder.push( stringBuilder.push(
"<span class='ace_invisible'>", "<span class='ace_invisible ace_invisible_eol'>",
row == this.session.getLength() - 1 ? this.EOF_CHAR : this.EOL_CHAR, row == this.session.getLength() - 1 ? this.EOF_CHAR : this.EOL_CHAR,
"</span>" "</span>"
); );

View file

@ -81,14 +81,14 @@ module.exports = {
this.textLayer.$renderLine(stringBuilder, 0, true); this.textLayer.$renderLine(stringBuilder, 0, true);
assert.equal( assert.equal(
stringBuilder.join(""), stringBuilder.join(""),
"<span class='ace_cjk ace_invisible' style='width:20px'>" + this.textLayer.SPACE_CHAR + "</span>" "<span class='ace_cjk ace_invisible ace_invisible_space' style='width:20px'>" + this.textLayer.SPACE_CHAR + "</span>"
+ "<span class='ace_invisible'>\xB6</span>" + "<span class='ace_invisible ace_invisible_eol'>\xB6</span>"
); );
}, },
"test rendering of indent guides" : function() { "test rendering of indent guides" : function() {
var textLayer = this.textLayer var textLayer = this.textLayer
var EOL = "<span class='ace_invisible'>" + textLayer.EOL_CHAR + "</span>"; var EOL = "<span class='ace_invisible ace_invisible_eol'>" + textLayer.EOL_CHAR + "</span>";
var SPACE = function(i) {return Array(i+1).join("\xa0")} var SPACE = function(i) {return Array(i+1).join("\xa0")}
var DOT = function(i) {return Array(i+1).join(textLayer.SPACE_CHAR)} var DOT = function(i) {return Array(i+1).join(textLayer.SPACE_CHAR)}
var TAB = function(i) {return textLayer.TAB_CHAR + SPACE(i-1)} var TAB = function(i) {return textLayer.TAB_CHAR + SPACE(i-1)}
@ -108,13 +108,13 @@ module.exports = {
]); ]);
this.textLayer.setShowInvisibles(true); this.textLayer.setShowInvisibles(true);
testRender([ testRender([
"<span class='ace_indent-guide ace_invisible'>" + DOT(4) + "</span><span class='ace_invisible'>" + DOT(2) + "</span>" + EOL, "<span class='ace_indent-guide ace_invisible ace_invisible_space'>" + DOT(4) + "</span><span class='ace_invisible ace_invisible_space'>" + DOT(2) + "</span>" + EOL,
"<span class='ace_indent-guide ace_invisible'>" + TAB(4) + "</span><span class='ace_invisible'>" + TAB(4) + "</span><span class='ace_identifier'>f</span>" + EOL, "<span class='ace_indent-guide ace_invisible ace_invisible_tab'>" + TAB(4) + "</span><span class='ace_invisible ace_invisible_tab'>" + TAB(4) + "</span><span class='ace_identifier'>f</span>" + EOL,
]); ]);
this.textLayer.setDisplayIndentGuides(false); this.textLayer.setDisplayIndentGuides(false);
testRender([ testRender([
"<span class='ace_invisible'>" + DOT(6) + "</span>" + EOL, "<span class='ace_invisible ace_invisible_space'>" + DOT(6) + "</span>" + EOL,
"<span class='ace_invisible'>" + TAB(4) + "</span><span class='ace_invisible'>" + TAB(4) + "</span><span class='ace_identifier'>f</span>" + EOL "<span class='ace_invisible ace_invisible_tab'>" + TAB(4) + "</span><span class='ace_invisible ace_invisible_tab'>" + TAB(4) + "</span><span class='ace_identifier'>f</span>" + EOL
]); ]);
} }
}; };

View file

@ -33,7 +33,6 @@ define(function(require, exports, module) {
var keys = require("./keys"); var keys = require("./keys");
var useragent = require("./useragent"); var useragent = require("./useragent");
var dom = require("./dom");
exports.addListener = function(elem, type, callback) { exports.addListener = function(elem, type, callback) {
if (elem.addEventListener) { if (elem.addEventListener) {
@ -170,7 +169,7 @@ exports.addMultiMouseDownListener = function(el, timeouts, eventHandler, callbac
}; };
exports.addListener(el, "mousedown", function(e) { exports.addListener(el, "mousedown", function(e) {
if (exports.getButton(e) != 0) { if (exports.getButton(e) !== 0) {
clicks = 0; clicks = 0;
} else if (e.detail > 1) { } else if (e.detail > 1) {
clicks++; clicks++;
@ -210,22 +209,27 @@ exports.addMultiMouseDownListener = function(el, timeouts, eventHandler, callbac
} }
}; };
function normalizeCommandKeys(callback, e, keyCode) { var getModifierHash = useragent.isMac && useragent.isOpera && !("KeyboardEvent" in window)
var hashId = 0; ? function(e) {
if ((useragent.isOpera && !("KeyboardEvent" in window)) && useragent.isMac) { return 0 | (e.metaKey ? 1 : 0) | (e.altKey ? 2 : 0) | (e.shiftKey ? 4 : 0) | (e.ctrlKey ? 8 : 0);
hashId = 0 | (e.metaKey ? 1 : 0) | (e.altKey ? 2 : 0)
| (e.shiftKey ? 4 : 0) | (e.ctrlKey ? 8 : 0);
} else {
hashId = 0 | (e.ctrlKey ? 1 : 0) | (e.altKey ? 2 : 0)
| (e.shiftKey ? 4 : 0) | (e.metaKey ? 8 : 0);
} }
: function(e) {
return 0 | (e.ctrlKey ? 1 : 0) | (e.altKey ? 2 : 0) | (e.shiftKey ? 4 : 0) | (e.metaKey ? 8 : 0);
};
exports.getModifierString = function(e) {
return keys.KEY_MODS[getModifierHash(e)];
};
function normalizeCommandKeys(callback, e, keyCode) {
var hashId = getModifierHash(e);
if (!useragent.isMac && pressedKeys) { if (!useragent.isMac && pressedKeys) {
if (pressedKeys[91] || pressedKeys[92]) if (pressedKeys[91] || pressedKeys[92])
hashId |= 8; hashId |= 8;
if (pressedKeys.altGr) { if (pressedKeys.altGr) {
if ((3 & hashId) != 3) if ((3 & hashId) != 3)
pressedKeys.altGr = 0 pressedKeys.altGr = 0;
else else
return; return;
} }
@ -267,12 +271,11 @@ function normalizeCommandKeys(callback, e, keyCode) {
if (!hashId && keyCode === 13) { if (!hashId && keyCode === 13) {
if (e.location || e.keyLocation === 3) { if (e.location || e.keyLocation === 3) {
callback(e, hashId, -keyCode) callback(e, hashId, -keyCode);
if (e.defaultPrevented) if (e.defaultPrevented)
return; return;
} }
} }
// If there is no hashId and the keyCode is not a function key, then // If there is no hashId and the keyCode is not a function key, then
// we don't call the callback as we don't handle a command key here // we don't call the callback as we don't handle a command key here
@ -281,8 +284,6 @@ function normalizeCommandKeys(callback, e, keyCode) {
return false; return false;
} }
return callback(e, hashId, keyCode); return callback(e, hashId, keyCode);
} }

View file

@ -102,8 +102,8 @@ var Keys = (function() {
73: 'i', 74: 'j', 75: 'k', 76: 'l', 77: 'm', 78: 'n', 79: 'o', 73: 'i', 74: 'j', 75: 'k', 76: 'l', 77: 'm', 78: 'n', 79: 'o',
80: 'p', 81: 'q', 82: 'r', 83: 's', 84: 't', 85: 'u', 86: 'v', 80: 'p', 81: 'q', 82: 'r', 83: 's', 84: 't', 85: 'u', 86: 'v',
87: 'w', 88: 'x', 89: 'y', 90: 'z', 107: '+', 109: '-', 110: '.', 87: 'w', 88: 'x', 89: 'y', 90: 'z', 107: '+', 109: '-', 110: '.',
188: ',', 190: '.', 191: '/', 192: '`', 219: '[', 220: '\\', 187: '=', 188: ',', 189: '-', 190: '.', 191: '/', 192: '`', 219: '[',
221: ']', 222: '\'' 220: '\\',221: ']', 222: '\'',
} }
}; };
@ -130,16 +130,25 @@ var Keys = (function() {
ret.enter = ret["return"]; ret.enter = ret["return"];
ret.escape = ret.esc; ret.escape = ret.esc;
ret.del = ret["delete"]; ret.del = ret["delete"];
// workaround for firefox bug // workaround for firefox bug
ret[173] = '-'; ret[173] = '-';
(function() {
var mods = ["cmd", "ctrl", "alt", "shift"];
for (var i = Math.pow(2, mods.length); i--;) {
ret.KEY_MODS[i] = mods.filter(function(x) {
return i & ret.KEY_MODS[x];
}).join("-") + "-";
}
})();
return ret; return ret;
})(); })();
oop.mixin(exports, Keys); oop.mixin(exports, Keys);
exports.keyCodeToString = function(keyCode) { exports.keyCodeToString = function(keyCode) {
return (Keys[keyCode] || String.fromCharCode(keyCode)).toLowerCase(); return (Keys[keyCode] || String.fromCharCode(keyCode)).toLowerCase();
} };
}); });

View file

@ -38,4 +38,14 @@ exports.loadScript = function(path, callback) {
}; };
}; };
/*
* Convert a url into a fully qualified absolute URL
* This function does not work in IE6
*/
exports.qualifyURL = function(url) {
var a = document.createElement('a');
a.href = url;
return a.href;
}
}); });

View file

@ -76,7 +76,7 @@ exports.isLinux = (os == "linux");
// Windows Store JavaScript apps (aka Metro apps written in HTML5 and JavaScript) do not use the "Microsoft Internet Explorer" string in their user agent, but "MSAppHost" instead. // Windows Store JavaScript apps (aka Metro apps written in HTML5 and JavaScript) do not use the "Microsoft Internet Explorer" string in their user agent, but "MSAppHost" instead.
exports.isIE = exports.isIE =
(navigator.appName == "Microsoft Internet Explorer" || navigator.appName.indexOf("MSAppHost") >= 0) (navigator.appName == "Microsoft Internet Explorer" || navigator.appName.indexOf("MSAppHost") >= 0)
&& parseFloat(navigator.userAgent.match(/MSIE ([0-9]+[\.0-9]+)/)[1]); && parseFloat(navigator.userAgent.match(/(?:Trident\/[0-9]+[\.0-9]+;.*rv:|MSIE )([0-9]+[\.0-9]+)/)[1]);
exports.isOldIE = exports.isIE && exports.isIE < 9; exports.isOldIE = exports.isIE && exports.isIE < 9;

View file

@ -46,7 +46,7 @@ function generateTestData() {
var tokenizer = new Mode().getTokenizer(); var tokenizer = new Mode().getTokenizer();
var state = "start"; var state = "start";
var data = text.split(/\n|\r|\r\n/).map(function(line) { var data = text.split(/\r\n|\r|\n/).map(function(line) {
var data = tokenizer.getLineTokens(line, state); var data = tokenizer.getLineTokens(line, state);
var tmp = []; var tmp = [];
tmp.push(JSON.stringify(data.state)); tmp.push(JSON.stringify(data.state));

View file

@ -1,26 +1,26 @@
[[ [[
"start", "start",
["comment","<!--- hello world --->"] ["comment.xml","<!--- hello world --->"]
],[ ],[
"start" "start"
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","cfset"], ["meta.tag.tag-name.xml","cfset"],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","welcome"], ["entity.other.attribute-name.xml","welcome"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"Hello World!\""], ["string.attribute-value.xml","\"Hello World!\""],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start" "start"
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","cfoutput"], ["meta.tag.tag-name.xml","cfoutput"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["text","#welcome#"], ["text.xml","#welcome#"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","cfoutput"], ["meta.tag.tag-name.xml","cfoutput"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
]] ]]

View file

@ -1,56 +1,56 @@
[[ [[
"start", "start",
["text","tokenize Curly template"], ["text.xml","tokenize Curly template"],
["variable","{{"], ["variable","{{"],
["text","test"], ["text","test"],
["variable","}}"] ["variable","}}"]
],[ ],[
"start", "start",
["text","tokenize embedded script"] ["text.xml","tokenize embedded script"]
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.script","script"], ["meta.tag.script.tag-name.xml","script"],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","a"], ["entity.other.attribute-name.xml","a"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","'a'"], ["string.attribute-value.xml","'a'"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["storage.type","var"], ["storage.type","var"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name.script","script"], ["meta.tag.script.tag-name.xml","script"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["text","'123'"] ["text.xml","'123'"]
],[ ],[
"start", "start",
["text","tokenize multiline attribute value with double quotes"] ["text.xml","tokenize multiline attribute value with double quotes"]
],[ ],[
["qqstring_inner","start_tag_stuff"], ["string.attribute-value.xml0","tag_stuff"],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.anchor","a"], ["meta.tag.anchor.tag-name.xml","a"],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","href"], ["entity.other.attribute-name.xml","href"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"abc{{xyz}}"] ["string.attribute-value.xml","\"abc{{xyz}}"]
],[ ],[
"start", "start",
["string","def\""], ["string.attribute-value.xml","def\""],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text","tokenize multiline attribute value with single quotes"] ["text.xml","tokenize multiline attribute value with single quotes"]
],[ ],[
["qstring_inner","start_tag_stuff"], ["string.attribute-value.xml","tag_stuff"],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.anchor","a"], ["meta.tag.anchor.tag-name.xml","a"],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","href"], ["entity.other.attribute-name.xml","href"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","'abc"] ["string.attribute-value.xml","'abc"]
],[ ],[
"start", "start",
["string","def\\\"'"], ["string.attribute-value.xml","def\\\"'"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start" "start"
]] ]]

View file

@ -1,90 +1,90 @@
[[ [[
"start", "start",
["punctuation.doctype.begin","<!"], ["xml-pe.doctype.xml","<!"],
["meta.tag.doctype","DOCTYPE"], ["xml-pe.doctype.xml","DOCTYPE"],
["text"," "], ["text.whitespace.xml"," "],
["xml-pe","html"], ["xml-pe.xml","html"],
["punctuation.doctype.end",">"] ["xml-pe.doctype.xml",">"]
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","html"], ["meta.tag.tag-name.xml","html"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","head"], ["meta.tag.tag-name.xml","head"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","title"], ["meta.tag.tag-name.xml","title"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["text","Cloud9 Rocks!"], ["text.xml","Cloud9 Rocks!"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","title"], ["meta.tag.tag-name.xml","title"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","head"], ["meta.tag.tag-name.xml","head"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","body"], ["meta.tag.tag-name.xml","body"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start" "start"
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.table","table"], ["meta.tag.table.tag-name.xml","table"],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","class"], ["entity.other.attribute-name.xml","class"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"table\""], ["string.attribute-value.xml","\"table\""],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.table","tr"], ["meta.tag.table.tag-name.xml","tr"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.table","th"], ["meta.tag.table.tag-name.xml","th"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["text","Name"], ["text.xml","Name"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name.table","th"], ["meta.tag.table.tag-name.xml","th"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.table","th"], ["meta.tag.table.tag-name.xml","th"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["text","Size"], ["text.xml","Size"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name.table","th"], ["meta.tag.table.tag-name.xml","th"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name.table","tr"], ["meta.tag.table.tag-name.xml","tr"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["markup.list.meta.tag","<%"], ["markup.list.meta.tag","<%"],
["text"," "], ["text"," "],
["keyword","if"], ["keyword","if"],
@ -99,51 +99,51 @@
["markup.list.meta.tag","%>"] ["markup.list.meta.tag","%>"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.table","tr"], ["meta.tag.table.tag-name.xml","tr"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.table","td"], ["meta.tag.table.tag-name.xml","td"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.anchor","a"], ["meta.tag.anchor.tag-name.xml","a"],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","href"], ["entity.other.attribute-name.xml","href"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"..\""], ["string.attribute-value.xml","\"..\""],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["text",".."], ["text.xml",".."],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name.anchor","a"], ["meta.tag.anchor.tag-name.xml","a"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name.table","td"], ["meta.tag.table.tag-name.xml","td"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.table","td"], ["meta.tag.table.tag-name.xml","td"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name.table","td"], ["meta.tag.table.tag-name.xml","td"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name.table","td"], ["meta.tag.table.tag-name.xml","td"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name.table","tr"], ["meta.tag.table.tag-name.xml","tr"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["markup.list.meta.tag","<%"], ["markup.list.meta.tag","<%"],
["text"," "], ["text"," "],
["paren.rparen","}"], ["paren.rparen","}"],
@ -151,7 +151,7 @@
["markup.list.meta.tag","%>"] ["markup.list.meta.tag","%>"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["markup.list.meta.tag","<%"], ["markup.list.meta.tag","<%"],
["text"," "], ["text"," "],
["identifier","entries"], ["identifier","entries"],
@ -168,25 +168,25 @@
["markup.list.meta.tag","%>"] ["markup.list.meta.tag","%>"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.table","tr"], ["meta.tag.table.tag-name.xml","tr"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.table","td"], ["meta.tag.table.tag-name.xml","td"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","span"], ["meta.tag.tag-name.xml","span"],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","class"], ["entity.other.attribute-name.xml","class"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"glyphicon "], ["string.attribute-value.xml","\"glyphicon "],
["markup.list.meta.tag","<%="], ["markup.list.meta.tag","<%="],
["text"," "], ["text"," "],
["identifier","entry"], ["identifier","entry"],
@ -204,20 +204,20 @@
["text"," "], ["text"," "],
["string","'file'"], ["string","'file'"],
["markup.list.meta.tag","%>"], ["markup.list.meta.tag","%>"],
["string","\""], ["string.attribute-value.xml","\""],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","span"], ["meta.tag.tag-name.xml","span"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.anchor","a"], ["meta.tag.anchor.tag-name.xml","a"],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","href"], ["entity.other.attribute-name.xml","href"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\""], ["string.attribute-value.xml","\""],
["markup.list.meta.tag","<%="], ["markup.list.meta.tag","<%="],
["text"," "], ["text"," "],
["identifier","entry"], ["identifier","entry"],
@ -225,8 +225,8 @@
["identifier","name"], ["identifier","name"],
["text"," "], ["text"," "],
["markup.list.meta.tag","%>"], ["markup.list.meta.tag","%>"],
["string","\""], ["string.attribute-value.xml","\""],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["markup.list.meta.tag","<%="], ["markup.list.meta.tag","<%="],
["text"," "], ["text"," "],
["identifier","entry"], ["identifier","entry"],
@ -234,21 +234,21 @@
["identifier","name"], ["identifier","name"],
["text"," "], ["text"," "],
["markup.list.meta.tag","%>"], ["markup.list.meta.tag","%>"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name.anchor","a"], ["meta.tag.anchor.tag-name.xml","a"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name.table","td"], ["meta.tag.table.tag-name.xml","td"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.table","td"], ["meta.tag.table.tag-name.xml","td"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["markup.list.meta.tag","<%="], ["markup.list.meta.tag","<%="],
["text"," "], ["text"," "],
["identifier","entry"], ["identifier","entry"],
@ -256,18 +256,18 @@
["identifier","size"], ["identifier","size"],
["text"," "], ["text"," "],
["markup.list.meta.tag","%>"], ["markup.list.meta.tag","%>"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name.table","td"], ["meta.tag.table.tag-name.xml","td"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name.table","tr"], ["meta.tag.table.tag-name.xml","tr"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["markup.list.meta.tag","<%"], ["markup.list.meta.tag","<%"],
["text"," "], ["text"," "],
["paren.rparen","})"], ["paren.rparen","})"],
@ -275,22 +275,22 @@
["markup.list.meta.tag","%>"] ["markup.list.meta.tag","%>"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name.table","table"], ["meta.tag.table.tag-name.xml","table"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "] ["text.xml"," "]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","body"], ["meta.tag.tag-name.xml","body"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","html"], ["meta.tag.tag-name.xml","html"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
]] ]]

View file

@ -43,110 +43,110 @@
"start" "start"
],[ ],[
"start", "start",
["punctuation.doctype.begin","<!"], ["xml-pe.doctype.xml","<!"],
["meta.tag.doctype","DOCTYPE"], ["xml-pe.doctype.xml","DOCTYPE"],
["text"," "], ["text.whitespace.xml"," "],
["xml-pe","html"], ["xml-pe.xml","html"],
["punctuation.doctype.end",">"] ["xml-pe.doctype.xml",">"]
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","html"], ["meta.tag.tag-name.xml","html"],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","lang"], ["entity.other.attribute-name.xml","lang"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"en-us\""], ["string.attribute-value.xml","\"en-us\""],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","head"], ["meta.tag.tag-name.xml","head"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","meta"], ["meta.tag.tag-name.xml","meta"],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","charset"], ["entity.other.attribute-name.xml","charset"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"utf-8\""], ["string.attribute-value.xml","\"utf-8\""],
["text"," "], ["text.tag-whitespace.xml"," "],
["meta.tag.punctuation.end","/>"] ["meta.tag.punctuation.tag-close.xml","/>"]
],[ ],[
"start", "start",
["text"," "] ["text.xml"," "]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","title"], ["meta.tag.tag-name.xml","title"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["string.interpolated","${"], ["string.interpolated","${"],
["variable","title"], ["variable","title"],
["keyword.operator","!"], ["keyword.operator","!"],
["string","\"FreeMarker\""], ["string","\"FreeMarker\""],
["string.interpolated","}"], ["string.interpolated","}"],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","title"], ["meta.tag.tag-name.xml","title"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","head"], ["meta.tag.tag-name.xml","head"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "] ["text.xml"," "]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","body"], ["meta.tag.tag-name.xml","body"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "] ["text.xml"," "]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","h1"], ["meta.tag.tag-name.xml","h1"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["text","Hello "], ["text.xml","Hello "],
["string.interpolated","${"], ["string.interpolated","${"],
["variable","name"], ["variable","name"],
["keyword.operator","!"], ["keyword.operator","!"],
["string","\"\""], ["string","\"\""],
["string.interpolated","}"], ["string.interpolated","}"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","h1"], ["meta.tag.tag-name.xml","h1"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "] ["text.xml"," "]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","p"], ["meta.tag.tag-name.xml","p"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["text","Today is: "], ["text.xml","Today is: "],
["string.interpolated","${"], ["string.interpolated","${"],
["language.variable",".now"], ["language.variable",".now"],
["support.function","?date"], ["support.function","?date"],
["string.interpolated","}"], ["string.interpolated","}"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","p"], ["meta.tag.tag-name.xml","p"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "] ["text.xml"," "]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["keyword.function","<#assign"], ["keyword.function","<#assign"],
["text"," "], ["text"," "],
["variable","x"], ["variable","x"],
@ -157,7 +157,7 @@
["keyword",">"] ["keyword",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["keyword.function","<#if"], ["keyword.function","<#if"],
["text"," "], ["text"," "],
["variable","x"], ["variable","x"],
@ -174,7 +174,7 @@
["text"," "], ["text"," "],
["constant.numeric","14"], ["constant.numeric","14"],
["keyword",">"], ["keyword",">"],
["text","x equals 13: "], ["text.xml","x equals 13: "],
["string.interpolated","${"], ["string.interpolated","${"],
["variable","x"], ["variable","x"],
["string.interpolated","}"], ["string.interpolated","}"],
@ -182,16 +182,16 @@
["keyword",">"] ["keyword",">"]
],[ ],[
"start", "start",
["text"," "] ["text.xml"," "]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","ul"], ["meta.tag.tag-name.xml","ul"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["keyword.function","<#list"], ["keyword.function","<#list"],
["text"," "], ["text"," "],
["variable","items"], ["variable","items"],
@ -202,14 +202,14 @@
["keyword",">"] ["keyword",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","li"], ["meta.tag.tag-name.xml","li"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["string.interpolated","${"], ["string.interpolated","${"],
["variable","item_index"], ["variable","item_index"],
["string.interpolated","}"], ["string.interpolated","}"],
["text",": "], ["text.xml",": "],
["string.interpolated","${"], ["string.interpolated","${"],
["variable","item.name"], ["variable","item.name"],
["keyword.operator","!"], ["keyword.operator","!"],
@ -223,26 +223,26 @@
["constant.numeric","0"], ["constant.numeric","0"],
["paren.rparen","]"], ["paren.rparen","]"],
["string.interpolated","}"], ["string.interpolated","}"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","li"], ["meta.tag.tag-name.xml","li"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["keyword.function","</#list"], ["keyword.function","</#list"],
["keyword",">"] ["keyword",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","ul"], ["meta.tag.tag-name.xml","ul"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "] ["text.xml"," "]
],[ ],[
"start", "start",
["text"," User directive: "], ["text.xml"," User directive: "],
["keyword.other","<@lib.function"], ["keyword.other","<@lib.function"],
["text"," "], ["text"," "],
["variable","attr1"], ["variable","attr1"],
@ -257,21 +257,21 @@
["keyword.operator","="], ["keyword.operator","="],
["constant.numeric","-42.12"], ["constant.numeric","-42.12"],
["keyword",">"], ["keyword",">"],
["text","Test"], ["text.xml","Test"],
["keyword.other","</@lib.function"], ["keyword.other","</@lib.function"],
["keyword",">"] ["keyword",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["keyword.other","<@anotherOne"], ["keyword.other","<@anotherOne"],
["text"," "], ["text"," "],
["keyword","/>"] ["keyword","/>"]
],[ ],[
"start", "start",
["text"," "] ["text.xml"," "]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["keyword.function","<#if"], ["keyword.function","<#if"],
["text"," "], ["text"," "],
["variable","variable"], ["variable","variable"],
@ -279,10 +279,10 @@
["keyword",">"] ["keyword",">"]
],[ ],[
"start", "start",
["text"," Deprecated"] ["text.xml"," Deprecated"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["keyword.function","<#elseif"], ["keyword.function","<#elseif"],
["text"," "], ["text"," "],
["variable","variable"], ["variable","variable"],
@ -290,52 +290,52 @@
["keyword",">"] ["keyword",">"]
],[ ],[
"start", "start",
["text"," Better"] ["text.xml"," Better"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["keyword.function","<#else"], ["keyword.function","<#else"],
["keyword",">"] ["keyword",">"]
],[ ],[
"start", "start",
["text"," Default"] ["text.xml"," Default"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["keyword.function","</#if"], ["keyword.function","</#if"],
["keyword",">"] ["keyword",">"]
],[ ],[
"start", "start",
["text"," "] ["text.xml"," "]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.image","img"], ["meta.tag.image.tag-name.xml","img"],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","src"], ["entity.other.attribute-name.xml","src"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"images/"], ["string.attribute-value.xml","\"images/"],
["string.interpolated","${"], ["string.interpolated","${"],
["variable","user.id"], ["variable","user.id"],
["string.interpolated","}"], ["string.interpolated","}"],
["string",".png\""], ["string.attribute-value.xml",".png\""],
["text"," "], ["text.tag-whitespace.xml"," "],
["meta.tag.punctuation.end","/>"] ["meta.tag.punctuation.tag-close.xml","/>"]
],[ ],[
"start", "start",
["text"," "] ["text.xml"," "]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","body"], ["meta.tag.tag-name.xml","body"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","html"], ["meta.tag.tag-name.xml","html"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start" "start"
]] ]]

View file

@ -7,16 +7,16 @@
"start" "start"
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","div"], ["meta.tag.tag-name.xml","div"],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","id"], ["entity.other.attribute-name.xml","id"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"comments\""], ["string.attribute-value.xml","\"comments\""],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["storage.type.start","{{#"], ["storage.type.start","{{#"],
["variable.parameter","each"], ["variable.parameter","each"],
["text"," "], ["text"," "],
@ -24,58 +24,58 @@
["storage.type.end","}}"] ["storage.type.end","}}"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","h2"], ["meta.tag.tag-name.xml","h2"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.anchor","a"], ["meta.tag.anchor.tag-name.xml","a"],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","href"], ["entity.other.attribute-name.xml","href"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"/posts/"], ["string.attribute-value.xml","\"/posts/"],
["storage.type.start","{{"], ["storage.type.start","{{"],
["text","../"], ["text","../"],
["variable.parameter","permalink"], ["variable.parameter","permalink"],
["storage.type.end","}}"], ["storage.type.end","}}"],
["string","#"], ["string.attribute-value.xml","#"],
["storage.type.start","{{"], ["storage.type.start","{{"],
["variable.parameter","id"], ["variable.parameter","id"],
["storage.type.end","}}"], ["storage.type.end","}}"],
["string","\""], ["string.attribute-value.xml","\""],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["storage.type.start","{{"], ["storage.type.start","{{"],
["variable.parameter","title"], ["variable.parameter","title"],
["storage.type.end","}}"], ["storage.type.end","}}"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name.anchor","a"], ["meta.tag.anchor.tag-name.xml","a"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","h2"], ["meta.tag.tag-name.xml","h2"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","div"], ["meta.tag.tag-name.xml","div"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["storage.type.start","{{"], ["storage.type.start","{{"],
["variable.parameter","body"], ["variable.parameter","body"],
["storage.type.end","}}"], ["storage.type.end","}}"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","div"], ["meta.tag.tag-name.xml","div"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["storage.type.start","{{/"], ["storage.type.start","{{/"],
["variable.parameter","each"], ["variable.parameter","each"],
["storage.type.end","}}"] ["storage.type.end","}}"]
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","div"], ["meta.tag.tag-name.xml","div"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start" "start"
]] ]]

View file

@ -1,51 +1,51 @@
[[ [[
"start", "start",
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","html"], ["meta.tag.tag-name.xml","html"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.script","script"], ["meta.tag.script.tag-name.xml","script"],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","a"], ["entity.other.attribute-name.xml","a"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","'a'"], ["string.attribute-value.xml","'a'"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["storage.type","var"], ["storage.type","var"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name.script","script"], ["meta.tag.script.tag-name.xml","script"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["text","'123'"] ["text.xml","'123'"]
],[ ],[
["qqstring_inner","start_tag_stuff"], ["string.attribute-value.xml0","tag_stuff"],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.anchor","a"], ["meta.tag.anchor.tag-name.xml","a"],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","href"], ["entity.other.attribute-name.xml","href"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"abc"] ["string.attribute-value.xml","\"abc"]
],[ ],[
"start", "start",
["string"," def\""], ["string.attribute-value.xml"," def\""],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
["qstring_inner","start_tag_stuff"], ["string.attribute-value.xml","tag_stuff"],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.anchor","a"], ["meta.tag.anchor.tag-name.xml","a"],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","href"], ["entity.other.attribute-name.xml","href"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","'abc"] ["string.attribute-value.xml","'abc"]
],[ ],[
"start", "start",
["string","def\\'"], ["string.attribute-value.xml","def\\'"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start" "start"
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","html"], ["meta.tag.tag-name.xml","html"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
]] ]]

View file

@ -1,82 +1,82 @@
[[ [[
"start", "start",
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","h1"], ["meta.tag.tag-name.xml","h1"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["text","Listing Books"], ["text.xml","Listing Books"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","h1"], ["meta.tag.tag-name.xml","h1"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "] ["text.xml"," "]
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.table","table"], ["meta.tag.table.tag-name.xml","table"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.table","tr"], ["meta.tag.table.tag-name.xml","tr"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.table","th"], ["meta.tag.table.tag-name.xml","th"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["text","Title"], ["text.xml","Title"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name.table","th"], ["meta.tag.table.tag-name.xml","th"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.table","th"], ["meta.tag.table.tag-name.xml","th"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["text","Summary"], ["text.xml","Summary"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name.table","th"], ["meta.tag.table.tag-name.xml","th"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.table","th"], ["meta.tag.table.tag-name.xml","th"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name.table","th"], ["meta.tag.table.tag-name.xml","th"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.table","th"], ["meta.tag.table.tag-name.xml","th"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name.table","th"], ["meta.tag.table.tag-name.xml","th"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.table","th"], ["meta.tag.table.tag-name.xml","th"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name.table","th"], ["meta.tag.table.tag-name.xml","th"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name.table","tr"], ["meta.tag.table.tag-name.xml","tr"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "] ["text.xml"," "]
],[ ],[
"start", "start",
["support.ruby_tag","<%"], ["support.ruby_tag","<%"],
@ -92,22 +92,22 @@
["support.ruby_tag","%>"] ["support.ruby_tag","%>"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.table","tr"], ["meta.tag.table.tag-name.xml","tr"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["comment.start.erb","<%#"], ["comment.start.erb","<%#"],
["comment"," comment "], ["comment"," comment "],
["comment.end.erb","%>"] ["comment.end.erb","%>"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.table","td"], ["meta.tag.table.tag-name.xml","td"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["support.ruby_tag","<%="], ["support.ruby_tag","<%="],
["text"," "], ["text"," "],
["identifier","book"], ["identifier","book"],
@ -115,15 +115,15 @@
["identifier","title"], ["identifier","title"],
["text"," "], ["text"," "],
["support.ruby_tag","%>"], ["support.ruby_tag","%>"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name.table","td"], ["meta.tag.table.tag-name.xml","td"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.table","td"], ["meta.tag.table.tag-name.xml","td"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["support.ruby_tag","<%="], ["support.ruby_tag","<%="],
["text"," "], ["text"," "],
["identifier","book"], ["identifier","book"],
@ -131,15 +131,15 @@
["identifier","content"], ["identifier","content"],
["text"," "], ["text"," "],
["support.ruby_tag","%>"], ["support.ruby_tag","%>"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name.table","td"], ["meta.tag.table.tag-name.xml","td"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.table","td"], ["meta.tag.table.tag-name.xml","td"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["support.ruby_tag","<%="], ["support.ruby_tag","<%="],
["text"," "], ["text"," "],
["support.function","link_to"], ["support.function","link_to"],
@ -149,15 +149,15 @@
["identifier","book"], ["identifier","book"],
["text"," "], ["text"," "],
["support.ruby_tag","%>"], ["support.ruby_tag","%>"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name.table","td"], ["meta.tag.table.tag-name.xml","td"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.table","td"], ["meta.tag.table.tag-name.xml","td"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["support.ruby_tag","<%="], ["support.ruby_tag","<%="],
["text"," "], ["text"," "],
["support.function","link_to"], ["support.function","link_to"],
@ -170,15 +170,15 @@
["paren.rparen",")"], ["paren.rparen",")"],
["text"," "], ["text"," "],
["support.ruby_tag","%>"], ["support.ruby_tag","%>"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name.table","td"], ["meta.tag.table.tag-name.xml","td"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.table","td"], ["meta.tag.table.tag-name.xml","td"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["support.ruby_tag","<%="], ["support.ruby_tag","<%="],
["text"," "], ["text"," "],
["support.function","link_to"], ["support.function","link_to"],
@ -200,15 +200,15 @@
["constant.other.symbol.ruby",":delete"], ["constant.other.symbol.ruby",":delete"],
["text"," "], ["text"," "],
["support.ruby_tag","%>"], ["support.ruby_tag","%>"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name.table","td"], ["meta.tag.table.tag-name.xml","td"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name.table","tr"], ["meta.tag.table.tag-name.xml","tr"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["support.ruby_tag","<%"], ["support.ruby_tag","<%"],
@ -218,21 +218,21 @@
["support.ruby_tag","%>"] ["support.ruby_tag","%>"]
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name.table","table"], ["meta.tag.table.tag-name.xml","table"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "] ["text.xml"," "]
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","br"], ["meta.tag.tag-name.xml","br"],
["text"," "], ["text.tag-whitespace.xml"," "],
["meta.tag.punctuation.end","/>"] ["meta.tag.punctuation.tag-close.xml","/>"]
],[ ],[
"start", "start",
["text"," "] ["text.xml"," "]
],[ ],[
"start", "start",
["support.ruby_tag","<%="], ["support.ruby_tag","<%="],

View file

@ -1,19 +1,19 @@
[[ [[
"start", "start",
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","html"], ["meta.tag.tag-name.xml","html"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","body"], ["meta.tag.tag-name.xml","body"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"js-start", "js-start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.script","script"], ["meta.tag.script.tag-name.xml","script"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"js-start", "js-start",
["text"," "], ["text"," "],
@ -40,15 +40,15 @@
],[ ],[
"start", "start",
["text"," "], ["text"," "],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name.script","script"], ["meta.tag.script.tag-name.xml","script"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"css-start", "css-start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.style","style"], ["meta.tag.style.tag-name.xml","style"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
["css-ruleset","css-start"], ["css-ruleset","css-start"],
["text"," "], ["text"," "],
@ -69,20 +69,20 @@
],[ ],[
"start", "start",
["text"," "], ["text"," "],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name.style","style"], ["meta.tag.style.tag-name.xml","style"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start" "start"
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","p"], ["meta.tag.tag-name.xml","p"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," Today's date: "], ["text.xml"," Today's date: "],
["meta.tag","<%"], ["meta.tag","<%"],
["keyword.operator","="], ["keyword.operator","="],
["text"," "], ["text"," "],
@ -103,13 +103,13 @@
["meta.tag","%>"] ["meta.tag","%>"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","p"], ["meta.tag.tag-name.xml","p"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag","<%"], ["meta.tag","<%"],
["keyword.operator","!"], ["keyword.operator","!"],
["text"," "], ["text"," "],
@ -124,7 +124,7 @@
["meta.tag","%>"] ["meta.tag","%>"]
],[ ],[
"jsp-start", "jsp-start",
["text"," "], ["text.xml"," "],
["meta.tag","<jsp:declaration>"] ["meta.tag","<jsp:declaration>"]
],[ ],[
"jsp-start", "jsp-start",
@ -145,11 +145,11 @@
"start" "start"
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["comment","<%-- This is JSP comment --%>"] ["comment","<%-- This is JSP comment --%>"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag","<%@"], ["meta.tag","<%@"],
["text"," "], ["text"," "],
["identifier","directive"], ["identifier","directive"],
@ -163,161 +163,161 @@
"start" "start"
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","h2"], ["meta.tag.tag-name.xml","h2"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["text","Select Languages:"], ["text.xml","Select Languages:"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","h2"], ["meta.tag.tag-name.xml","h2"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start" "start"
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.form","form"], ["meta.tag.form.tag-name.xml","form"],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","ACTION"], ["entity.other.attribute-name.xml","ACTION"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"jspCheckBox.jsp\""], ["string.attribute-value.xml","\"jspCheckBox.jsp\""],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.form","input"], ["meta.tag.form.tag-name.xml","input"],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","type"], ["entity.other.attribute-name.xml","type"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"checkbox\""], ["string.attribute-value.xml","\"checkbox\""],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","name"], ["entity.other.attribute-name.xml","name"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"id\""], ["string.attribute-value.xml","\"id\""],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","value"], ["entity.other.attribute-name.xml","value"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"Java\""], ["string.attribute-value.xml","\"Java\""],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["text"," Java"], ["text.xml"," Java"],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","BR"], ["meta.tag.tag-name.xml","BR"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.form","input"], ["meta.tag.form.tag-name.xml","input"],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","type"], ["entity.other.attribute-name.xml","type"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"checkbox\""], ["string.attribute-value.xml","\"checkbox\""],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","name"], ["entity.other.attribute-name.xml","name"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"id\""], ["string.attribute-value.xml","\"id\""],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","value"], ["entity.other.attribute-name.xml","value"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\".NET\""], ["string.attribute-value.xml","\".NET\""],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["text"," .NET"], ["text.xml"," .NET"],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","BR"], ["meta.tag.tag-name.xml","BR"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.form","input"], ["meta.tag.form.tag-name.xml","input"],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","type"], ["entity.other.attribute-name.xml","type"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"checkbox\""], ["string.attribute-value.xml","\"checkbox\""],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","name"], ["entity.other.attribute-name.xml","name"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"id\""], ["string.attribute-value.xml","\"id\""],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","value"], ["entity.other.attribute-name.xml","value"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"PHP\""], ["string.attribute-value.xml","\"PHP\""],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["text"," PHP"], ["text.xml"," PHP"],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","BR"], ["meta.tag.tag-name.xml","BR"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.form","input"], ["meta.tag.form.tag-name.xml","input"],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","type"], ["entity.other.attribute-name.xml","type"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"checkbox\""], ["string.attribute-value.xml","\"checkbox\""],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","name"], ["entity.other.attribute-name.xml","name"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"id\""], ["string.attribute-value.xml","\"id\""],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","value"], ["entity.other.attribute-name.xml","value"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"C/C++\""], ["string.attribute-value.xml","\"C/C++\""],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["text"," C/C++"], ["text.xml"," C/C++"],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","BR"], ["meta.tag.tag-name.xml","BR"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.form","input"], ["meta.tag.form.tag-name.xml","input"],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","type"], ["entity.other.attribute-name.xml","type"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"checkbox\""], ["string.attribute-value.xml","\"checkbox\""],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","name"], ["entity.other.attribute-name.xml","name"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"id\""], ["string.attribute-value.xml","\"id\""],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","value"], ["entity.other.attribute-name.xml","value"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"PERL\""], ["string.attribute-value.xml","\"PERL\""],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["text"," PERL "], ["text.xml"," PERL "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","BR"], ["meta.tag.tag-name.xml","BR"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.form","input"], ["meta.tag.form.tag-name.xml","input"],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","type"], ["entity.other.attribute-name.xml","type"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"submit\""], ["string.attribute-value.xml","\"submit\""],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","value"], ["entity.other.attribute-name.xml","value"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"Submit\""], ["string.attribute-value.xml","\"Submit\""],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name.form","form"], ["meta.tag.form.tag-name.xml","form"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start" "start"
],[ ],[
"jsp-start", "jsp-start",
["text"," "], ["text.xml"," "],
["meta.tag","<%"] ["meta.tag","<%"]
],[ ],[
"jsp-start", "jsp-start",
@ -424,12 +424,12 @@
["meta.tag","%>"] ["meta.tag","%>"]
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","body"], ["meta.tag.tag-name.xml","body"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","html"], ["meta.tag.tag-name.xml","html"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
]] ]]

View file

@ -1,56 +1,56 @@
[[ [[
"start", "start",
["text","The following examples can be found in full at http://liquidmarkup.org/"] ["text.xml","The following examples can be found in full at http://liquidmarkup.org/"]
],[ ],[
"start" "start"
],[ ],[
"start", "start",
["text","Liquid is an extraction from the e-commerce system Shopify."] ["text.xml","Liquid is an extraction from the e-commerce system Shopify."]
],[ ],[
"start", "start",
["text","Shopify powers many thousands of e-commerce stores which all call for unique designs."] ["text.xml","Shopify powers many thousands of e-commerce stores which all call for unique designs."]
],[ ],[
"start", "start",
["text","For this we developed Liquid which allows our customers complete design freedom while"] ["text.xml","For this we developed Liquid which allows our customers complete design freedom while"]
],[ ],[
"start", "start",
["text","maintaining the integrity of our servers."] ["text.xml","maintaining the integrity of our servers."]
],[ ],[
"start" "start"
],[ ],[
"start", "start",
["text","Liquid has been in production use since June 2006 and is now used by many other"] ["text.xml","Liquid has been in production use since June 2006 and is now used by many other"]
],[ ],[
"start", "start",
["text","hosted web applications."] ["text.xml","hosted web applications."]
],[ ],[
"start" "start"
],[ ],[
"start", "start",
["text","It was developed for usage in Ruby on Rails web applications and integrates seamlessly"] ["text.xml","It was developed for usage in Ruby on Rails web applications and integrates seamlessly"]
],[ ],[
"start", "start",
["text","as a plugin but it also works excellently as a stand alone library."] ["text.xml","as a plugin but it also works excellently as a stand alone library."]
],[ ],[
"start" "start"
],[ ],[
"start", "start",
["text","Here's what it looks like:"] ["text.xml","Here's what it looks like:"]
],[ ],[
"start" "start"
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","ul"], ["meta.tag.tag-name.xml","ul"],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","id"], ["entity.other.attribute-name.xml","id"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"products\""], ["string.attribute-value.xml","\"products\""],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["variable","{%"], ["variable","{%"],
["text"," "], ["text"," "],
["keyword","for"], ["keyword","for"],
@ -64,16 +64,16 @@
["variable","%}"] ["variable","%}"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","li"], ["meta.tag.tag-name.xml","li"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","h2"], ["meta.tag.tag-name.xml","h2"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["variable","{{"], ["variable","{{"],
["text"," "], ["text"," "],
["identifier","product"], ["identifier","product"],
@ -81,12 +81,12 @@
["identifier","title"], ["identifier","title"],
["text"," "], ["text"," "],
["variable","}}"], ["variable","}}"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","h2"], ["meta.tag.tag-name.xml","h2"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," Only "], ["text.xml"," Only "],
["variable","{{"], ["variable","{{"],
["text"," "], ["text"," "],
["identifier","product"], ["identifier","product"],
@ -100,10 +100,10 @@
"start" "start"
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","p"], ["meta.tag.tag-name.xml","p"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["variable","{{"], ["variable","{{"],
["text"," "], ["text"," "],
["identifier","product"], ["identifier","product"],
@ -117,20 +117,20 @@
["constant.numeric","200"], ["constant.numeric","200"],
["text"," "], ["text"," "],
["variable","}}"], ["variable","}}"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","p"], ["meta.tag.tag-name.xml","p"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start" "start"
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","li"], ["meta.tag.tag-name.xml","li"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["variable","{%"], ["variable","{%"],
["text"," "], ["text"," "],
["keyword","endfor"], ["keyword","endfor"],
@ -138,34 +138,34 @@
["variable","%}"] ["variable","%}"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","ul"], ["meta.tag.tag-name.xml","ul"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start" "start"
],[ ],[
"start" "start"
],[ ],[
"start", "start",
["text","Some more features include:"] ["text.xml","Some more features include:"]
],[ ],[
"start" "start"
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","h2"], ["meta.tag.tag-name.xml","h2"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["text","Filters"], ["text.xml","Filters"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","h2"], ["meta.tag.tag-name.xml","h2"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","p"], ["meta.tag.tag-name.xml","p"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["text"," The word \"tobi\" in uppercase: "], ["text.xml"," The word \"tobi\" in uppercase: "],
["variable","{{"], ["variable","{{"],
["text"," "], ["text"," "],
["string","'tobi'"], ["string","'tobi'"],
@ -173,16 +173,16 @@
["support.function","upcase"], ["support.function","upcase"],
["text"," "], ["text"," "],
["variable","}}"], ["variable","}}"],
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","p"], ["meta.tag.tag-name.xml","p"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","p"], ["meta.tag.tag-name.xml","p"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["text","The word \"tobi\" has "], ["text.xml","The word \"tobi\" has "],
["variable","{{"], ["variable","{{"],
["text"," "], ["text"," "],
["string","'tobi'"], ["string","'tobi'"],
@ -190,16 +190,16 @@
["support.function","size"], ["support.function","size"],
["text"," "], ["text"," "],
["variable","}}"], ["variable","}}"],
["text"," letters! "], ["text.xml"," letters! "],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","p"], ["meta.tag.tag-name.xml","p"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","p"], ["meta.tag.tag-name.xml","p"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["text","Change \"Hello world\" to \"Hi world\": "], ["text.xml","Change \"Hello world\" to \"Hi world\": "],
["variable","{{"], ["variable","{{"],
["text"," "], ["text"," "],
["string","'Hello world'"], ["string","'Hello world'"],
@ -211,16 +211,16 @@
["string","'Hi'"], ["string","'Hi'"],
["text"," "], ["text"," "],
["variable","}}"], ["variable","}}"],
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","p"], ["meta.tag.tag-name.xml","p"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","p"], ["meta.tag.tag-name.xml","p"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["text","The date today is "], ["text.xml","The date today is "],
["variable","{{"], ["variable","{{"],
["text"," "], ["text"," "],
["string","'now'"], ["string","'now'"],
@ -230,31 +230,31 @@
["string","\"%Y %b %d\""], ["string","\"%Y %b %d\""],
["text"," "], ["text"," "],
["variable","}}"], ["variable","}}"],
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","p"], ["meta.tag.tag-name.xml","p"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start" "start"
],[ ],[
"start" "start"
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","h2"], ["meta.tag.tag-name.xml","h2"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["text","If"], ["text.xml","If"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","h2"], ["meta.tag.tag-name.xml","h2"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","p"], ["meta.tag.tag-name.xml","p"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["variable","{%"], ["variable","{%"],
["text"," "], ["text"," "],
["keyword","if"], ["keyword","if"],
@ -278,13 +278,13 @@
["string","'marc'"], ["string","'marc'"],
["text"," "], ["text"," "],
["variable","%}"], ["variable","%}"],
["text"," "] ["text.xml"," "]
],[ ],[
"start", "start",
["text"," hi marc or tobi"] ["text.xml"," hi marc or tobi"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["variable","{%"], ["variable","{%"],
["text"," "], ["text"," "],
["keyword","endif"], ["keyword","endif"],
@ -292,30 +292,30 @@
["variable","%}"] ["variable","%}"]
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","p"], ["meta.tag.tag-name.xml","p"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start" "start"
],[ ],[
"start" "start"
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","h2"], ["meta.tag.tag-name.xml","h2"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["text","Case"], ["text.xml","Case"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","h2"], ["meta.tag.tag-name.xml","h2"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","p"], ["meta.tag.tag-name.xml","p"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["variable","{%"], ["variable","{%"],
["text"," "], ["text"," "],
["keyword","case"], ["keyword","case"],
@ -325,7 +325,7 @@
["variable","%}"] ["variable","%}"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["variable","{%"], ["variable","{%"],
["text"," "], ["text"," "],
["keyword","when"], ["keyword","when"],
@ -335,10 +335,10 @@
["variable","%}"] ["variable","%}"]
],[ ],[
"start", "start",
["text"," Welcome"] ["text.xml"," Welcome"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["variable","{%"], ["variable","{%"],
["text"," "], ["text"," "],
["keyword","when"], ["keyword","when"],
@ -348,7 +348,7 @@
["variable","%}"] ["variable","%}"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["variable","{{"], ["variable","{{"],
["text"," "], ["text"," "],
["identifier","product"], ["identifier","product"],
@ -358,7 +358,7 @@
["identifier","link_to_vendor"], ["identifier","link_to_vendor"],
["text"," "], ["text"," "],
["variable","}}"], ["variable","}}"],
["text"," / "], ["text.xml"," / "],
["variable","{{"], ["variable","{{"],
["text"," "], ["text"," "],
["identifier","product"], ["identifier","product"],
@ -368,7 +368,7 @@
["variable","}}"] ["variable","}}"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["variable","{%"], ["variable","{%"],
["text"," "], ["text"," "],
["keyword","else"], ["keyword","else"],
@ -376,7 +376,7 @@
["variable","%}"] ["variable","%}"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["variable","{{"], ["variable","{{"],
["text"," "], ["text"," "],
["identifier","page_title"], ["identifier","page_title"],
@ -384,7 +384,7 @@
["variable","}}"] ["variable","}}"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["variable","{%"], ["variable","{%"],
["text"," "], ["text"," "],
["keyword","endcase"], ["keyword","endcase"],
@ -392,30 +392,30 @@
["variable","%}"] ["variable","%}"]
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","p"], ["meta.tag.tag-name.xml","p"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start" "start"
],[ ],[
"start" "start"
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","h2"], ["meta.tag.tag-name.xml","h2"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["text","For Loops"], ["text.xml","For Loops"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","h2"], ["meta.tag.tag-name.xml","h2"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","p"], ["meta.tag.tag-name.xml","p"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["variable","{%"], ["variable","{%"],
["text"," "], ["text"," "],
["keyword","for"], ["keyword","for"],
@ -427,10 +427,10 @@
["identifier","array"], ["identifier","array"],
["text"," "], ["text"," "],
["variable","%}"], ["variable","%}"],
["text"," "] ["text.xml"," "]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["variable","{{"], ["variable","{{"],
["text"," "], ["text"," "],
["identifier","item"], ["identifier","item"],
@ -438,7 +438,7 @@
["variable","}}"] ["variable","}}"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["variable","{%"], ["variable","{%"],
["text"," "], ["text"," "],
["keyword","endfor"], ["keyword","endfor"],
@ -446,30 +446,30 @@
["variable","%}"] ["variable","%}"]
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","p"], ["meta.tag.tag-name.xml","p"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start" "start"
],[ ],[
"start" "start"
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","h2"], ["meta.tag.tag-name.xml","h2"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["text","Tables"], ["text.xml","Tables"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","h2"], ["meta.tag.tag-name.xml","h2"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","p"], ["meta.tag.tag-name.xml","p"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["variable","{%"], ["variable","{%"],
["text"," "], ["text"," "],
["keyword","tablerow"], ["keyword","tablerow"],
@ -487,7 +487,7 @@
["variable","%}"] ["variable","%}"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["variable","{%"], ["variable","{%"],
["text"," "], ["text"," "],
["keyword","if"], ["keyword","if"],
@ -499,7 +499,7 @@
["variable","%}"] ["variable","%}"]
],[ ],[
"start", "start",
["text"," First column: "], ["text.xml"," First column: "],
["variable","{{"], ["variable","{{"],
["text"," "], ["text"," "],
["identifier","item"], ["identifier","item"],
@ -509,7 +509,7 @@
["variable","}}"] ["variable","}}"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["variable","{%"], ["variable","{%"],
["text"," "], ["text"," "],
["keyword","else"], ["keyword","else"],
@ -517,7 +517,7 @@
["variable","%}"] ["variable","%}"]
],[ ],[
"start", "start",
["text"," Different column: "], ["text.xml"," Different column: "],
["variable","{{"], ["variable","{{"],
["text"," "], ["text"," "],
["identifier","item"], ["identifier","item"],
@ -527,7 +527,7 @@
["variable","}}"] ["variable","}}"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["variable","{%"], ["variable","{%"],
["text"," "], ["text"," "],
["keyword","endif"], ["keyword","endif"],
@ -535,7 +535,7 @@
["variable","%}"] ["variable","%}"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["variable","{%"], ["variable","{%"],
["text"," "], ["text"," "],
["keyword","endtablerow"], ["keyword","endtablerow"],
@ -543,9 +543,9 @@
["variable","%}"] ["variable","%}"]
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","p"], ["meta.tag.tag-name.xml","p"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start" "start"
]] ]]

View file

@ -1,6 +1,6 @@
[[ [[
"comment", "comment",
["comment.block.lsl","/*"] ["comment.block.begin.lsl","/*"]
],[ ],[
"comment", "comment",
["comment.block.lsl"," Testing syntax highlighting"] ["comment.block.lsl"," Testing syntax highlighting"]
@ -12,7 +12,7 @@
["comment.block.lsl"," for the Linden Scripting Language"] ["comment.block.lsl"," for the Linden Scripting Language"]
],[ ],[
"start", "start",
["comment.block.lsl","*/"] ["comment.block.end.lsl","*/"]
],[ ],[
"start" "start"
],[ ],[
@ -51,14 +51,14 @@
"start", "start",
["storage.type.lsl","integer"], ["storage.type.lsl","integer"],
["text.lsl"," "], ["text.lsl"," "],
["invalid.unimplemented.lsl","event"], ["invalid.illegal.lsl","event"],
["text.lsl"," "], ["text.lsl"," "],
["keyword.operator.lsl","="], ["keyword.operator.lsl","="],
["text.lsl"," "], ["text.lsl"," "],
["constant.numeric.lsl","5673"], ["constant.numeric.lsl","5673"],
["punctuation.operator.lsl",";"], ["punctuation.operator.lsl",";"],
["text.lsl"," "], ["text.lsl"," "],
["comment.line.double-slash.lsl","// unimplemented reserved keyword!"] ["comment.line.double-slash.lsl","// invalid.illegal"]
],[ ],[
"start" "start"
],[ ],[
@ -368,14 +368,14 @@
],[ ],[
"start", "start",
["text.lsl"," "], ["text.lsl"," "],
["invalid.unimplemented.lsl","event"], ["invalid.illegal.lsl","event"],
["text.lsl"," "], ["text.lsl"," "],
["keyword.operator.lsl","="], ["keyword.operator.lsl","="],
["text.lsl"," "], ["text.lsl"," "],
["constant.numeric.lsl","5673"], ["constant.numeric.lsl","5673"],
["punctuation.operator.lsl",";"], ["punctuation.operator.lsl",";"],
["text.lsl"," "], ["text.lsl"," "],
["comment.line.double-slash.lsl","// unimplemented reserved keyword!"] ["comment.line.double-slash.lsl","// invalid.illegal"]
],[ ],[
"start" "start"
],[ ],[
@ -401,13 +401,21 @@
],[ ],[
"start", "start",
["text.lsl"," "], ["text.lsl"," "],
["invalid.deprecated.lsl","llCloud"], ["reserved.godmode.lsl","llSetInventoryPermMask"],
["paren.lparen.lsl","("], ["paren.lparen.lsl","("],
["constant.language.vector.lsl","ZERO_VECTOR"], ["string.quoted.double.lsl.start","\""],
["string.quoted.double.lsl","some item"],
["string.quoted.double.lsl.end","\""],
["punctuation.operator.lsl",","],
["text.lsl"," "],
["constant.language.integer.lsl","MASK_NEXT"],
["punctuation.operator.lsl",","],
["text.lsl"," "],
["constant.language.integer.lsl","PERM_ALL"],
["paren.rparen.lsl",")"], ["paren.rparen.lsl",")"],
["punctuation.operator.lsl",";"], ["punctuation.operator.lsl",";"],
["text.lsl"," "], ["text.lsl"," "],
["comment.line.double-slash.lsl","// invalid deprecated function!"] ["comment.line.double-slash.lsl","// reserved.godmode"]
],[ ],[
"start" "start"
],[ ],[
@ -420,9 +428,9 @@
["text.lsl"," "], ["text.lsl"," "],
["string.quoted.double.lsl.start","\""], ["string.quoted.double.lsl.start","\""],
["string.quoted.double.lsl","Leaving "], ["string.quoted.double.lsl","Leaving "],
["constant.language.escape.lsl","\\\""], ["constant.character.escape.lsl","\\\""],
["string.quoted.double.lsl","default"], ["string.quoted.double.lsl","default"],
["constant.language.escape.lsl","\\\""], ["constant.character.escape.lsl","\\\""],
["string.quoted.double.lsl"," now..."], ["string.quoted.double.lsl"," now..."],
["string.quoted.double.lsl.end","\""], ["string.quoted.double.lsl.end","\""],
["paren.rparen.lsl",")"], ["paren.rparen.lsl",")"],
@ -467,13 +475,13 @@
["text.lsl"," "], ["text.lsl"," "],
["string.quoted.double.lsl.start","\""], ["string.quoted.double.lsl.start","\""],
["string.quoted.double.lsl","Entered "], ["string.quoted.double.lsl","Entered "],
["constant.language.escape.lsl","\\\""], ["constant.character.escape.lsl","\\\""],
["string.quoted.double.lsl","state other"], ["string.quoted.double.lsl","state other"],
["constant.language.escape.lsl","\\\""], ["constant.character.escape.lsl","\\\""],
["string.quoted.double.lsl",", returning to "], ["string.quoted.double.lsl",", returning to "],
["constant.language.escape.lsl","\\\""], ["constant.character.escape.lsl","\\\""],
["string.quoted.double.lsl","default"], ["string.quoted.double.lsl","default"],
["constant.language.escape.lsl","\\\""], ["constant.character.escape.lsl","\\\""],
["string.quoted.double.lsl"," again..."], ["string.quoted.double.lsl"," again..."],
["string.quoted.double.lsl.end","\""], ["string.quoted.double.lsl.end","\""],
["paren.rparen.lsl",")"], ["paren.rparen.lsl",")"],
@ -492,4 +500,4 @@
["paren.rparen.lsl","}"] ["paren.rparen.lsl","}"]
],[ ],[
"start" "start"
]] ]]

View file

@ -1,24 +1,24 @@
[[ [[
"doctype", "doctype",
["text",""], ["text.xml",""],
["punctuation.doctype.begin","<!"], ["xml-pe.doctype.xml","<!"],
["meta.tag.doctype","DOCTYPE"], ["xml-pe.doctype.xml","DOCTYPE"],
["text"," "], ["text.whitespace.xml"," "],
["xml-pe","html"], ["xml-pe.xml","html"],
["text"," "], ["text.whitespace.xml"," "],
["xml-pe","PUBLIC"], ["xml-pe.xml","PUBLIC"],
["text"," "], ["text.whitespace.xml"," "],
["string","\"-//W3C//DTD XHTML 1.0 Strict//EN\""] ["string.xml","\"-//W3C//DTD XHTML 1.0 Strict//EN\""]
],[ ],[
"start", "start",
["text"," "], ["text.whitespace.xml"," "],
["string","\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\""], ["string.xml","\"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\""],
["punctuation.doctype.end",">"] ["xml-pe.doctype.xml",">"]
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","html"], ["meta.tag.tag-name.xml","html"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
["lua-bracketedComment",2,"lua-start"], ["lua-bracketedComment",2,"lua-start"],
["keyword","<%"], ["keyword","<%"],
@ -37,32 +37,32 @@
["keyword","%>"] ["keyword","%>"]
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","head"], ["meta.tag.tag-name.xml","head"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","title"], ["meta.tag.tag-name.xml","title"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["text","Reference"], ["text.xml","Reference"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","title"], ["meta.tag.tag-name.xml","title"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","link"], ["meta.tag.tag-name.xml","link"],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","rel"], ["entity.other.attribute-name.xml","rel"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"stylesheet\""], ["string.attribute-value.xml","\"stylesheet\""],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","href"], ["entity.other.attribute-name.xml","href"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\""], ["string.attribute-value.xml","\""],
["keyword","<%="], ["keyword","<%="],
["identifier","luadoc"], ["identifier","luadoc"],
["text","."], ["text","."],
@ -75,129 +75,129 @@
["string","\"luadoc.css\""], ["string","\"luadoc.css\""],
["paren.rparen",")"], ["paren.rparen",")"],
["keyword","%>"], ["keyword","%>"],
["string","\""], ["string.attribute-value.xml","\""],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","type"], ["entity.other.attribute-name.xml","type"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"text/css\""], ["string.attribute-value.xml","\"text/css\""],
["text"," "], ["text.tag-whitespace.xml"," "],
["meta.tag.punctuation.end","/>"] ["meta.tag.punctuation.tag-close.xml","/>"]
],[ ],[
"start", "start",
["text","\t"], ["text.xml","\t"],
["comment","<!--meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/-->"] ["comment.xml","<!--meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\"/-->"]
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","head"], ["meta.tag.tag-name.xml","head"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start" "start"
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","body"], ["meta.tag.tag-name.xml","body"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","div"], ["meta.tag.tag-name.xml","div"],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","id"], ["entity.other.attribute-name.xml","id"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"container\""], ["string.attribute-value.xml","\"container\""],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start" "start"
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","div"], ["meta.tag.tag-name.xml","div"],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","id"], ["entity.other.attribute-name.xml","id"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"product\""], ["string.attribute-value.xml","\"product\""],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text","\t"], ["text.xml","\t"],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","div"], ["meta.tag.tag-name.xml","div"],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","id"], ["entity.other.attribute-name.xml","id"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"product_logo\""], ["string.attribute-value.xml","\"product_logo\""],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","div"], ["meta.tag.tag-name.xml","div"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text","\t"], ["text.xml","\t"],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","div"], ["meta.tag.tag-name.xml","div"],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","id"], ["entity.other.attribute-name.xml","id"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"product_name\""], ["string.attribute-value.xml","\"product_name\""],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","big"], ["meta.tag.tag-name.xml","big"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","b"], ["meta.tag.tag-name.xml","b"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","b"], ["meta.tag.tag-name.xml","b"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","big"], ["meta.tag.tag-name.xml","big"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","div"], ["meta.tag.tag-name.xml","div"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text","\t"], ["text.xml","\t"],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","div"], ["meta.tag.tag-name.xml","div"],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","id"], ["entity.other.attribute-name.xml","id"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"product_description\""], ["string.attribute-value.xml","\"product_description\""],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","div"], ["meta.tag.tag-name.xml","div"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","div"], ["meta.tag.tag-name.xml","div"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["text"," "], ["text.xml"," "],
["comment","<!-- id=\"product\" -->"] ["comment.xml","<!-- id=\"product\" -->"]
],[ ],[
"start" "start"
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","div"], ["meta.tag.tag-name.xml","div"],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","id"], ["entity.other.attribute-name.xml","id"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"main\""], ["string.attribute-value.xml","\"main\""],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start" "start"
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","div"], ["meta.tag.tag-name.xml","div"],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","id"], ["entity.other.attribute-name.xml","id"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"navigation\""], ["string.attribute-value.xml","\"navigation\""],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["keyword","<%="], ["keyword","<%="],
@ -223,22 +223,22 @@
"start" "start"
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","div"], ["meta.tag.tag-name.xml","div"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["text"," "], ["text.xml"," "],
["comment","<!-- id=\"navigation\" -->"] ["comment.xml","<!-- id=\"navigation\" -->"]
],[ ],[
"start" "start"
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","div"], ["meta.tag.tag-name.xml","div"],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","id"], ["entity.other.attribute-name.xml","id"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"content\""], ["string.attribute-value.xml","\"content\""],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start" "start"
],[ ],[
@ -267,25 +267,25 @@
["keyword","then%>"] ["keyword","then%>"]
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","h2"], ["meta.tag.tag-name.xml","h2"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["text","Modules"], ["text.xml","Modules"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","h2"], ["meta.tag.tag-name.xml","h2"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.table","table"], ["meta.tag.table.tag-name.xml","table"],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","class"], ["entity.other.attribute-name.xml","class"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"module_list\""], ["string.attribute-value.xml","\"module_list\""],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["comment","<!--<tr><td colspan=\"2\">Modules</td></tr>-->"] ["comment.xml","<!--<tr><td colspan=\"2\">Modules</td></tr>-->"]
],[ ],[
"start", "start",
["keyword","<%for"], ["keyword","<%for"],
@ -306,26 +306,26 @@
["keyword","do%>"] ["keyword","do%>"]
],[ ],[
"start", "start",
["text","\t"], ["text.xml","\t"],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.table","tr"], ["meta.tag.table.tag-name.xml","tr"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text","\t\t"], ["text.xml","\t\t"],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.table","td"], ["meta.tag.table.tag-name.xml","td"],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","class"], ["entity.other.attribute-name.xml","class"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"name\""], ["string.attribute-value.xml","\"name\""],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.anchor","a"], ["meta.tag.anchor.tag-name.xml","a"],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","href"], ["entity.other.attribute-name.xml","href"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\""], ["string.attribute-value.xml","\""],
["keyword","<%="], ["keyword","<%="],
["identifier","luadoc"], ["identifier","luadoc"],
["text","."], ["text","."],
@ -340,27 +340,27 @@
["identifier","doc"], ["identifier","doc"],
["paren.rparen",")"], ["paren.rparen",")"],
["keyword","%>"], ["keyword","%>"],
["string","\""], ["string.attribute-value.xml","\""],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["keyword","<%="], ["keyword","<%="],
["identifier","modulename"], ["identifier","modulename"],
["keyword","%>"], ["keyword","%>"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name.anchor","a"], ["meta.tag.anchor.tag-name.xml","a"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name.table","td"], ["meta.tag.table.tag-name.xml","td"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text","\t\t"], ["text.xml","\t\t"],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.table","td"], ["meta.tag.table.tag-name.xml","td"],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","class"], ["entity.other.attribute-name.xml","class"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"summary\""], ["string.attribute-value.xml","\"summary\""],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["keyword","<%="], ["keyword","<%="],
["identifier","doc"], ["identifier","doc"],
["text","."], ["text","."],
@ -371,23 +371,23 @@
["text","."], ["text","."],
["identifier","summary"], ["identifier","summary"],
["keyword","%>"], ["keyword","%>"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name.table","td"], ["meta.tag.table.tag-name.xml","td"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text","\t"], ["text.xml","\t"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name.table","tr"], ["meta.tag.table.tag-name.xml","tr"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["keyword","<%end%>"] ["keyword","<%end%>"]
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name.table","table"], ["meta.tag.table.tag-name.xml","table"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["keyword","<%end%>"] ["keyword","<%end%>"]
@ -421,25 +421,25 @@
["keyword","then%>"] ["keyword","then%>"]
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","h2"], ["meta.tag.tag-name.xml","h2"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["text","Files"], ["text.xml","Files"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","h2"], ["meta.tag.tag-name.xml","h2"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.table","table"], ["meta.tag.table.tag-name.xml","table"],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","class"], ["entity.other.attribute-name.xml","class"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"file_list\""], ["string.attribute-value.xml","\"file_list\""],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["comment","<!--<tr><td colspan=\"2\">Files</td></tr>-->"] ["comment.xml","<!--<tr><td colspan=\"2\">Files</td></tr>-->"]
],[ ],[
"start", "start",
["keyword","<%for"], ["keyword","<%for"],
@ -460,26 +460,26 @@
["keyword","do%>"] ["keyword","do%>"]
],[ ],[
"start", "start",
["text","\t"], ["text.xml","\t"],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.table","tr"], ["meta.tag.table.tag-name.xml","tr"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text","\t\t"], ["text.xml","\t\t"],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.table","td"], ["meta.tag.table.tag-name.xml","td"],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","class"], ["entity.other.attribute-name.xml","class"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"name\""], ["string.attribute-value.xml","\"name\""],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.anchor","a"], ["meta.tag.anchor.tag-name.xml","a"],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","href"], ["entity.other.attribute-name.xml","href"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\""], ["string.attribute-value.xml","\""],
["keyword","<%="], ["keyword","<%="],
["identifier","luadoc"], ["identifier","luadoc"],
["text","."], ["text","."],
@ -492,44 +492,44 @@
["identifier","filepath"], ["identifier","filepath"],
["paren.rparen",")"], ["paren.rparen",")"],
["keyword","%>"], ["keyword","%>"],
["string","\""], ["string.attribute-value.xml","\""],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["keyword","<%="], ["keyword","<%="],
["identifier","filepath"], ["identifier","filepath"],
["keyword","%>"], ["keyword","%>"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name.anchor","a"], ["meta.tag.anchor.tag-name.xml","a"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name.table","td"], ["meta.tag.table.tag-name.xml","td"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text","\t\t"], ["text.xml","\t\t"],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.table","td"], ["meta.tag.table.tag-name.xml","td"],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","class"], ["entity.other.attribute-name.xml","class"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"summary\""], ["string.attribute-value.xml","\"summary\""],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name.table","td"], ["meta.tag.table.tag-name.xml","td"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text","\t"], ["text.xml","\t"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name.table","tr"], ["meta.tag.table.tag-name.xml","tr"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["keyword","<%end%>"] ["keyword","<%end%>"]
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name.table","table"], ["meta.tag.table.tag-name.xml","table"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["keyword","<%end%>"] ["keyword","<%end%>"]
@ -537,97 +537,97 @@
"start" "start"
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","div"], ["meta.tag.tag-name.xml","div"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["text"," "], ["text.xml"," "],
["comment","<!-- id=\"content\" -->"] ["comment.xml","<!-- id=\"content\" -->"]
],[ ],[
"start" "start"
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","div"], ["meta.tag.tag-name.xml","div"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["text"," "], ["text.xml"," "],
["comment","<!-- id=\"main\" -->"] ["comment.xml","<!-- id=\"main\" -->"]
],[ ],[
"start" "start"
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","div"], ["meta.tag.tag-name.xml","div"],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","id"], ["entity.other.attribute-name.xml","id"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"about\""], ["string.attribute-value.xml","\"about\""],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text","\t"], ["text.xml","\t"],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","p"], ["meta.tag.tag-name.xml","p"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.anchor","a"], ["meta.tag.anchor.tag-name.xml","a"],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","href"], ["entity.other.attribute-name.xml","href"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"http://validator.w3.org/check?uri=referer\""], ["string.attribute-value.xml","\"http://validator.w3.org/check?uri=referer\""],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.image","img"], ["meta.tag.image.tag-name.xml","img"],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","src"], ["entity.other.attribute-name.xml","src"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"http://www.w3.org/Icons/valid-xhtml10\""], ["string.attribute-value.xml","\"http://www.w3.org/Icons/valid-xhtml10\""],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","alt"], ["entity.other.attribute-name.xml","alt"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"Valid XHTML 1.0!\""], ["string.attribute-value.xml","\"Valid XHTML 1.0!\""],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","height"], ["entity.other.attribute-name.xml","height"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"31\""], ["string.attribute-value.xml","\"31\""],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","width"], ["entity.other.attribute-name.xml","width"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"88\""], ["string.attribute-value.xml","\"88\""],
["text"," "], ["text.tag-whitespace.xml"," "],
["meta.tag.punctuation.end","/>"], ["meta.tag.punctuation.tag-close.xml","/>"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name.anchor","a"], ["meta.tag.anchor.tag-name.xml","a"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","p"], ["meta.tag.tag-name.xml","p"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","div"], ["meta.tag.tag-name.xml","div"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["text"," "], ["text.xml"," "],
["comment","<!-- id=\"about\" -->"] ["comment.xml","<!-- id=\"about\" -->"]
],[ ],[
"start" "start"
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","div"], ["meta.tag.tag-name.xml","div"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["text"," "], ["text.xml"," "],
["comment","<!-- id=\"container\" -->"], ["comment.xml","<!-- id=\"container\" -->"],
["text","\t"] ["text.xml","\t"]
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","body"], ["meta.tag.tag-name.xml","body"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","html"], ["meta.tag.tag-name.xml","html"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start" "start"
]] ]]

View file

@ -1,49 +1,49 @@
[[ [[
"start", "start",
["text","test: header 1 "] ["text.xml","test: header 1 "]
],[ ],[
"start", "start",
["markup.heading.1","#"], ["markup.heading.1","#"],
["heading","f"] ["heading","f"]
],[ ],[
"start", "start",
["text","test: header 2"] ["text.xml","test: header 2"]
],[ ],[
"start", "start",
["markup.heading.2","##"], ["markup.heading.2","##"],
["heading"," foo"] ["heading"," foo"]
],[ ],[
"start", "start",
["text","test: header ends with ' #'"] ["text.xml","test: header ends with ' #'"]
],[ ],[
"start", "start",
["markup.heading.1","#"], ["markup.heading.1","#"],
["heading"," # # "] ["heading"," # # "]
],[ ],[
"start", "start",
["text","test: header ends with '#'"] ["text.xml","test: header ends with '#'"]
],[ ],[
"start", "start",
["markup.heading.1","#"], ["markup.heading.1","#"],
["heading","foo# "] ["heading","foo# "]
],[ ],[
"start", "start",
["text","test: 6+ #s is not a valid header"] ["text.xml","test: 6+ #s is not a valid header"]
],[ ],[
"start", "start",
["text","####### foo"] ["text.xml","####### foo"]
],[ ],[
"start", "start",
["text","test: # followed be only space is not a valid header"] ["text.xml","test: # followed be only space is not a valid header"]
],[ ],[
"start", "start",
["text","# "] ["text.xml","# "]
],[ ],[
"start", "start",
["text","test: only space between #s is not a valid header"] ["text.xml","test: only space between #s is not a valid header"]
],[ ],[
"start", "start",
["text","# #"] ["text.xml","# #"]
],[ ],[
"allowBlock" "allowBlock"
],[ ],[
@ -99,14 +99,14 @@
"start" "start"
],[ ],[
"start", "start",
["text","in plain text "], ["text.xml","in plain text "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","b"], ["meta.tag.tag-name.xml","b"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["text","http://ace.ajaxorg.com"], ["text.xml","http://ace.ajaxorg.com"],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","b"], ["meta.tag.tag-name.xml","b"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"allowBlock" "allowBlock"
],[ ],[

View file

@ -1,55 +1,55 @@
[[ [[
"start", "start",
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","html"], ["meta.tag.tag-name.xml","html"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start" "start"
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","head"], ["meta.tag.tag-name.xml","head"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","title"], ["meta.tag.tag-name.xml","title"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["text","Title"], ["text.xml","Title"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","title"], ["meta.tag.tag-name.xml","title"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","head"], ["meta.tag.tag-name.xml","head"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start" "start"
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","body"], ["meta.tag.tag-name.xml","body"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start" "start"
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","p"], ["meta.tag.tag-name.xml","p"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["text","This is an R HTML document. When you click the "], ["text.xml","This is an R HTML document. When you click the "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","b"], ["meta.tag.tag-name.xml","b"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["text","Knit HTML"], ["text.xml","Knit HTML"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","b"], ["meta.tag.tag-name.xml","b"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["text"," button a web page will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:"], ["text.xml"," button a web page will be generated that includes both content as well as the output of any embedded R code chunks within the document. You can embed an R code chunk like this:"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","p"], ["meta.tag.tag-name.xml","p"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start" "start"
],[ ],[
@ -68,13 +68,13 @@
"start" "start"
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","p"], ["meta.tag.tag-name.xml","p"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["text","You can also embed plots, for example:"], ["text.xml","You can also embed plots, for example:"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","p"], ["meta.tag.tag-name.xml","p"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start" "start"
],[ ],[
@ -93,14 +93,14 @@
"start" "start"
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","body"], ["meta.tag.tag-name.xml","body"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","html"], ["meta.tag.tag-name.xml","html"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start" "start"
]] ]]

View file

@ -32,7 +32,7 @@
["punctuation.definition.tag.end.soy","}"] ["punctuation.definition.tag.end.soy","}"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["punctuation.definition.tag.begin.soy","{"], ["punctuation.definition.tag.begin.soy","{"],
["entity.name.tag.soy","if"], ["entity.name.tag.soy","if"],
["meta.tag.if.soy"," "], ["meta.tag.if.soy"," "],
@ -42,31 +42,31 @@
["punctuation.definition.tag.end.soy","}"] ["punctuation.definition.tag.end.soy","}"]
],[ ],[
"start", "start",
["text"," Hello "], ["text.xml"," Hello "],
["punctuation.definition.tag.begin.soy","{"], ["punctuation.definition.tag.begin.soy","{"],
["variable.other.soy","$name"], ["variable.other.soy","$name"],
["punctuation.definition.tag.end.soy","}"], ["punctuation.definition.tag.end.soy","}"],
["text","!"] ["text.xml","!"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["punctuation.definition.tag.begin.soy","{"], ["punctuation.definition.tag.begin.soy","{"],
["text","else"], ["text","else"],
["punctuation.definition.tag.end.soy","}"] ["punctuation.definition.tag.end.soy","}"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["punctuation.definition.tag.begin.soy","{"], ["punctuation.definition.tag.begin.soy","{"],
["variable.other.soy","$greetingWord"], ["variable.other.soy","$greetingWord"],
["punctuation.definition.tag.end.soy","}"], ["punctuation.definition.tag.end.soy","}"],
["text"," "], ["text.xml"," "],
["punctuation.definition.tag.begin.soy","{"], ["punctuation.definition.tag.begin.soy","{"],
["variable.other.soy","$name"], ["variable.other.soy","$name"],
["punctuation.definition.tag.end.soy","}"], ["punctuation.definition.tag.end.soy","}"],
["text","!"] ["text.xml","!"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["punctuation.definition.tag.begin.soy","{/"], ["punctuation.definition.tag.begin.soy","{/"],
["entity.name.tag.soy","if"], ["entity.name.tag.soy","if"],
["punctuation.definition.tag.end.soy","}"] ["punctuation.definition.tag.end.soy","}"]
@ -115,7 +115,7 @@
["comment.line.double-slash.soy"," Greet the person."] ["comment.line.double-slash.soy"," Greet the person."]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["punctuation.definition.tag.begin.soy","{"], ["punctuation.definition.tag.begin.soy","{"],
["entity.name.tag.soy","call"], ["entity.name.tag.soy","call"],
["variable.parameter.soy"," .helloName"], ["variable.parameter.soy"," .helloName"],
@ -125,9 +125,9 @@
["string.quoted.double","\"all\""], ["string.quoted.double","\"all\""],
["meta.tag.call.soy"," /"], ["meta.tag.call.soy"," /"],
["punctuation.definition.tag.end.soy","}"], ["punctuation.definition.tag.end.soy","}"],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","br"], ["meta.tag.tag-name.xml","br"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["comment.line.double-slash.soy"," "], ["comment.line.double-slash.soy"," "],
@ -135,7 +135,7 @@
["comment.line.double-slash.soy"," Greet the additional people."] ["comment.line.double-slash.soy"," Greet the additional people."]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["punctuation.definition.tag.begin.soy","{"], ["punctuation.definition.tag.begin.soy","{"],
["entity.name.tag.soy","foreach"], ["entity.name.tag.soy","foreach"],
["meta.tag.foreach.soy"," "], ["meta.tag.foreach.soy"," "],
@ -147,14 +147,14 @@
["punctuation.definition.tag.end.soy","}"] ["punctuation.definition.tag.end.soy","}"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["punctuation.definition.tag.begin.soy","{"], ["punctuation.definition.tag.begin.soy","{"],
["entity.name.tag.soy","call"], ["entity.name.tag.soy","call"],
["variable.parameter.soy"," .helloName"], ["variable.parameter.soy"," .helloName"],
["punctuation.definition.tag.end.soy","}"] ["punctuation.definition.tag.end.soy","}"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["punctuation.definition.tag.begin.soy","{"], ["punctuation.definition.tag.begin.soy","{"],
["entity.name.tag.soy","param"], ["entity.name.tag.soy","param"],
["text"," "], ["text"," "],
@ -167,13 +167,13 @@
["punctuation.definition.tag.end.soy","}"] ["punctuation.definition.tag.end.soy","}"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["punctuation.definition.tag.begin.soy","{/"], ["punctuation.definition.tag.begin.soy","{/"],
["meta.tag.call.soy","call"], ["meta.tag.call.soy","call"],
["punctuation.definition.tag.end.soy","}"] ["punctuation.definition.tag.end.soy","}"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["punctuation.definition.tag.begin.soy","{"], ["punctuation.definition.tag.begin.soy","{"],
["entity.name.tag.soy","if"], ["entity.name.tag.soy","if"],
["meta.tag.if.soy"," "], ["meta.tag.if.soy"," "],
@ -186,31 +186,31 @@
["punctuation.definition.tag.end.soy","}"] ["punctuation.definition.tag.end.soy","}"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","br"], ["meta.tag.tag-name.xml","br"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["comment.line.double-slash.soy"," "], ["comment.line.double-slash.soy"," "],
["punctuation.definition.comment.soy","//"], ["punctuation.definition.comment.soy","//"],
["comment.line.double-slash.soy"," break after every line except the last"] ["comment.line.double-slash.soy"," break after every line except the last"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["punctuation.definition.tag.begin.soy","{/"], ["punctuation.definition.tag.begin.soy","{/"],
["entity.name.tag.soy","if"], ["entity.name.tag.soy","if"],
["punctuation.definition.tag.end.soy","}"] ["punctuation.definition.tag.end.soy","}"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["punctuation.definition.tag.begin.soy","{"], ["punctuation.definition.tag.begin.soy","{"],
["text","ifempty"], ["text","ifempty"],
["punctuation.definition.tag.end.soy","}"] ["punctuation.definition.tag.end.soy","}"]
],[ ],[
"start", "start",
["text"," No additional people to greet."] ["text.xml"," No additional people to greet."]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["punctuation.definition.tag.begin.soy","{/"], ["punctuation.definition.tag.begin.soy","{/"],
["entity.name.tag.soy","foreach"], ["entity.name.tag.soy","foreach"],
["punctuation.definition.tag.end.soy","}"] ["punctuation.definition.tag.end.soy","}"]
@ -275,7 +275,7 @@
["punctuation.definition.tag.end.soy","}"] ["punctuation.definition.tag.end.soy","}"]
],[ ],[
"start", "start",
["text"," foo is "], ["text.xml"," foo is "],
["punctuation.definition.tag.begin.soy","{"], ["punctuation.definition.tag.begin.soy","{"],
["variable.other.soy","$ij.foo"], ["variable.other.soy","$ij.foo"],
["punctuation.definition.tag.end.soy","}"] ["punctuation.definition.tag.end.soy","}"]

View file

@ -1,65 +1,65 @@
[[ [[
"meta.tag.punctuation.begin0", "meta.tag.punctuation.tag-open.xml1",
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","svg"] ["meta.tag.tag-name.xml","svg"]
],[ ],[
"meta.tag.punctuation.begin0", "meta.tag.punctuation.tag-open.xml1",
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","width"], ["entity.other.attribute-name.xml","width"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"800\""], ["string.attribute-value.xml","\"800\""],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","height"], ["entity.other.attribute-name.xml","height"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"600\""] ["string.attribute-value.xml","\"600\""]
],[ ],[
"meta.tag.punctuation.begin0", "meta.tag.punctuation.tag-open.xml1",
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","xmlns"], ["entity.other.attribute-name.xml","xmlns"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"http://www.w3.org/2000/svg\""] ["string.attribute-value.xml","\"http://www.w3.org/2000/svg\""]
],[ ],[
"start", "start",
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","onload"], ["entity.other.attribute-name.xml","onload"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"StartAnimation(evt)\""], ["string.attribute-value.xml","\"StartAnimation(evt)\""],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start" "start"
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","title"], ["meta.tag.tag-name.xml","title"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["text","Test Tube Progress Bar"], ["text.xml","Test Tube Progress Bar"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","title"], ["meta.tag.tag-name.xml","title"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","desc"], ["meta.tag.tag-name.xml","desc"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["text","Created for the Web Directions SVG competition"], ["text.xml","Created for the Web Directions SVG competition"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","desc"], ["meta.tag.tag-name.xml","desc"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start" "start"
],[ ],[
"js-no_regex", "js-no_regex",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.script","script"], ["meta.tag.script.tag-name.xml","script"],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","type"], ["entity.other.attribute-name.xml","type"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"text/ecmascript\""], ["string.attribute-value.xml","\"text/ecmascript\""],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["string.begin","<![CDATA["] ["string.cdata.xml","<![CDATA["]
],[ ],[
"js-start", "js-start",
["text"," "], ["text"," "],
@ -488,197 +488,197 @@
],[ ],[
"start", "start",
["text"," "], ["text"," "],
["string.end","]]>"], ["string.cdata.xml","]]>"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name.script","script"], ["meta.tag.script.tag-name.xml","script"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start" "start"
],[ ],[
"meta.tag.punctuation.begin0", "meta.tag.punctuation.tag-open.xml1",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","rect"] ["meta.tag.tag-name.xml","rect"]
],[ ],[
"meta.tag.punctuation.begin0", "meta.tag.punctuation.tag-open.xml1",
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","fill"], ["entity.other.attribute-name.xml","fill"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"#2e3436\""] ["string.attribute-value.xml","\"#2e3436\""]
],[ ],[
"meta.tag.punctuation.begin0", "meta.tag.punctuation.tag-open.xml1",
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","fill-rule"], ["entity.other.attribute-name.xml","fill-rule"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"nonzero\""] ["string.attribute-value.xml","\"nonzero\""]
],[ ],[
"meta.tag.punctuation.begin0", "meta.tag.punctuation.tag-open.xml1",
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","stroke-width"], ["entity.other.attribute-name.xml","stroke-width"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"3\""] ["string.attribute-value.xml","\"3\""]
],[ ],[
"meta.tag.punctuation.begin0", "meta.tag.punctuation.tag-open.xml1",
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","y"], ["entity.other.attribute-name.xml","y"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"0\""] ["string.attribute-value.xml","\"0\""]
],[ ],[
"meta.tag.punctuation.begin0", "meta.tag.punctuation.tag-open.xml1",
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","x"], ["entity.other.attribute-name.xml","x"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"0\""] ["string.attribute-value.xml","\"0\""]
],[ ],[
"meta.tag.punctuation.begin0", "meta.tag.punctuation.tag-open.xml1",
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","height"], ["entity.other.attribute-name.xml","height"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"600\""] ["string.attribute-value.xml","\"600\""]
],[ ],[
"meta.tag.punctuation.begin0", "meta.tag.punctuation.tag-open.xml1",
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","width"], ["entity.other.attribute-name.xml","width"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"800\""] ["string.attribute-value.xml","\"800\""]
],[ ],[
"start", "start",
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","id"], ["entity.other.attribute-name.xml","id"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"rect3590\""], ["string.attribute-value.xml","\"rect3590\""],
["meta.tag.punctuation.end","/>"] ["meta.tag.punctuation.tag-close.xml","/>"]
],[ ],[
"start" "start"
],[ ],[
"meta.tag.punctuation.begin0", "meta.tag.punctuation.tag-open.xml1",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","text"] ["meta.tag.tag-name.xml","text"]
],[ ],[
"meta.tag.punctuation.begin0", "meta.tag.punctuation.tag-open.xml1",
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","style"], ["entity.other.attribute-name.xml","style"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"font-size:144px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans Bold\""] ["string.attribute-value.xml","\"font-size:144px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans Bold\""]
],[ ],[
"meta.tag.punctuation.begin0", "meta.tag.punctuation.tag-open.xml1",
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","x"], ["entity.other.attribute-name.xml","x"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"50\""] ["string.attribute-value.xml","\"50\""]
],[ ],[
"meta.tag.punctuation.begin0", "meta.tag.punctuation.tag-open.xml1",
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","y"], ["entity.other.attribute-name.xml","y"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"350\""] ["string.attribute-value.xml","\"350\""]
],[ ],[
"meta.tag.punctuation.begin0", "meta.tag.punctuation.tag-open.xml1",
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","id"], ["entity.other.attribute-name.xml","id"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"hickory\""] ["string.attribute-value.xml","\"hickory\""]
],[ ],[
"start", "start",
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","display"], ["entity.other.attribute-name.xml","display"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"none\""], ["string.attribute-value.xml","\"none\""],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," Hickory,"], ["text.xml"," Hickory,"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","text"], ["meta.tag.tag-name.xml","text"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"meta.tag.punctuation.begin0", "meta.tag.punctuation.tag-open.xml1",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","text"] ["meta.tag.tag-name.xml","text"]
],[ ],[
"meta.tag.punctuation.begin0", "meta.tag.punctuation.tag-open.xml1",
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","style"], ["entity.other.attribute-name.xml","style"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"font-size:144px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans Bold\""] ["string.attribute-value.xml","\"font-size:144px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans Bold\""]
],[ ],[
"meta.tag.punctuation.begin0", "meta.tag.punctuation.tag-open.xml1",
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","x"], ["entity.other.attribute-name.xml","x"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"50\""] ["string.attribute-value.xml","\"50\""]
],[ ],[
"meta.tag.punctuation.begin0", "meta.tag.punctuation.tag-open.xml1",
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","y"], ["entity.other.attribute-name.xml","y"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"350\""] ["string.attribute-value.xml","\"350\""]
],[ ],[
"meta.tag.punctuation.begin0", "meta.tag.punctuation.tag-open.xml1",
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","id"], ["entity.other.attribute-name.xml","id"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"dickory\""] ["string.attribute-value.xml","\"dickory\""]
],[ ],[
"start", "start",
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","display"], ["entity.other.attribute-name.xml","display"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"none\""], ["string.attribute-value.xml","\"none\""],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," dickory,"], ["text.xml"," dickory,"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","text"], ["meta.tag.tag-name.xml","text"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"meta.tag.punctuation.begin0", "meta.tag.punctuation.tag-open.xml1",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","text"] ["meta.tag.tag-name.xml","text"]
],[ ],[
"meta.tag.punctuation.begin0", "meta.tag.punctuation.tag-open.xml1",
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","style"], ["entity.other.attribute-name.xml","style"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"font-size:144px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans Bold\""] ["string.attribute-value.xml","\"font-size:144px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;fill:#000000;fill-opacity:1;stroke:none;font-family:Bitstream Vera Sans;-inkscape-font-specification:Bitstream Vera Sans Bold\""]
],[ ],[
"meta.tag.punctuation.begin0", "meta.tag.punctuation.tag-open.xml1",
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","x"], ["entity.other.attribute-name.xml","x"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"50\""] ["string.attribute-value.xml","\"50\""]
],[ ],[
"meta.tag.punctuation.begin0", "meta.tag.punctuation.tag-open.xml1",
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","y"], ["entity.other.attribute-name.xml","y"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"350\""] ["string.attribute-value.xml","\"350\""]
],[ ],[
"meta.tag.punctuation.begin0", "meta.tag.punctuation.tag-open.xml1",
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","id"], ["entity.other.attribute-name.xml","id"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"dock\""] ["string.attribute-value.xml","\"dock\""]
],[ ],[
"start", "start",
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","display"], ["entity.other.attribute-name.xml","display"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"none\""], ["string.attribute-value.xml","\"none\""],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," dock!"], ["text.xml"," dock!"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","text"], ["meta.tag.tag-name.xml","text"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","svg"], ["meta.tag.tag-name.xml","svg"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
]] ]]

View file

@ -1,56 +1,56 @@
[[ [[
"start", "start",
["punctuation.doctype.begin","<!"], ["xml-pe.doctype.xml","<!"],
["meta.tag.doctype","DOCTYPE"], ["xml-pe.doctype.xml","DOCTYPE"],
["text"," "], ["text.whitespace.xml"," "],
["xml-pe","html"], ["xml-pe.xml","html"],
["punctuation.doctype.end",">"] ["xml-pe.doctype.xml",">"]
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","html"], ["meta.tag.tag-name.xml","html"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","head"], ["meta.tag.tag-name.xml","head"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","title"], ["meta.tag.tag-name.xml","title"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["text","My Webpage"], ["text.xml","My Webpage"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","title"], ["meta.tag.tag-name.xml","title"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","head"], ["meta.tag.tag-name.xml","head"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","body"], ["meta.tag.tag-name.xml","body"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","ul"], ["meta.tag.tag-name.xml","ul"],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","id"], ["entity.other.attribute-name.xml","id"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"navigation\""], ["string.attribute-value.xml","\"navigation\""],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.twig","{%"], ["meta.tag.twig","{%"],
["text"," "], ["text"," "],
["keyword.control.twig","for"], ["keyword.control.twig","for"],
@ -64,16 +64,16 @@
["meta.tag.twig","%}"] ["meta.tag.twig","%}"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","li"], ["meta.tag.tag-name.xml","li"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.anchor","a"], ["meta.tag.anchor.tag-name.xml","a"],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","href"], ["entity.other.attribute-name.xml","href"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\""], ["string.attribute-value.xml","\""],
["variable.other.readwrite.local.twig","{{"], ["variable.other.readwrite.local.twig","{{"],
["text"," "], ["text"," "],
["identifier","item"], ["identifier","item"],
@ -83,8 +83,8 @@
["support.function.twig","escape"], ["support.function.twig","escape"],
["text"," "], ["text"," "],
["variable.other.readwrite.local.twig","}}"], ["variable.other.readwrite.local.twig","}}"],
["string","\""], ["string.attribute-value.xml","\""],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["variable.other.readwrite.local.twig","{{"], ["variable.other.readwrite.local.twig","{{"],
["text"," "], ["text"," "],
["identifier","item"], ["identifier","item"],
@ -92,15 +92,15 @@
["identifier","caption"], ["identifier","caption"],
["text"," "], ["text"," "],
["variable.other.readwrite.local.twig","}}"], ["variable.other.readwrite.local.twig","}}"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name.anchor","a"], ["meta.tag.anchor.tag-name.xml","a"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","li"], ["meta.tag.tag-name.xml","li"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.twig","{%"], ["meta.tag.twig","{%"],
["text"," "], ["text"," "],
["keyword.control.twig","endfor"], ["keyword.control.twig","endfor"],
@ -108,15 +108,15 @@
["meta.tag.twig","%}"] ["meta.tag.twig","%}"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","ul"], ["meta.tag.tag-name.xml","ul"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start" "start"
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.twig","{%"], ["meta.tag.twig","{%"],
["text"," "], ["text"," "],
["keyword.control.twig","if"], ["keyword.control.twig","if"],
@ -142,11 +142,11 @@
"start" "start"
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["comment.block.twig","{# is equivalent to #}"] ["comment.block.twig","{# is equivalent to #}"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.twig","{%"], ["meta.tag.twig","{%"],
["text"," "], ["text"," "],
["keyword.control.twig","if"], ["keyword.control.twig","if"],
@ -173,7 +173,7 @@
"start" "start"
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.twig","{%"], ["meta.tag.twig","{%"],
["text"," "], ["text"," "],
["keyword.control.twig","autoescape"], ["keyword.control.twig","autoescape"],
@ -183,7 +183,7 @@
["meta.tag.twig","%}"] ["meta.tag.twig","%}"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["variable.other.readwrite.local.twig","{{"], ["variable.other.readwrite.local.twig","{{"],
["text"," "], ["text"," "],
["identifier","var"], ["identifier","var"],
@ -191,7 +191,7 @@
["variable.other.readwrite.local.twig","}}"] ["variable.other.readwrite.local.twig","}}"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["variable.other.readwrite.local.twig","{{"], ["variable.other.readwrite.local.twig","{{"],
["text"," "], ["text"," "],
["identifier","var"], ["identifier","var"],
@ -199,11 +199,11 @@
["support.function.twig","raw"], ["support.function.twig","raw"],
["text"," "], ["text"," "],
["variable.other.readwrite.local.twig","}}"], ["variable.other.readwrite.local.twig","}}"],
["text"," "], ["text.xml"," "],
["comment.block.twig","{# var won't be escaped #}"] ["comment.block.twig","{# var won't be escaped #}"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["variable.other.readwrite.local.twig","{{"], ["variable.other.readwrite.local.twig","{{"],
["text"," "], ["text"," "],
["identifier","var"], ["identifier","var"],
@ -211,11 +211,11 @@
["support.function.twig","escape"], ["support.function.twig","escape"],
["text"," "], ["text"," "],
["variable.other.readwrite.local.twig","}}"], ["variable.other.readwrite.local.twig","}}"],
["text"," "], ["text.xml"," "],
["comment.block.twig","{# var won't be doubled-escaped #}"] ["comment.block.twig","{# var won't be doubled-escaped #}"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.twig","{%"], ["meta.tag.twig","{%"],
["text"," "], ["text"," "],
["keyword.control.twig","endautoescape"], ["keyword.control.twig","endautoescape"],
@ -225,7 +225,7 @@
"start" "start"
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["variable.other.readwrite.local.twig","{{"], ["variable.other.readwrite.local.twig","{{"],
["text"," "], ["text"," "],
["keyword.control.twig","include"], ["keyword.control.twig","include"],
@ -245,7 +245,7 @@
"start" "start"
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["variable.other.readwrite.local.twig","{{"], ["variable.other.readwrite.local.twig","{{"],
["string","\"string "], ["string","\"string "],
["constant.language.escape","#{with}"], ["constant.language.escape","#{with}"],
@ -258,17 +258,17 @@
["variable.other.readwrite.local.twig","}}"] ["variable.other.readwrite.local.twig","}}"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","h1"], ["meta.tag.tag-name.xml","h1"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["text","My Webpage"], ["text.xml","My Webpage"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","h1"], ["meta.tag.tag-name.xml","h1"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["variable.other.readwrite.local.twig","{{"], ["variable.other.readwrite.local.twig","{{"],
["text"," "], ["text"," "],
["identifier","a_variable"], ["identifier","a_variable"],
@ -276,13 +276,13 @@
["variable.other.readwrite.local.twig","}}"] ["variable.other.readwrite.local.twig","}}"]
],[ ],[
"start", "start",
["text"," "], ["text.xml"," "],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","body"], ["meta.tag.tag-name.xml","body"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","html"], ["meta.tag.tag-name.xml","html"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
]] ]]

View file

@ -26,15 +26,15 @@
],[ ],[
"start", "start",
["text"," "], ["text"," "],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","li"], ["meta.tag.tag-name.xml","li"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["variable","${"], ["variable","${"],
["identifier","item"], ["identifier","item"],
["variable","}"], ["variable","}"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","li"], ["meta.tag.tag-name.xml","li"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["keyword","#end"] ["keyword","#end"]
@ -55,11 +55,14 @@
["text"," "], ["text"," "],
["lparen","["], ["lparen","["],
["constant.numeric","1"], ["constant.numeric","1"],
["text",", "], ["text.xml",","],
["text"," "],
["constant.numeric","2"], ["constant.numeric","2"],
["text",", "], ["text.xml",","],
["text"," "],
["constant.numeric","3"], ["constant.numeric","3"],
["text",", "], ["text.xml",","],
["text"," "],
["constant.numeric","4"], ["constant.numeric","4"],
["rparen","]"], ["rparen","]"],
["text"," "], ["text"," "],
@ -68,9 +71,9 @@
"start" "start"
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","ul"], ["meta.tag.tag-name.xml","ul"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text"," "], ["text"," "],
@ -97,11 +100,12 @@
["lparen","("], ["lparen","("],
["text"," "], ["text"," "],
["support.function","$_MathTool"], ["support.function","$_MathTool"],
["text","."], ["text.xml","."],
["identifier","mod"], ["identifier","mod"],
["lparen","("], ["lparen","("],
["variable","$item"], ["variable","$item"],
["text",", "], ["text.xml",","],
["text"," "],
["constant.numeric","2"], ["constant.numeric","2"],
["rparen",")"], ["rparen",")"],
["text"," "], ["text"," "],
@ -128,16 +132,16 @@
["keyword","#end"] ["keyword","#end"]
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","ul"], ["meta.tag.tag-name.xml","ul"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start" "start"
],[ ],[
"js-start", "js-start",
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.script","script"], ["meta.tag.script.tag-name.xml","script"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"js-comment_regex_allowed", "js-comment_regex_allowed",
["text"," "], ["text"," "],
@ -216,16 +220,16 @@
["paren.rparen","}"] ["paren.rparen","}"]
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name.script","script"], ["meta.tag.script.tag-name.xml","script"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start" "start"
],[ ],[
"css-start", "css-start",
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name.style","style"], ["meta.tag.style.tag-name.xml","style"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
["css-comment","css-start"], ["css-comment","css-start"],
["text"," "], ["text"," "],
@ -275,7 +279,7 @@
["paren.rparen","}"] ["paren.rparen","}"]
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name.style","style"], ["meta.tag.style.tag-name.xml","style"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
]] ]]

View file

@ -1,43 +1,43 @@
[[ [[
"start", "start",
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","Juhu"], ["meta.tag.tag-name.xml","Juhu"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["text","//Juhu Kinners"], ["text.xml","//Juhu Kinners"],
["meta.tag.punctuation.begin","</"], ["meta.tag.punctuation.end-tag-open.xml","</"],
["meta.tag.name","Kinners"], ["meta.tag.tag-name.xml","Kinners"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text","test: two tags in the same lines should be in separate tokens\""] ["text.xml","test: two tags in the same lines should be in separate tokens\""]
],[ ],[
"start", "start",
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","Juhu"], ["meta.tag.tag-name.xml","Juhu"],
["meta.tag.punctuation.end",">"], ["meta.tag.punctuation.tag-close.xml",">"],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","Kinners"], ["meta.tag.tag-name.xml","Kinners"],
["meta.tag.punctuation.end",">"] ["meta.tag.punctuation.tag-close.xml",">"]
],[ ],[
"start", "start",
["text","test: multiline attributes\""] ["text.xml","test: multiline attributes\""]
],[ ],[
["qqstring_inner","meta.tag.punctuation.begin"], ["string.attribute-value.xml0","meta.tag.punctuation.tag-open.xml"],
["meta.tag.punctuation.begin","<"], ["meta.tag.punctuation.tag-open.xml","<"],
["meta.tag.name","copy"], ["meta.tag.tag-name.xml","copy"],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","set"], ["entity.other.attribute-name.xml","set"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"{"] ["string.attribute-value.xml","\"{"]
],[ ],[
["qqstring_inner","meta.tag.punctuation.begin"], ["string.attribute-value.xml0","meta.tag.punctuation.tag-open.xml"],
["string","}\""], ["string.attribute-value.xml","}\""],
["text"," "], ["text.tag-whitespace.xml"," "],
["entity.other.attribute-name","undo"], ["entity.other.attribute-name.xml","undo"],
["keyword.operator.separator","="], ["keyword.operator.attribute-equals.xml","="],
["string","\"{"] ["string.attribute-value.xml","\"{"]
],[ ],[
"start", "start",
["string","}\""], ["string.attribute-value.xml","}\""],
["meta.tag.punctuation.end","/>"] ["meta.tag.punctuation.tag-close.xml","/>"]
]] ]]

View file

@ -1,95 +0,0 @@
/* ***** BEGIN LICENSE BLOCK *****
* Distributed under the BSD license:
*
* Copyright (c) 2010, Ajax.org B.V.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of Ajax.org B.V. nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* ***** END LICENSE BLOCK ***** */
define(function(require, exports, module) {
"use strict";
var oop = require("../../lib/oop");
var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
var TokenIterator = require("../../token_iterator").TokenIterator;
var voidElements = ['area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr'];
function hasType(token, type) {
var hasType = true;
var typeList = token.type.split('.');
var needleList = type.split('.');
needleList.forEach(function(needle){
if (typeList.indexOf(needle) == -1) {
hasType = false;
return false;
}
});
return hasType;
}
var CfmlBehaviour = function () {
this.inherit(XmlBehaviour); // Get xml behaviour
this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
if (text == '>') {
var position = editor.getCursorPosition();
var iterator = new TokenIterator(session, position.row, position.column);
var token = iterator.getCurrentToken();
if (token && hasType(token, 'meta.tag.name') && /^cf+(abort|application|argument|associate|break|cache|collection|cookie|dbinfo|directory|dump|else|elseif|error|exchangecalendar|exchangeconnection|exchangecontact|exchangefilter|exchangetask|exit|feed|file|flush|ftp|header|htmlhead|httpparam|image|import|include|index|insert|invokeargument|location|log|mailparam|NTauthenticate|object|objectcache|param|pdfformparam|print|procparam|procresult|property|queryparam|registry|reportparam|rethrow|return|schedule|search|set|setting|throw|zipparam)$/gi.test(token.value))
return;
if (hasType(token, 'string') && iterator.getCurrentTokenColumn() + token.value.length > position.column)
return;
var atCursor = false;
if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){
do {
token = iterator.stepBackward();
} while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text')));
} else {
atCursor = true;
}
if (!token || !hasType(token, 'meta.tag.name') || iterator.stepBackward().value.match('/')) {
return
}
var element = token.value;
if (atCursor){
var element = element.substring(0, position.column - token.start);
}
if (voidElements.indexOf(element) !== -1){
return;
}
return {
text: '>' + '</' + element + '>',
selection: [1, 1]
}
}
});
}
oop.inherits(CfmlBehaviour, XmlBehaviour);
exports.CfmlBehaviour = CfmlBehaviour;
});

View file

@ -41,89 +41,34 @@ var SAFE_INSERT_IN_TOKENS =
var SAFE_INSERT_BEFORE_TOKENS = var SAFE_INSERT_BEFORE_TOKENS =
["text", "paren.rparen", "punctuation.operator", "comment"]; ["text", "paren.rparen", "punctuation.operator", "comment"];
var context;
var contextCache = {}
var initContext = function(editor) {
var id = -1;
if (editor.multiSelect) {
id = editor.selection.id;
if (contextCache.rangeCount != editor.multiSelect.rangeCount)
contextCache = {rangeCount: editor.multiSelect.rangeCount};
}
if (contextCache[id])
return context = contextCache[id];
context = contextCache[id] = {
autoInsertedBrackets: 0,
autoInsertedRow: -1,
autoInsertedLineEnd: "",
maybeInsertedBrackets: 0,
maybeInsertedRow: -1,
maybeInsertedLineStart: "",
maybeInsertedLineEnd: ""
};
};
var autoInsertedBrackets = 0; var CstyleBehaviour = function() {
var autoInsertedRow = -1; this.add("braces", "insertion", function(state, action, editor, session, text) {
var autoInsertedLineEnd = "";
var maybeInsertedBrackets = 0;
var maybeInsertedRow = -1;
var maybeInsertedLineStart = "";
var maybeInsertedLineEnd = "";
var CstyleBehaviour = function () {
CstyleBehaviour.isSaneInsertion = function(editor, session) {
var cursor = editor.getCursorPosition();
var iterator = new TokenIterator(session, cursor.row, cursor.column);
// Don't insert in the middle of a keyword/identifier/lexical
if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) {
// Look ahead in case we're at the end of a token
var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1);
if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS))
return false;
}
// Only insert in front of whitespace/comments
iterator.stepForward();
return iterator.getCurrentTokenRow() !== cursor.row ||
this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS);
};
CstyleBehaviour.$matchTokenType = function(token, types) {
return types.indexOf(token.type || token) > -1;
};
CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) {
var cursor = editor.getCursorPosition();
var line = session.doc.getLine(cursor.row);
// Reset previous state if text or context changed too much
if (!this.isAutoInsertedClosing(cursor, line, autoInsertedLineEnd[0]))
autoInsertedBrackets = 0;
autoInsertedRow = cursor.row;
autoInsertedLineEnd = bracket + line.substr(cursor.column);
autoInsertedBrackets++;
};
CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) {
var cursor = editor.getCursorPosition();
var line = session.doc.getLine(cursor.row);
if (!this.isMaybeInsertedClosing(cursor, line))
maybeInsertedBrackets = 0;
maybeInsertedRow = cursor.row;
maybeInsertedLineStart = line.substr(0, cursor.column) + bracket;
maybeInsertedLineEnd = line.substr(cursor.column);
maybeInsertedBrackets++;
};
CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) {
return autoInsertedBrackets > 0 &&
cursor.row === autoInsertedRow &&
bracket === autoInsertedLineEnd[0] &&
line.substr(cursor.column) === autoInsertedLineEnd;
};
CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) {
return maybeInsertedBrackets > 0 &&
cursor.row === maybeInsertedRow &&
line.substr(cursor.column) === maybeInsertedLineEnd &&
line.substr(0, cursor.column) == maybeInsertedLineStart;
};
CstyleBehaviour.popAutoInsertedClosing = function() {
autoInsertedLineEnd = autoInsertedLineEnd.substr(1);
autoInsertedBrackets--;
};
CstyleBehaviour.clearMaybeInsertedClosing = function() {
maybeInsertedBrackets = 0;
maybeInsertedRow = -1;
};
this.add("braces", "insertion", function (state, action, editor, session, text) {
var cursor = editor.getCursorPosition(); var cursor = editor.getCursorPosition();
var line = session.doc.getLine(cursor.row); var line = session.doc.getLine(cursor.row);
if (text == '{') { if (text == '{') {
initContext(editor);
var selection = editor.getSelectionRange(); var selection = editor.getSelectionRange();
var selected = session.doc.getTextRange(selection); var selected = session.doc.getTextRange(selection);
if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) { if (selected !== "" && selected !== "{" && editor.getWrapBehavioursEnabled()) {
@ -147,6 +92,7 @@ var CstyleBehaviour = function () {
} }
} }
} else if (text == '}') { } else if (text == '}') {
initContext(editor);
var rightChar = line.substring(cursor.column, cursor.column + 1); var rightChar = line.substring(cursor.column, cursor.column + 1);
if (rightChar == '}') { if (rightChar == '}') {
var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row}); var matching = session.$findOpeningBracket('}', {column: cursor.column + 1, row: cursor.row});
@ -159,9 +105,10 @@ var CstyleBehaviour = function () {
} }
} }
} else if (text == "\n" || text == "\r\n") { } else if (text == "\n" || text == "\r\n") {
initContext(editor);
var closing = ""; var closing = "";
if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) { if (CstyleBehaviour.isMaybeInsertedClosing(cursor, line)) {
closing = lang.stringRepeat("}", maybeInsertedBrackets); closing = lang.stringRepeat("}", context.maybeInsertedBrackets);
CstyleBehaviour.clearMaybeInsertedClosing(); CstyleBehaviour.clearMaybeInsertedClosing();
} }
var rightChar = line.substring(cursor.column, cursor.column + 1); var rightChar = line.substring(cursor.column, cursor.column + 1);
@ -173,6 +120,7 @@ var CstyleBehaviour = function () {
} else if (closing) { } else if (closing) {
var next_indent = this.$getIndent(line); var next_indent = this.$getIndent(line);
} else { } else {
CstyleBehaviour.clearMaybeInsertedClosing();
return; return;
} }
var indent = next_indent + session.getTabString(); var indent = next_indent + session.getTabString();
@ -186,22 +134,24 @@ var CstyleBehaviour = function () {
} }
}); });
this.add("braces", "deletion", function (state, action, editor, session, range) { this.add("braces", "deletion", function(state, action, editor, session, range) {
var selected = session.doc.getTextRange(range); var selected = session.doc.getTextRange(range);
if (!range.isMultiLine() && selected == '{') { if (!range.isMultiLine() && selected == '{') {
initContext(editor);
var line = session.doc.getLine(range.start.row); var line = session.doc.getLine(range.start.row);
var rightChar = line.substring(range.end.column, range.end.column + 1); var rightChar = line.substring(range.end.column, range.end.column + 1);
if (rightChar == '}') { if (rightChar == '}') {
range.end.column++; range.end.column++;
return range; return range;
} else { } else {
maybeInsertedBrackets--; context.maybeInsertedBrackets--;
} }
} }
}); });
this.add("parens", "insertion", function (state, action, editor, session, text) { this.add("parens", "insertion", function(state, action, editor, session, text) {
if (text == '(') { if (text == '(') {
initContext(editor);
var selection = editor.getSelectionRange(); var selection = editor.getSelectionRange();
var selected = session.doc.getTextRange(selection); var selected = session.doc.getTextRange(selection);
if (selected !== "" && editor.getWrapBehavioursEnabled()) { if (selected !== "" && editor.getWrapBehavioursEnabled()) {
@ -217,6 +167,7 @@ var CstyleBehaviour = function () {
}; };
} }
} else if (text == ')') { } else if (text == ')') {
initContext(editor);
var cursor = editor.getCursorPosition(); var cursor = editor.getCursorPosition();
var line = session.doc.getLine(cursor.row); var line = session.doc.getLine(cursor.row);
var rightChar = line.substring(cursor.column, cursor.column + 1); var rightChar = line.substring(cursor.column, cursor.column + 1);
@ -233,9 +184,10 @@ var CstyleBehaviour = function () {
} }
}); });
this.add("parens", "deletion", function (state, action, editor, session, range) { this.add("parens", "deletion", function(state, action, editor, session, range) {
var selected = session.doc.getTextRange(range); var selected = session.doc.getTextRange(range);
if (!range.isMultiLine() && selected == '(') { if (!range.isMultiLine() && selected == '(') {
initContext(editor);
var line = session.doc.getLine(range.start.row); var line = session.doc.getLine(range.start.row);
var rightChar = line.substring(range.start.column + 1, range.start.column + 2); var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
if (rightChar == ')') { if (rightChar == ')') {
@ -245,8 +197,9 @@ var CstyleBehaviour = function () {
} }
}); });
this.add("brackets", "insertion", function (state, action, editor, session, text) { this.add("brackets", "insertion", function(state, action, editor, session, text) {
if (text == '[') { if (text == '[') {
initContext(editor);
var selection = editor.getSelectionRange(); var selection = editor.getSelectionRange();
var selected = session.doc.getTextRange(selection); var selected = session.doc.getTextRange(selection);
if (selected !== "" && editor.getWrapBehavioursEnabled()) { if (selected !== "" && editor.getWrapBehavioursEnabled()) {
@ -262,6 +215,7 @@ var CstyleBehaviour = function () {
}; };
} }
} else if (text == ']') { } else if (text == ']') {
initContext(editor);
var cursor = editor.getCursorPosition(); var cursor = editor.getCursorPosition();
var line = session.doc.getLine(cursor.row); var line = session.doc.getLine(cursor.row);
var rightChar = line.substring(cursor.column, cursor.column + 1); var rightChar = line.substring(cursor.column, cursor.column + 1);
@ -278,9 +232,10 @@ var CstyleBehaviour = function () {
} }
}); });
this.add("brackets", "deletion", function (state, action, editor, session, range) { this.add("brackets", "deletion", function(state, action, editor, session, range) {
var selected = session.doc.getTextRange(range); var selected = session.doc.getTextRange(range);
if (!range.isMultiLine() && selected == '[') { if (!range.isMultiLine() && selected == '[') {
initContext(editor);
var line = session.doc.getLine(range.start.row); var line = session.doc.getLine(range.start.row);
var rightChar = line.substring(range.start.column + 1, range.start.column + 2); var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
if (rightChar == ']') { if (rightChar == ']') {
@ -290,8 +245,9 @@ var CstyleBehaviour = function () {
} }
}); });
this.add("string_dquotes", "insertion", function (state, action, editor, session, text) { this.add("string_dquotes", "insertion", function(state, action, editor, session, text) {
if (text == '"' || text == "'") { if (text == '"' || text == "'") {
initContext(editor);
var quote = text; var quote = text;
var selection = editor.getSelectionRange(); var selection = editor.getSelectionRange();
var selected = session.doc.getTextRange(selection); var selected = session.doc.getTextRange(selection);
@ -350,9 +306,10 @@ var CstyleBehaviour = function () {
} }
}); });
this.add("string_dquotes", "deletion", function (state, action, editor, session, range) { this.add("string_dquotes", "deletion", function(state, action, editor, session, range) {
var selected = session.doc.getTextRange(range); var selected = session.doc.getTextRange(range);
if (!range.isMultiLine() && (selected == '"' || selected == "'")) { if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
initContext(editor);
var line = session.doc.getLine(range.start.row); var line = session.doc.getLine(range.start.row);
var rightChar = line.substring(range.start.column + 1, range.start.column + 2); var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
if (rightChar == selected) { if (rightChar == selected) {
@ -364,6 +321,79 @@ var CstyleBehaviour = function () {
}; };
CstyleBehaviour.isSaneInsertion = function(editor, session) {
var cursor = editor.getCursorPosition();
var iterator = new TokenIterator(session, cursor.row, cursor.column);
// Don't insert in the middle of a keyword/identifier/lexical
if (!this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS)) {
// Look ahead in case we're at the end of a token
var iterator2 = new TokenIterator(session, cursor.row, cursor.column + 1);
if (!this.$matchTokenType(iterator2.getCurrentToken() || "text", SAFE_INSERT_IN_TOKENS))
return false;
}
// Only insert in front of whitespace/comments
iterator.stepForward();
return iterator.getCurrentTokenRow() !== cursor.row ||
this.$matchTokenType(iterator.getCurrentToken() || "text", SAFE_INSERT_BEFORE_TOKENS);
};
CstyleBehaviour.$matchTokenType = function(token, types) {
return types.indexOf(token.type || token) > -1;
};
CstyleBehaviour.recordAutoInsert = function(editor, session, bracket) {
var cursor = editor.getCursorPosition();
var line = session.doc.getLine(cursor.row);
// Reset previous state if text or context changed too much
if (!this.isAutoInsertedClosing(cursor, line, context.autoInsertedLineEnd[0]))
context.autoInsertedBrackets = 0;
context.autoInsertedRow = cursor.row;
context.autoInsertedLineEnd = bracket + line.substr(cursor.column);
context.autoInsertedBrackets++;
};
CstyleBehaviour.recordMaybeInsert = function(editor, session, bracket) {
var cursor = editor.getCursorPosition();
var line = session.doc.getLine(cursor.row);
if (!this.isMaybeInsertedClosing(cursor, line))
context.maybeInsertedBrackets = 0;
context.maybeInsertedRow = cursor.row;
context.maybeInsertedLineStart = line.substr(0, cursor.column) + bracket;
context.maybeInsertedLineEnd = line.substr(cursor.column);
context.maybeInsertedBrackets++;
};
CstyleBehaviour.isAutoInsertedClosing = function(cursor, line, bracket) {
return context.autoInsertedBrackets > 0 &&
cursor.row === context.autoInsertedRow &&
bracket === context.autoInsertedLineEnd[0] &&
line.substr(cursor.column) === context.autoInsertedLineEnd;
};
CstyleBehaviour.isMaybeInsertedClosing = function(cursor, line) {
return context.maybeInsertedBrackets > 0 &&
cursor.row === context.maybeInsertedRow &&
line.substr(cursor.column) === context.maybeInsertedLineEnd &&
line.substr(0, cursor.column) == context.maybeInsertedLineStart;
};
CstyleBehaviour.popAutoInsertedClosing = function() {
context.autoInsertedLineEnd = context.autoInsertedLineEnd.substr(1);
context.autoInsertedBrackets--;
};
CstyleBehaviour.clearMaybeInsertedClosing = function() {
if (context) {
context.maybeInsertedBrackets = 0;
context.maybeInsertedRow = -1;
}
};
oop.inherits(CstyleBehaviour, Behaviour); oop.inherits(CstyleBehaviour, Behaviour);
exports.CstyleBehaviour = CstyleBehaviour; exports.CstyleBehaviour = CstyleBehaviour;

View file

@ -33,55 +33,13 @@ define(function(require, exports, module) {
var oop = require("../../lib/oop"); var oop = require("../../lib/oop");
var XmlBehaviour = require("../behaviour/xml").XmlBehaviour; var XmlBehaviour = require("../behaviour/xml").XmlBehaviour;
var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
var TokenIterator = require("../../token_iterator").TokenIterator;
var voidElements = ['area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr'];
function hasType(token, type) {
var tokenTypes = token.type.split('.');
return type.split('.').every(function(type){
return (tokenTypes.indexOf(type) !== -1);
});
return hasType;
}
var HtmlBehaviour = function () { var HtmlBehaviour = function () {
this.inherit(XmlBehaviour); // Get xml behaviour XmlBehaviour.call(this);
this.add("autoclosing", "insertion", function (state, action, editor, session, text) { };
if (text == '>') {
var position = editor.getCursorPosition();
var iterator = new TokenIterator(session, position.row, position.column);
var token = iterator.getCurrentToken();
if (token && hasType(token, 'string') && iterator.getCurrentTokenColumn() + token.value.length > position.column)
return;
var atCursor = false;
if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){
do {
token = iterator.stepBackward();
} while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text')));
} else {
atCursor = true;
}
if (!token || !hasType(token, 'meta.tag.name') || iterator.stepBackward().value.match('/')) {
return;
}
var element = token.value;
if (atCursor){
var element = element.substring(0, position.column - token.start);
}
if (voidElements.indexOf(element) !== -1){
return;
}
return {
text: '>' + '</' + element + '>',
selection: [1, 1]
}
}
});
}
oop.inherits(HtmlBehaviour, XmlBehaviour); oop.inherits(HtmlBehaviour, XmlBehaviour);
exports.HtmlBehaviour = HtmlBehaviour; exports.HtmlBehaviour = HtmlBehaviour;

View file

@ -33,49 +33,116 @@ define(function(require, exports, module) {
var oop = require("../../lib/oop"); var oop = require("../../lib/oop");
var Behaviour = require("../behaviour").Behaviour; var Behaviour = require("../behaviour").Behaviour;
var CstyleBehaviour = require("./cstyle").CstyleBehaviour;
var TokenIterator = require("../../token_iterator").TokenIterator; var TokenIterator = require("../../token_iterator").TokenIterator;
function hasType(token, type) { function is(token, type) {
var tokenTypes = token.type.split('.'); return token.type.lastIndexOf(type + ".xml") > -1;
return type.split('.').every(function(type){
return (tokenTypes.indexOf(type) !== -1);
});
return hasType;
} }
var XmlBehaviour = function () { var XmlBehaviour = function () {
this.inherit(CstyleBehaviour, ["string_dquotes"]); // Get string behaviour this.add("string_dquotes", "insertion", function (state, action, editor, session, text) {
if (text == '"' || text == "'") {
var quote = text;
var selected = session.doc.getTextRange(editor.getSelectionRange());
if (selected !== "" && selected !== "'" && selected != '"' && editor.getWrapBehavioursEnabled()) {
return {
text: quote + selected + quote,
selection: false
};
}
var cursor = editor.getCursorPosition();
var line = session.doc.getLine(cursor.row);
var rightChar = line.substring(cursor.column, cursor.column + 1);
var iterator = new TokenIterator(session, cursor.row, cursor.column);
var token = iterator.getCurrentToken();
if (rightChar == quote && (is(token, "attribute-value") || is(token, "string"))) {
// Ignore input and move right one if we're typing over the closing quote.
return {
text: "",
selection: [1, 1]
};
}
if (!token)
token = iterator.stepBackward();
if (!token)
return;
while (is(token, "tag-whitespace") || is(token, "whitespace")) {
token = iterator.stepBackward();
}
var rightSpace = !rightChar || rightChar.match(/\s/);
if (is(token, "attribute-equals") && (rightSpace || rightChar == '>') || (is(token, "decl-attribute-equals") && (rightSpace || rightChar == '?'))) {
return {
text: quote + quote,
selection: [1, 1]
};
}
}
});
this.add("string_dquotes", "deletion", function(state, action, editor, session, range) {
var selected = session.doc.getTextRange(range);
if (!range.isMultiLine() && (selected == '"' || selected == "'")) {
var line = session.doc.getLine(range.start.row);
var rightChar = line.substring(range.start.column + 1, range.start.column + 2);
if (rightChar == selected) {
range.end.column++;
return range;
}
}
});
this.add("autoclosing", "insertion", function (state, action, editor, session, text) { this.add("autoclosing", "insertion", function (state, action, editor, session, text) {
if (text == '>') { if (text == '>') {
var position = editor.getCursorPosition(); var position = editor.getCursorPosition();
var iterator = new TokenIterator(session, position.row, position.column); var iterator = new TokenIterator(session, position.row, position.column);
var token = iterator.getCurrentToken(); var token = iterator.getCurrentToken() || iterator.stepBackward();
if (token && hasType(token, 'string') && iterator.getCurrentTokenColumn() + token.value.length > position.column) // exit if we're not in a tag
if (!token || !(is(token, "tag-name") || is(token, "tag-whitespace") || is(token, "attribute-name") || is(token, "attribute-equals") || is(token, "attribute-value")))
return; return;
var atCursor = false;
if (!token || !hasType(token, 'meta.tag') && !(hasType(token, 'text') && token.value.match('/'))){ // exit if we're inside of a quoted attribute value
do { if (is(token, "reference.attribute-value"))
token = iterator.stepBackward();
} while (token && (hasType(token, 'string') || hasType(token, 'keyword.operator') || hasType(token, 'entity.attribute-name') || hasType(token, 'text')));
} else {
atCursor = true;
}
if (!token || !hasType(token, 'meta.tag.name') || iterator.stepBackward().value.match('/')) {
return; return;
if (is(token, "attribute-value")) {
var firstChar = token.value.charAt(0);
if (firstChar == '"' || firstChar == "'") {
var lastChar = token.value.charAt(token.value.length - 1);
var tokenEnd = iterator.getCurrentTokenColumn() + token.value.length;
if (tokenEnd > position.column || tokenEnd == position.column && firstChar != lastChar)
return;
}
} }
var tag = token.value;
if (atCursor){ // find tag name
var tag = tag.substring(0, position.column - token.start); while (!is(token, "tag-name")) {
token = iterator.stepBackward();
} }
var tokenRow = iterator.getCurrentTokenRow();
var tokenColumn = iterator.getCurrentTokenColumn();
// exit if the tag is ending
if (is(iterator.stepBackward(), "end-tag-open"))
return;
var element = token.value;
if (tokenRow == position.row)
element = element.substring(0, position.column - tokenColumn);
if (this.voidElements.hasOwnProperty(element.toLowerCase()))
return;
return { return {
text: '>' + '</' + tag + '>', text: '>' + '</' + element + '>',
selection: [1, 1] selection: [1, 1]
} };
} }
}); });
@ -91,12 +158,13 @@ var XmlBehaviour = function () {
return { return {
text: '\n' + indent + '\n' + next_indent, text: '\n' + indent + '\n' + next_indent,
selection: [1, indent.length, 1, indent.length] selection: [1, indent.length, 1, indent.length]
} };
} }
} }
}); });
} };
oop.inherits(XmlBehaviour, Behaviour); oop.inherits(XmlBehaviour, Behaviour);
exports.XmlBehaviour = XmlBehaviour; exports.XmlBehaviour = XmlBehaviour;

View file

@ -47,6 +47,10 @@ var CirruHighlightRules = function() {
}, { }, {
token: 'storage.modifier', token: 'storage.modifier',
regex: /\(/, regex: /\(/,
}, {
token: 'storage.modifier',
regex: /\,/,
next: 'line',
}, { }, {
token: 'support.function', token: 'support.function',
regex: /[^\(\)\"\s]+/, regex: /[^\(\)\"\s]+/,
@ -88,6 +92,10 @@ var CirruHighlightRules = function() {
token: 'markup.raw', token: 'markup.raw',
regex: /^\s*/, regex: /^\s*/,
next: 'start', next: 'start',
}, {
token: 'storage.modifier',
regex: /\$/,
next: 'start',
}, { }, {
token: 'variable.parameter', token: 'variable.parameter',
regex: /[^\(\)\"\s]+/ regex: /[^\(\)\"\s]+/
@ -102,10 +110,6 @@ var CirruHighlightRules = function() {
token: 'markup.raw', token: 'markup.raw',
regex: /^\ */, regex: /^\ */,
next: 'start', next: 'start',
}, {
token: 'storage.modifier',
regex: /\$/,
next: 'start',
}, { }, {
token: 'string.quoted.double', token: 'string.quoted.double',
regex: /"/, regex: /"/,

View file

@ -32,28 +32,25 @@ define(function(require, exports, module) {
"use strict"; "use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var XmlMode = require("./xml").Mode; var lang = require("../lib/lang");
var JavaScriptMode = require("./javascript").Mode; var HtmlMode = require("./html").Mode;
var CssMode = require("./css").Mode;
var Tokenizer = require("../tokenizer").Tokenizer; var Tokenizer = require("../tokenizer").Tokenizer;
var ColdfusionHighlightRules = require("./coldfusion_highlight_rules").ColdfusionHighlightRules; var ColdfusionHighlightRules = require("./coldfusion_highlight_rules").ColdfusionHighlightRules;
var CfmlBehaviour = require("./behaviour/coldfusion").CfmlBehaviour;
var voidElements = "cfabort|cfapplication|cfargument|cfassociate|cfbreak|cfcache|cfcollection|cfcookie|cfdbinfo|cfdirectory|cfdump|cfelse|cfelseif|cferror|cfexchangecalendar|cfexchangeconnection|cfexchangecontact|cfexchangefilter|cfexchangetask|cfexit|cffeed|cffile|cfflush|cfftp|cfheader|cfhtmlhead|cfhttpparam|cfimage|cfimport|cfinclude|cfindex|cfinsert|cfinvokeargument|cflocation|cflog|cfmailparam|cfNTauthenticate|cfobject|cfobjectcache|cfparam|cfpdfformparam|cfprint|cfprocparam|cfprocresult|cfproperty|cfqueryparam|cfregistry|cfreportparam|cfrethrow|cfreturn|cfschedule|cfsearch|cfset|cfsetting|cfthrow|cfzipparam)".split("|");
var Mode = function() { var Mode = function() {
XmlMode.call(this); HtmlMode.call(this);
this.HighlightRules = ColdfusionHighlightRules; this.HighlightRules = ColdfusionHighlightRules;
this.$behaviour = new CfmlBehaviour();
this.createModeDelegates({
"js-": JavaScriptMode,
"css-": CssMode
});
}; };
oop.inherits(Mode, XmlMode); oop.inherits(Mode, HtmlMode);
(function() { (function() {
// mix with html void elements
this.voidElements = oop.mixin(lang.arrayToMap(voidElements), this.voidElements);
this.getNextLineIndent = function(state, line, tab) { this.getNextLineIndent = function(state, line, tab) {
return this.$getIndent(line); return this.$getIndent(line);
}; };

View file

@ -36,39 +36,8 @@ var MixedFoldMode = require("./mixed").FoldMode;
var XmlFoldMode = require("./xml").FoldMode; var XmlFoldMode = require("./xml").FoldMode;
var CStyleFoldMode = require("./cstyle").FoldMode; var CStyleFoldMode = require("./cstyle").FoldMode;
var FoldMode = exports.FoldMode = function() { var FoldMode = exports.FoldMode = function(voidElements, optionalTags) {
MixedFoldMode.call(this, new XmlFoldMode({ MixedFoldMode.call(this, new XmlFoldMode(voidElements, optionalTags), {
// void elements
"area": 1,
"base": 1,
"br": 1,
"col": 1,
"command": 1,
"embed": 1,
"hr": 1,
"img": 1,
"input": 1,
"keygen": 1,
"link": 1,
"meta": 1,
"param": 1,
"source": 1,
"track": 1,
"wbr": 1,
// optional tags
"li": 1,
"dt": 1,
"dd": 1,
"p": 1,
"rt": 1,
"rp": 1,
"optgroup": 1,
"option": 1,
"colgroup": 1,
"td": 1,
"th": 1
}), {
"js-": new CStyleFoldMode(), "js-": new CStyleFoldMode(),
"css-": new CStyleFoldMode() "css-": new CStyleFoldMode()
}); });

View file

@ -37,62 +37,98 @@ var Range = require("../../range").Range;
var BaseFoldMode = require("./fold_mode").FoldMode; var BaseFoldMode = require("./fold_mode").FoldMode;
var TokenIterator = require("../../token_iterator").TokenIterator; var TokenIterator = require("../../token_iterator").TokenIterator;
var FoldMode = exports.FoldMode = function(voidElements) { var FoldMode = exports.FoldMode = function(voidElements, optionalEndTags) {
BaseFoldMode.call(this); BaseFoldMode.call(this);
this.voidElements = voidElements || {}; // TODO folding support for optional end tags
this.voidElements = oop.mixin(voidElements || {}, optionalEndTags || {});
}; };
oop.inherits(FoldMode, BaseFoldMode); oop.inherits(FoldMode, BaseFoldMode);
var Tag = function() {
this.tagName = "";
this.closing = false;
this.selfClosing = false;
this.start = {row: 0, column: 0};
this.end = {row: 0, column: 0};
};
function is(token, type) {
return token.type.lastIndexOf(type + ".xml") > -1;
}
(function() { (function() {
this.getFoldWidget = function(session, foldStyle, row) { this.getFoldWidget = function(session, foldStyle, row) {
var tag = this._getFirstTagInLine(session, row); var tag = this._getFirstTagInLine(session, row);
if (tag.closing) if (!tag)
return "";
if (tag.closing || (!tag.tagName && tag.selfClosing))
return foldStyle == "markbeginend" ? "end" : ""; return foldStyle == "markbeginend" ? "end" : "";
if (!tag.tagName || this.voidElements[tag.tagName.toLowerCase()]) if (!tag.tagName || tag.selfClosing || this.voidElements.hasOwnProperty(tag.tagName.toLowerCase()))
return ""; return "";
if (tag.selfClosing) if (this._findEndTagInLine(session, row, tag.tagName, tag.end.column))
return "";
if (tag.value.indexOf("/" + tag.tagName) !== -1)
return ""; return "";
return "start"; return "start";
}; };
/*
* returns a first tag (or a fragment) in a line
*/
this._getFirstTagInLine = function(session, row) { this._getFirstTagInLine = function(session, row) {
var tokens = session.getTokens(row); var tokens = session.getTokens(row);
var value = ""; var tag = new Tag();
for (var i = 0; i < tokens.length; i++) { for (var i = 0; i < tokens.length; i++) {
var token = tokens[i]; var token = tokens[i];
if (token.type.lastIndexOf("meta.tag", 0) === 0) if (is(token, "tag-open")) {
value += token.value; tag.end.column = tag.start.column + token.value.length;
else tag.closing = is(token, "end-tag-open");
value += lang.stringRepeat(" ", token.value.length); token = tokens[++i];
if (!token)
return null;
tag.tagName = token.value;
tag.end.column += token.value.length;
for (i++; i < tokens.length; i++) {
token = tokens[i];
tag.end.column += token.value.length;
if (is(token, "tag-close")) {
tag.selfClosing = token.value == '/>';
break;
}
}
return tag;
} else if (is(token, "tag-close")) {
tag.selfClosing = token.value == '/>';
return tag;
}
tag.start.column += token.value.length;
} }
return this._parseTag(value); return null;
}; };
this.tagRe = /^(\s*)(<?(\/?)([-_a-zA-Z0-9:!]*)\s*(\/?)>?)/; this._findEndTagInLine = function(session, row, tagName, startColumn) {
this._parseTag = function(tag) { var tokens = session.getTokens(row);
var match = tag.match(this.tagRe);
var column = 0; var column = 0;
for (var i = 0; i < tokens.length; i++) {
return { var token = tokens[i];
value: tag, column += token.value.length;
match: match ? match[2] : "", if (column < startColumn)
closing: match ? !!match[3] : false, continue;
selfClosing: match ? !!match[5] || match[2] == "/>" : false, if (is(token, "end-tag-open")) {
tagName: match ? match[4] : "", token = tokens[i + 1];
column: match[1] ? column + match[1].length : column if (token && token.value == tagName)
}; return true;
}
}
return false;
}; };
/* /*
* reads a full tag and places the iterator after the tag * reads a full tag and places the iterator after the tag
*/ */
@ -100,32 +136,24 @@ oop.inherits(FoldMode, BaseFoldMode);
var token = iterator.getCurrentToken(); var token = iterator.getCurrentToken();
if (!token) if (!token)
return null; return null;
var value = ""; var tag = new Tag();
var start;
do { do {
if (token.type.lastIndexOf("meta.tag", 0) === 0) { if (is(token, "tag-open")) {
if (!start) { tag.closing = is(token, "end-tag-open");
var start = { tag.start.row = iterator.getCurrentTokenRow();
row: iterator.getCurrentTokenRow(), tag.start.column = iterator.getCurrentTokenColumn();
column: iterator.getCurrentTokenColumn() } else if (is(token, "tag-name")) {
}; tag.tagName = token.value;
} } else if (is(token, "tag-close")) {
value += token.value; tag.selfClosing = token.value == "/>";
if (value.indexOf(">") !== -1) { tag.end.row = iterator.getCurrentTokenRow();
var tag = this._parseTag(value); tag.end.column = iterator.getCurrentTokenColumn() + token.value.length;
tag.start = start; iterator.stepForward();
tag.end = { return tag;
row: iterator.getCurrentTokenRow(),
column: iterator.getCurrentTokenColumn() + token.value.length
};
iterator.stepForward();
return tag;
}
} }
} while(token = iterator.stepForward()); } while(token = iterator.stepForward());
return null; return null;
}; };
@ -133,32 +161,24 @@ oop.inherits(FoldMode, BaseFoldMode);
var token = iterator.getCurrentToken(); var token = iterator.getCurrentToken();
if (!token) if (!token)
return null; return null;
var value = "";
var end;
var tag = new Tag();
do { do {
if (token.type.lastIndexOf("meta.tag", 0) === 0) { if (is(token, "tag-open")) {
if (!end) { tag.closing = is(token, "end-tag-open");
end = { tag.start.row = iterator.getCurrentTokenRow();
row: iterator.getCurrentTokenRow(), tag.start.column = iterator.getCurrentTokenColumn();
column: iterator.getCurrentTokenColumn() + token.value.length iterator.stepBackward();
}; return tag;
} } else if (is(token, "tag-name")) {
value = token.value + value; tag.tagName = token.value;
if (value.indexOf("<") !== -1) { } else if (is(token, "tag-close")) {
var tag = this._parseTag(value); tag.selfClosing = token.value == "/>";
tag.end = end; tag.end.row = iterator.getCurrentTokenRow();
tag.start = { tag.end.column = iterator.getCurrentTokenColumn() + token.value.length;
row: iterator.getCurrentTokenRow(),
column: iterator.getCurrentTokenColumn()
};
iterator.stepBackward();
return tag;
}
} }
} while(token = iterator.stepBackward()); } while(token = iterator.stepBackward());
return null; return null;
}; };
@ -169,10 +189,10 @@ oop.inherits(FoldMode, BaseFoldMode);
if (!tag || top.tagName == tag.tagName) { if (!tag || top.tagName == tag.tagName) {
return stack.pop(); return stack.pop();
} }
else if (this.voidElements[tag.tagName]) { else if (this.voidElements.hasOwnProperty(tag.tagName)) {
return; return;
} }
else if (this.voidElements[top.tagName]) { else if (this.voidElements.hasOwnProperty(top.tagName)) {
stack.pop(); stack.pop();
continue; continue;
} else { } else {
@ -184,7 +204,7 @@ oop.inherits(FoldMode, BaseFoldMode);
this.getFoldWidgetRange = function(session, foldStyle, row) { this.getFoldWidgetRange = function(session, foldStyle, row) {
var firstTag = this._getFirstTagInLine(session, row); var firstTag = this._getFirstTagInLine(session, row);
if (!firstTag.match) if (!firstTag)
return null; return null;
var isBackward = firstTag.closing || firstTag.selfClosing; var isBackward = firstTag.closing || firstTag.selfClosing;
@ -192,10 +212,10 @@ oop.inherits(FoldMode, BaseFoldMode);
var tag; var tag;
if (!isBackward) { if (!isBackward) {
var iterator = new TokenIterator(session, row, firstTag.column); var iterator = new TokenIterator(session, row, firstTag.start.column);
var start = { var start = {
row: row, row: row,
column: firstTag.column + firstTag.tagName.length + 2 column: firstTag.start.column + firstTag.tagName.length + 2
}; };
while (tag = this._readTagForward(iterator)) { while (tag = this._readTagForward(iterator)) {
if (tag.selfClosing) { if (tag.selfClosing) {
@ -213,15 +233,15 @@ oop.inherits(FoldMode, BaseFoldMode);
return Range.fromPoints(start, tag.start); return Range.fromPoints(start, tag.start);
} }
else { else {
stack.push(tag) stack.push(tag);
} }
} }
} }
else { else {
var iterator = new TokenIterator(session, row, firstTag.column + firstTag.match.length); var iterator = new TokenIterator(session, row, firstTag.end.column);
var end = { var end = {
row: row, row: row,
column: firstTag.column column: firstTag.start.column
}; };
while (tag = this._readTagBackward(iterator)) { while (tag = this._readTagBackward(iterator)) {
@ -242,7 +262,7 @@ oop.inherits(FoldMode, BaseFoldMode);
} }
} }
else { else {
stack.push(tag) stack.push(tag);
} }
} }
} }

81
lib/ace/mode/gherkin.js Normal file
View file

@ -0,0 +1,81 @@
/* ***** BEGIN LICENSE BLOCK *****
* Distributed under the BSD license:
*
* Copyright (c) 2014, 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) {
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var Tokenizer = require("../tokenizer").Tokenizer;
var GherkinHighlightRules = require("./gherkin_highlight_rules").GherkinHighlightRules;
var Mode = function() {
this.HighlightRules = GherkinHighlightRules;
};
oop.inherits(Mode, TextMode);
(function() {
this.lineCommentStart = "#";
this.$id = "ace/mode/gherkin";
this.getNextLineIndent = function(state, line, tab) {
var indent = this.$getIndent(line);
var space2 = " ";
var tokenizedLine = this.getTokenizer().getLineTokens(line, state);
var tokens = tokenizedLine.tokens;
console.log(state)
if(line.match("[ ]*\\|")) {
indent += "| ";
}
if (tokens.length && tokens[tokens.length-1].type == "comment") {
return indent;
}
if (state == "start") {
if (line.match("Scenario:|Feature:|Scenario\ Outline:|Background:")) {
indent += space2;
} else if(line.match("(Given|Then).+(:)$|Examples:")) {
indent += space2;
} else if(line.match("\\*.+")) {
indent += "* ";
}
}
return indent;
};
}).call(Mode.prototype);
exports.Mode = Mode;
});

View file

@ -0,0 +1,113 @@
/* ***** BEGIN LICENSE BLOCK *****
* Distributed under the BSD license:
*
* Copyright (c) 2014, 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) {
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var stringEscape = "\\\\(x[0-9A-Fa-f]{2}|[0-7]{3}|[\\\\abfnrtv'\"]|U[0-9A-Fa-f]{8}|u[0-9A-Fa-f]{4})";
var GherkinHighlightRules = function() {
// need to include constant ints
this.$rules = {
start : [{
token: 'constant.numeric',
regex: "(?:(?:[1-9]\\d*)|(?:0))"
}, {
token : "comment",
regex : "#.*$"
}, {
token : "keyword",
regex : "Feature:|Background:|Scenario:|Scenario\ Outline:|Examples:|Given|When|Then|And|But|\\*",
}, {
token : "string", // multi line """ string start
regex : '"{3}',
next : "qqstring3"
}, {
token : "string", // " string
regex : '"',
next : "qqstring"
}, {
token : "comment",
regex : "@[A-Za-z0-9]+",
next : "start"
}, {
token : "comment",
regex : "<.+>"
}, {
token : "comment",
regex : "\\| ",
next : "table-item"
}, {
token : "comment",
regex : "\\|$",
next : "start"
}],
"qqstring3" : [ {
token : "constant.language.escape",
regex : stringEscape
}, {
token : "string", // multi line """ string end
regex : '"{3}',
next : "start"
}, {
defaultToken : "string"
}],
"qqstring" : [{
token : "constant.language.escape",
regex : stringEscape
}, {
token : "string",
regex : "\\\\$",
next : "qqstring"
}, {
token : "string",
regex : '"|$',
next : "start"
}, {
defaultToken: "string"
}],
"table-item" : [{
token : "string",
regex : "[A-Za-z0-9 ]*",
next : "start"
}],
};
//new TextHighlightRules().getRules();
}
oop.inherits(GherkinHighlightRules, TextHighlightRules);
exports.GherkinHighlightRules = GherkinHighlightRules;
});

View file

@ -32,20 +32,25 @@ define(function(require, exports, module) {
"use strict"; "use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var lang = require("../lib/lang");
var TextMode = require("./text").Mode; var TextMode = require("./text").Mode;
var JavaScriptMode = require("./javascript").Mode; var JavaScriptMode = require("./javascript").Mode;
var CssMode = require("./css").Mode; var CssMode = require("./css").Mode;
var Tokenizer = require("../tokenizer").Tokenizer; var Tokenizer = require("../tokenizer").Tokenizer;
var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules; var HtmlHighlightRules = require("./html_highlight_rules").HtmlHighlightRules;
var HtmlBehaviour = require("./behaviour/html").HtmlBehaviour; var XmlBehaviour = require("./behaviour/xml").XmlBehaviour;
var HtmlFoldMode = require("./folding/html").FoldMode; var HtmlFoldMode = require("./folding/html").FoldMode;
var HtmlCompletions = require("./html_completions").HtmlCompletions; var HtmlCompletions = require("./html_completions").HtmlCompletions;
var WorkerClient = require("../worker/worker_client").WorkerClient; var WorkerClient = require("../worker/worker_client").WorkerClient;
// http://www.w3.org/TR/html5/syntax.html#void-elements
var voidElements = ["area", "base", "br", "col", "embed", "hr", "img", "input", "keygen", "link", "meta", "param", "source", "track", "wbr"];
var optionalEndTags = ["li", "dt", "dd", "p", "rt", "rp", "optgroup", "option", "colgroup", "td", "th"];
var Mode = function(options) { var Mode = function(options) {
this.fragmentContext = options && options.fragmentContext; this.fragmentContext = options && options.fragmentContext;
this.HighlightRules = HtmlHighlightRules; this.HighlightRules = HtmlHighlightRules;
this.$behaviour = new HtmlBehaviour(); this.$behaviour = new XmlBehaviour();
this.$completer = new HtmlCompletions(); this.$completer = new HtmlCompletions();
this.createModeDelegates({ this.createModeDelegates({
@ -53,7 +58,7 @@ var Mode = function(options) {
"css-": CssMode "css-": CssMode
}); });
this.foldingRules = new HtmlFoldMode(); this.foldingRules = new HtmlFoldMode(this.voidElements, lang.arrayToMap(optionalEndTags));
}; };
oop.inherits(Mode, TextMode); oop.inherits(Mode, TextMode);
@ -61,6 +66,8 @@ oop.inherits(Mode, TextMode);
this.blockComment = {start: "<!--", end: "-->"}; this.blockComment = {start: "<!--", end: "-->"};
this.voidElements = lang.arrayToMap(voidElements);
this.getNextLineIndent = function(state, line, tab) { this.getNextLineIndent = function(state, line, tab) {
return this.$getIndent(line); return this.$getIndent(line);
}; };

View file

@ -1,5 +1,5 @@
define(["require", "exports", "module"], function(require, exports, module){ define(function(require, exports, module){
require=(function(e,t,n){function i(n,s){if(!t[n]){if(!e[n]){var o=typeof require=="function"&&require;if(!s&&o)return o(n,!0);if(r)return r(n,!0);throw new Error("Cannot find module '"+n+"'")}var u=t[n]={exports:{}};e[n][0].call(u.exports,function(t){var r=e[n][1][t];return i(r?r:t)},u,u.exports)}return t[n].exports}var r=typeof require=="function"&&require;for(var s=0;s<n.length;s++)i(n[s]);return i})({1:[function(require,module,exports){ var req = require=(function(e,t,n){function i(n,s){if(!t[n]){if(!e[n]){var o=typeof require=="function"&&require;if(!s&&o)return o(n,!0);if(r)return r(n,!0);throw new Error("Cannot find module '"+n+"'")}var u=t[n]={exports:{}};e[n][0].call(u.exports,function(t){var r=e[n][1][t];return i(r?r:t)},u,u.exports)}return t[n].exports}var r=typeof require=="function"&&require;for(var s=0;s<n.length;s++)i(n[s]);return i})({1:[function(req,module,exports){
function isScopeMarker(node) { function isScopeMarker(node) {
if (node.namespaceURI === "http://www.w3.org/1999/xhtml") { if (node.namespaceURI === "http://www.w3.org/1999/xhtml") {
return node.localName === "applet" return node.localName === "applet"
@ -228,9 +228,9 @@ Object.defineProperty(ElementStack.prototype, 'length', {
exports.ElementStack = ElementStack; exports.ElementStack = ElementStack;
},{}],2:[function(require,module,exports){ },{}],2:[function(req,module,exports){
var entities = require('html5-entities'); var entities = req('html5-entities');
var InputStream = require('./InputStream').InputStream; var InputStream = req('./InputStream').InputStream;
/** /**
* Magic value for UTF-16 operations. * Magic value for UTF-16 operations.
@ -413,7 +413,7 @@ EntityParser.replaceEntityNumbers = function(c) {
exports.EntityParser = EntityParser; exports.EntityParser = EntityParser;
},{"./InputStream":3,"html5-entities":12}],3:[function(require,module,exports){ },{"./InputStream":3,"html5-entities":12}],3:[function(req,module,exports){
// FIXME convert CR to LF http://www.whatwg.org/specs/web-apps/current-work/multipage/parsing.html#input-stream // FIXME convert CR to LF http://www.whatwg.org/specs/web-apps/current-work/multipage/parsing.html#input-stream
function InputStream() { function InputStream() {
this.data = ''; this.data = '';
@ -523,7 +523,7 @@ InputStream.prototype = {
exports.InputStream = InputStream; exports.InputStream = InputStream;
},{}],4:[function(require,module,exports){ },{}],4:[function(req,module,exports){
var SpecialElements = { var SpecialElements = {
"http://www.w3.org/1999/xhtml": [ "http://www.w3.org/1999/xhtml": [
'address', 'address',
@ -704,9 +704,9 @@ StackItem.prototype.isMathMLTextIntegrationPoint = function() {
exports.StackItem = StackItem; exports.StackItem = StackItem;
},{}],5:[function(require,module,exports){ },{}],5:[function(req,module,exports){
var InputStream = require('./InputStream').InputStream; var InputStream = req('./InputStream').InputStream;
var EntityParser = require('./EntityParser').EntityParser; var EntityParser = req('./EntityParser').EntityParser;
function isWhitespace(c){ function isWhitespace(c){
return c === " " || c === "\n" || c === "\t" || c === "\r" || c === "\f"; return c === " " || c === "\n" || c === "\t" || c === "\r" || c === "\f";
@ -2257,17 +2257,17 @@ Tokenizer.prototype.tokenize = function(source) {
exports.Tokenizer = Tokenizer; exports.Tokenizer = Tokenizer;
},{"./EntityParser":2,"./InputStream":3}],6:[function(require,module,exports){ },{"./EntityParser":2,"./InputStream":3}],6:[function(req,module,exports){
(function(){var assert = require('assert'); (function(){var assert = req('assert');
var messages = require('./messages.json'); var messages = req('./messages.json');
var constants = require('./constants'); var constants = req('./constants');
var EventEmitter = require('events').EventEmitter; var EventEmitter = req('events').EventEmitter;
var Tokenizer = require('./Tokenizer').Tokenizer; var Tokenizer = req('./Tokenizer').Tokenizer;
var ElementStack = require('./ElementStack').ElementStack; var ElementStack = req('./ElementStack').ElementStack;
var StackItem = require('./StackItem').StackItem; var StackItem = req('./StackItem').StackItem;
var Marker = {}; var Marker = {};
@ -5322,7 +5322,7 @@ function formatMessage(format, args) {
exports.TreeBuilder = TreeBuilder; exports.TreeBuilder = TreeBuilder;
})() })()
},{"./ElementStack":1,"./StackItem":4,"./Tokenizer":5,"./constants":7,"./messages.json":8,"assert":13,"events":14}],7:[function(require,module,exports){ },{"./ElementStack":1,"./StackItem":4,"./Tokenizer":5,"./constants":7,"./messages.json":8,"assert":13,"events":14}],7:[function(req,module,exports){
exports.SVGTagMap = { exports.SVGTagMap = {
"altglyph": "altGlyph", "altglyph": "altGlyph",
"altglyphdef": "altGlyphDef", "altglyphdef": "altGlyphDef",
@ -5445,7 +5445,7 @@ exports.ForeignAttributeMap = {
"xmlns": {prefix: null, localName: "xmlns", namespaceURI: "http://www.w3.org/2000/xmlns/"}, "xmlns": {prefix: null, localName: "xmlns", namespaceURI: "http://www.w3.org/2000/xmlns/"},
"xmlns:xlink": {prefix: "xmlns", localName: "xlink", namespaceURI: "http://www.w3.org/2000/xmlns/"}, "xmlns:xlink": {prefix: "xmlns", localName: "xlink", namespaceURI: "http://www.w3.org/2000/xmlns/"},
}; };
},{}],8:[function(require,module,exports){ },{}],8:[function(req,module,exports){
module.exports={ module.exports={
"null-character": "null-character":
"Null character in input stream, replaced with U+FFFD.", "Null character in input stream, replaced with U+FFFD.",
@ -5702,10 +5702,10 @@ module.exports={
"unexpected-start-tag-in-table": "unexpected-start-tag-in-table":
"Unexpected {name}. Expected table content." "Unexpected {name}. Expected table content."
} }
},{}],"DaboPu":[function(require,module,exports){ },{}],"DaboPu":[function(req,module,exports){
var SAXTreeBuilder = require('./SAXTreeBuilder').SAXTreeBuilder; var SAXTreeBuilder = req('./SAXTreeBuilder').SAXTreeBuilder;
var Tokenizer = require('../Tokenizer').Tokenizer; var Tokenizer = req('../Tokenizer').Tokenizer;
var TreeParser = require('./TreeParser').TreeParser; var TreeParser = req('./TreeParser').TreeParser;
function SAXParser() { function SAXParser() {
this.contentHandler = null; this.contentHandler = null;
@ -5754,9 +5754,9 @@ Object.defineProperty(SAXParser.prototype, 'errorHandler', {
exports.SAXParser = SAXParser; exports.SAXParser = SAXParser;
},{"../Tokenizer":5,"./SAXTreeBuilder":10,"./TreeParser":11}],10:[function(require,module,exports){ },{"../Tokenizer":5,"./SAXTreeBuilder":10,"./TreeParser":11}],10:[function(req,module,exports){
var util = require('util'); var util = req('util');
var TreeBuilder = require('../TreeBuilder').TreeBuilder; var TreeBuilder = req('../TreeBuilder').TreeBuilder;
function SAXTreeBuilder() { function SAXTreeBuilder() {
TreeBuilder.call(this); TreeBuilder.call(this);
@ -6429,7 +6429,7 @@ DTD.prototype.revisit = function(treeParser) {
exports.SAXTreeBuilder = SAXTreeBuilder; exports.SAXTreeBuilder = SAXTreeBuilder;
},{"../TreeBuilder":6,"util":15}],11:[function(require,module,exports){ },{"../TreeBuilder":6,"util":15}],11:[function(req,module,exports){
/** /**
* A tree visitor that replays a tree as SAX events. * A tree visitor that replays a tree as SAX events.
* @version $Id$ * @version $Id$
@ -6712,7 +6712,7 @@ NullLexicalHandler.prototype.startEntity = function() {};
exports.TreeParser = TreeParser; exports.TreeParser = TreeParser;
},{}],12:[function(require,module,exports){ },{}],12:[function(req,module,exports){
module.exports = { module.exports = {
"AElig": "\u00C6", "AElig": "\u00C6",
"AElig;": "\u00C6", "AElig;": "\u00C6",
@ -8947,10 +8947,10 @@ module.exports = {
"zwnj;": "\u200C" "zwnj;": "\u200C"
}; };
},{}],13:[function(require,module,exports){ },{}],13:[function(req,module,exports){
(function(){// UTILITY (function(){// UTILITY
var util = require('util'); var util = req('util');
var Buffer = require("buffer").Buffer; var Buffer = req("buffer").Buffer;
var pSlice = Array.prototype.slice; var pSlice = Array.prototype.slice;
function objectKeys(object) { function objectKeys(object) {
@ -9262,7 +9262,7 @@ assert.doesNotThrow = function(block, /*optional*/error, /*optional*/message) {
assert.ifError = function(err) { if (err) {throw err;}}; assert.ifError = function(err) { if (err) {throw err;}};
})() })()
},{"buffer":17,"util":15}],14:[function(require,module,exports){ },{"buffer":17,"util":15}],14:[function(req,module,exports){
(function(process){if (!process.EventEmitter) process.EventEmitter = function () {}; (function(process){if (!process.EventEmitter) process.EventEmitter = function () {};
var EventEmitter = exports.EventEmitter = process.EventEmitter; var EventEmitter = exports.EventEmitter = process.EventEmitter;
@ -9447,9 +9447,9 @@ EventEmitter.prototype.listeners = function(type) {
return this._events[type]; return this._events[type];
}; };
})(require("__browserify_process")) })(req("__browserify_process"))
},{"__browserify_process":20}],15:[function(require,module,exports){ },{"__browserify_process":20}],15:[function(req,module,exports){
var events = require('events'); var events = req('events');
exports.isArray = isArray; exports.isArray = isArray;
exports.isDate = function(obj){return Object.prototype.toString.call(obj) === '[object Date]'}; exports.isDate = function(obj){return Object.prototype.toString.call(obj) === '[object Date]'};
@ -9795,7 +9795,7 @@ exports.format = function(f) {
return str; return str;
}; };
},{"events":14}],16:[function(require,module,exports){ },{"events":14}],16:[function(req,module,exports){
exports.readIEEE754 = function(buffer, offset, isBE, mLen, nBytes) { exports.readIEEE754 = function(buffer, offset, isBE, mLen, nBytes) {
var e, m, var e, m,
eLen = nBytes * 8 - mLen - 1, eLen = nBytes * 8 - mLen - 1,
@ -9881,8 +9881,8 @@ exports.writeIEEE754 = function(buffer, value, offset, isBE, mLen, nBytes) {
buffer[offset + i - d] |= s * 128; buffer[offset + i - d] |= s * 128;
}; };
},{}],17:[function(require,module,exports){ },{}],17:[function(req,module,exports){
(function(){var assert = require('assert'); (function(){var assert = req('assert');
exports.Buffer = Buffer; exports.Buffer = Buffer;
exports.SlowBuffer = Buffer; exports.SlowBuffer = Buffer;
Buffer.poolSize = 8192; Buffer.poolSize = 8192;
@ -9992,7 +9992,7 @@ Buffer.prototype.base64Write = function (string, offset, length) {
Buffer.prototype.base64Slice = function (start, end) { Buffer.prototype.base64Slice = function (start, end) {
var bytes = Array.prototype.slice.apply(this, arguments) var bytes = Array.prototype.slice.apply(this, arguments)
return require("base64-js").fromByteArray(bytes); return req("base64-js").fromByteArray(bytes);
}; };
Buffer.prototype.utf8Slice = function () { Buffer.prototype.utf8Slice = function () {
@ -10353,7 +10353,7 @@ function asciiToBytes(str) {
} }
function base64ToBytes(str) { function base64ToBytes(str) {
return require("base64-js").toByteArray(str); return req("base64-js").toByteArray(str);
} }
function blitBuffer(src, dst, offset, length) { function blitBuffer(src, dst, offset, length) {
@ -10618,7 +10618,7 @@ function readFloat(buffer, offset, isBigEndian, noAssert) {
'Trying to read beyond buffer length'); 'Trying to read beyond buffer length');
} }
return require('./buffer_ieee754').readIEEE754(buffer, offset, isBigEndian, return req('./buffer_ieee754').readIEEE754(buffer, offset, isBigEndian,
23, 4); 23, 4);
} }
@ -10639,7 +10639,7 @@ function readDouble(buffer, offset, isBigEndian, noAssert) {
'Trying to read beyond buffer length'); 'Trying to read beyond buffer length');
} }
return require('./buffer_ieee754').readIEEE754(buffer, offset, isBigEndian, return req('./buffer_ieee754').readIEEE754(buffer, offset, isBigEndian,
52, 8); 52, 8);
} }
@ -10923,7 +10923,7 @@ function writeFloat(buffer, value, offset, isBigEndian, noAssert) {
verifIEEE754(value, 3.4028234663852886e+38, -3.4028234663852886e+38); verifIEEE754(value, 3.4028234663852886e+38, -3.4028234663852886e+38);
} }
require('./buffer_ieee754').writeIEEE754(buffer, value, offset, isBigEndian, req('./buffer_ieee754').writeIEEE754(buffer, value, offset, isBigEndian,
23, 4); 23, 4);
} }
@ -10952,7 +10952,7 @@ function writeDouble(buffer, value, offset, isBigEndian, noAssert) {
verifIEEE754(value, 1.7976931348623157E+308, -1.7976931348623157E+308); verifIEEE754(value, 1.7976931348623157E+308, -1.7976931348623157E+308);
} }
require('./buffer_ieee754').writeIEEE754(buffer, value, offset, isBigEndian, req('./buffer_ieee754').writeIEEE754(buffer, value, offset, isBigEndian,
52, 8); 52, 8);
} }
@ -10965,7 +10965,7 @@ Buffer.prototype.writeDoubleBE = function(value, offset, noAssert) {
}; };
})() })()
},{"./buffer_ieee754":16,"assert":13,"base64-js":18}],18:[function(require,module,exports){ },{"./buffer_ieee754":16,"assert":13,"base64-js":18}],18:[function(req,module,exports){
(function (exports) { (function (exports) {
'use strict'; 'use strict';
@ -11051,9 +11051,9 @@ Buffer.prototype.writeDoubleBE = function(value, offset, noAssert) {
module.exports.fromByteArray = uint8ToBase64; module.exports.fromByteArray = uint8ToBase64;
}()); }());
},{}],"./lib/sax/SAXParser.js":[function(require,module,exports){ },{}],"./lib/sax/SAXParser.js":[function(req,module,exports){
module.exports=require('DaboPu'); module.exports=req('DaboPu');
},{}],20:[function(require,module,exports){ },{}],20:[function(req,module,exports){
// shim for using process in browser // shim for using process in browser
var process = module.exports = {}; var process = module.exports = {};
@ -11109,5 +11109,5 @@ process.chdir = function (dir) {
},{}]},{},["DaboPu"]) },{}]},{},["DaboPu"])
; ;
exports.SAXParser = require('./lib/sax/SAXParser.js').SAXParser; exports.SAXParser = req('./lib/sax/SAXParser.js').SAXParser;
}); });

View file

@ -43,6 +43,12 @@ var commonAttributes = [
"dropzone", "dropzone",
"hidden", "hidden",
"id", "id",
"inert",
"itemid",
"itemprop",
"itemref",
"itemscope",
"itemtype",
"lang", "lang",
"spellcheck", "spellcheck",
"style", "style",
@ -226,24 +232,19 @@ var attributeMap = {
"dialog": ["open"] "dialog": ["open"]
}; };
var allElements = Object.keys(attributeMap); var elements = Object.keys(attributeMap);
function hasType(token, type) { function is(token, type) {
var tokenTypes = token.type.split('.'); return token.type.lastIndexOf(type + ".xml") > -1;
return type.split('.').every(function(type){
return (tokenTypes.indexOf(type) !== -1);
});
} }
function findTagName(session, pos) { function findTagName(session, pos) {
var iterator = new TokenIterator(session, pos.row, pos.column); var iterator = new TokenIterator(session, pos.row, pos.column);
var token = iterator.getCurrentToken(); var token = iterator.getCurrentToken();
if (!token || !hasType(token, 'tag') && !(hasType(token, 'text') && token.value.match('/'))){ while (token && !is(token, "tag-name")){
do { token = iterator.stepBackward();
token = iterator.stepBackward();
} while (token && (hasType(token, 'string') || hasType(token, 'operator') || hasType(token, 'attribute-name') || hasType(token, 'text')));
} }
if (token && hasType(token, 'tag-name') && !iterator.stepBackward().value.match('/')) if (token)
return token.value; return token.value;
} }
@ -260,27 +261,22 @@ var HtmlCompletions = function() {
return []; return [];
// tag name // tag name
if (hasType(token, "tag-name") || (token.value == '<' && hasType(token, "text"))) if (is(token, "tag-name") || is(token, "tag-open") || is(token, "end-tag-open"))
return this.getTagCompletions(state, session, pos, prefix); return this.getTagCompletions(state, session, pos, prefix);
// tag attribute // tag attribute
if (hasType(token, 'text') || hasType(token, 'attribute-name')) if (is(token, "tag-whitespace") || is(token, "attribute-name"))
return this.getAttributeCompetions(state, session, pos, prefix); return this.getAttributeCompetions(state, session, pos, prefix);
return []; return [];
}; };
this.getTagCompletions = function(state, session, pos, prefix) { this.getTagCompletions = function(state, session, pos, prefix) {
var elements = allElements;
if (prefix) {
elements = elements.filter(function(element){
return element.indexOf(prefix) === 0;
});
}
return elements.map(function(element){ return elements.map(function(element){
return { return {
value: element, value: element,
meta: "tag" meta: "tag",
score: Number.MAX_VALUE
}; };
}); });
}; };
@ -293,16 +289,12 @@ var HtmlCompletions = function() {
if (tagName in attributeMap) { if (tagName in attributeMap) {
attributes = attributes.concat(attributeMap[tagName]); attributes = attributes.concat(attributeMap[tagName]);
} }
if (prefix) {
attributes = attributes.filter(function(attribute){
return attribute.indexOf(prefix) === 0;
});
}
return attributes.map(function(attribute){ return attributes.map(function(attribute){
return { return {
caption: attribute, caption: attribute,
snippet: attribute + '="$0"', snippet: attribute + '="$0"',
meta: "attribute" meta: "attribute",
score: Number.MAX_VALUE
}; };
}); });
}; };

View file

@ -62,17 +62,17 @@ var HtmlHighlightRules = function() {
this.addRules({ this.addRules({
attributes: [{ attributes: [{
include : "space" include : "tag_whitespace"
}, { }, {
token : "entity.other.attribute-name", token : "entity.other.attribute-name.xml",
regex : "[-_a-zA-Z0-9:]+" regex : "[-_a-zA-Z0-9:]+"
}, { }, {
token : "keyword.operator.separator", token : "keyword.operator.attribute-equals.xml",
regex : "=", regex : "=",
push : [{ push : [{
include: "space" include: "tag_whitespace"
}, { }, {
token : "string", token : "string.unquoted.attribute-value.html",
regex : "[^<>='\"`\\s]+", regex : "[^<>='\"`\\s]+",
next : "pop" next : "pop"
}, { }, {
@ -81,33 +81,21 @@ var HtmlHighlightRules = function() {
next : "pop" next : "pop"
}] }]
}, { }, {
include : "string" include : "attribute_value"
}], }],
tag: [{ tag: [{
token : function(start, tag) { token : function(start, tag) {
var group = tagMap[tag]; var group = tagMap[tag];
return ["meta.tag.punctuation.begin", return ["meta.tag.punctuation." + (start == "<" ? "" : "end-") + "tag-open.xml",
"meta.tag.name" + (group ? "." + group : "")]; "meta.tag" + (group ? "." + group : "") + ".tag-name.xml"];
}, },
regex : "(<)([-_a-zA-Z0-9:]+)", regex : "(</?)([-_a-zA-Z0-9:]+)",
next: "start_tag_stuff" next: "tag_stuff"
}, {
token : function(start, tag) {
var group = tagMap[tag];
return ["meta.tag.punctuation.begin",
"meta.tag.name" + (group ? "." + group : "")];
},
regex : "(</)([-_a-zA-Z0-9:]+)",
next: "end_tag_stuff"
}], }],
start_tag_stuff: [ tag_stuff: [
{include : "attributes"}, {include : "attributes"},
{token : "meta.tag.punctuation.end", regex : "/?>", next : "start"} {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : "start"}
], ],
end_tag_stuff: [
{include : "space"},
{token : "meta.tag.punctuation.end", regex : ">", next : "start"}
]
}); });
this.embedTagRules(CssHighlightRules, "css-", "style"); this.embedTagRules(CssHighlightRules, "css-", "style");

File diff suppressed because one or more lines are too long

View file

@ -8,7 +8,7 @@ var Tokenizer = require("../tokenizer").Tokenizer;
var LuaPageHighlightRules = require("./luapage_highlight_rules").LuaPageHighlightRules; var LuaPageHighlightRules = require("./luapage_highlight_rules").LuaPageHighlightRules;
var Mode = function() { var Mode = function() {
this.HighlightRules = LuaPageHighlightRules; HtmlMode.call(this);
this.HighlightRules = LuaPageHighlightRules; this.HighlightRules = LuaPageHighlightRules;
this.createModeDelegates({ this.createModeDelegates({

View file

@ -3,7 +3,7 @@
* *
* Copyright (c) 2010, Ajax.org B.V. * Copyright (c) 2010, Ajax.org B.V.
* All rights reserved. * All rights reserved.
* *
* Redistribution and use in source and binary forms, with or without * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met: * modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright * * Redistributions of source code must retain the above copyright
@ -14,7 +14,7 @@
* * Neither the name of Ajax.org B.V. nor the * * Neither the name of Ajax.org B.V. nor the
* names of its contributors may be used to endorse or promote products * names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission. * derived from this software without specific prior written permission.
* *
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * 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 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
@ -42,21 +42,21 @@ var MarkdownFoldMode = require("./folding/markdown").FoldMode;
var Mode = function() { var Mode = function() {
this.HighlightRules = MarkdownHighlightRules; this.HighlightRules = MarkdownHighlightRules;
this.createModeDelegates({ this.createModeDelegates({
"js-": JavaScriptMode, "js-": JavaScriptMode,
"xml-": XmlMode, "xml-": XmlMode,
"html-": HtmlMode "html-": HtmlMode
}); });
this.foldingRules = new MarkdownFoldMode(); this.foldingRules = new MarkdownFoldMode();
}; };
oop.inherits(Mode, TextMode); oop.inherits(Mode, TextMode);
(function() { (function() {
this.type = "text"; this.type = "text";
this.lineCommentStart = ">"; this.blockComment = {start: "<!--", end: "-->"};
this.getNextLineIndent = function(state, line, tab) { this.getNextLineIndent = function(state, line, tab) {
if (state == "listblock") { if (state == "listblock") {
var match = /^(\s*)(?:([-+*])|(\d+)\.)(\s+)/.exec(line); var match = /^(\s*)(?:([-+*])|(\d+)\.)(\s+)/.exec(line);

View file

@ -46,7 +46,7 @@ var escaped = function(ch) {
function github_embed(tag, prefix) { function github_embed(tag, prefix) {
return { // Github style block return { // Github style block
token : "support.function", token : "support.function",
regex : "^```" + tag + "\\s*$", regex : "^\\s*```" + tag + "\\s*$",
push : prefix + "start" push : prefix + "start"
}; };
} }
@ -79,7 +79,7 @@ var MarkdownHighlightRules = function() {
github_embed("css", "csscode-"), github_embed("css", "csscode-"),
{ // Github style block { // Github style block
token : "support.function", token : "support.function",
regex : "^```\\s*[a-zA-Z]*(?:{.*?\\})?\\s*$", regex : "^\\s*```\\s*\\S*(?:{.*?\\})?\\s*$",
next : "githubblock" next : "githubblock"
}, { // block quote }, { // block quote
token : "string.blockquote", token : "string.blockquote",
@ -164,11 +164,15 @@ var MarkdownHighlightRules = function() {
next : "listblock-start" next : "listblock-start"
}, { }, {
include : "basic", noEscape: true include : "basic", noEscape: true
}, { // Github style block
token : "support.function",
regex : "^\\s*```\\s*[a-zA-Z]*(?:{.*?\\})?\\s*$",
next : "githubblock"
}, { }, {
defaultToken : "list" //do not use markup.list to allow stling leading `*` differntly defaultToken : "list" //do not use markup.list to allow stling leading `*` differntly
} ], } ],
"blockquote" : [ { // BLockquotes only escape on blank lines. "blockquote" : [ { // Blockquotes only escape on blank lines.
token : "empty_line", token : "empty_line",
regex : "^\\s*$", regex : "^\\s*$",
next : "start" next : "start"
@ -184,7 +188,7 @@ var MarkdownHighlightRules = function() {
"githubblock" : [ { "githubblock" : [ {
token : "support.function", token : "support.function",
regex : "^```", regex : "^\\s*```",
next : "start" next : "start"
}, { }, {
token : "support.function", token : "support.function",
@ -194,25 +198,25 @@ var MarkdownHighlightRules = function() {
this.embedRules(JavaScriptHighlightRules, "jscode-", [{ this.embedRules(JavaScriptHighlightRules, "jscode-", [{
token : "support.function", token : "support.function",
regex : "^```", regex : "^\\s*```",
next : "pop" next : "pop"
}]); }]);
this.embedRules(HtmlHighlightRules, "htmlcode-", [{ this.embedRules(HtmlHighlightRules, "htmlcode-", [{
token : "support.function", token : "support.function",
regex : "^```", regex : "^\\s*```",
next : "pop" next : "pop"
}]); }]);
this.embedRules(CssHighlightRules, "csscode-", [{ this.embedRules(CssHighlightRules, "csscode-", [{
token : "support.function", token : "support.function",
regex : "^```", regex : "^\\s*```",
next : "pop" next : "pop"
}]); }]);
this.embedRules(XmlHighlightRules, "xmlcode-", [{ this.embedRules(XmlHighlightRules, "xmlcode-", [{
token : "support.function", token : "support.function",
regex : "^```", regex : "^\\s*```",
next : "pop" next : "pop"
}]); }]);

View file

@ -4810,6 +4810,16 @@ PHP.Parser.prototype.Node_Expr_BitwiseOr = function() {
}; };
PHP.Parser.prototype.Node_Expr_BitwiseXor = function() {
return {
type: "Node_Expr_BitwiseXor",
left: arguments[ 0 ],
right: arguments[ 1 ],
attributes: arguments[ 2 ]
};
};
PHP.Parser.prototype.Node_Expr_BitwiseNot = function() { PHP.Parser.prototype.Node_Expr_BitwiseNot = function() {
return { return {
type: "Node_Expr_BitwiseNot", type: "Node_Expr_BitwiseNot",

View file

@ -49,6 +49,7 @@ var RCodeModel = require("mode/r_code_model").RCodeModel;
*/ */
var Mode = function(doc, session) { var Mode = function(doc, session) {
HtmlMode.call(this);
this.$session = session; this.$session = session;
this.HighlightRules = RHtmlHighlightRules; this.HighlightRules = RHtmlHighlightRules;

View file

@ -63,7 +63,7 @@ oop.inherits(Mode, TextMode);
if (state == "start") { if (state == "start") {
var match = line.match(/^.*[\{\(\[]\s*$/); var match = line.match(/^.*[\{\(\[]\s*$/);
var startingClassOrMethod = line.match(/^\s*(class|def)\s.*$/); var startingClassOrMethod = line.match(/^\s*(class|def|module)\s.*$/);
var startingDoBlock = line.match(/.*do(\s*|\s+\|.*\|\s*)$/); var startingDoBlock = line.match(/.*do(\s*|\s+\|.*\|\s*)$/);
var startingConditional = line.match(/^\s*(if|else)\s*/) var startingConditional = line.match(/^\s*(if|else)\s*/)
if (match || startingClassOrMethod || startingDoBlock || startingConditional) { if (match || startingClassOrMethod || startingDoBlock || startingConditional) {

View file

@ -35,16 +35,10 @@ var oop = require("../lib/oop");
var HtmlMode = require("./html").Mode; var HtmlMode = require("./html").Mode;
var Tokenizer = require("../tokenizer").Tokenizer; var Tokenizer = require("../tokenizer").Tokenizer;
var SmartyHighlightRules = require("./smarty_highlight_rules").SmartyHighlightRules; var SmartyHighlightRules = require("./smarty_highlight_rules").SmartyHighlightRules;
var HtmlBehaviour = require("./behaviour/html").HtmlBehaviour;
var HtmlFoldMode = require("./folding/html").FoldMode;
var Mode = function() { var Mode = function() {
HtmlMode.call(this); HtmlMode.call(this);
this.HighlightRules = SmartyHighlightRules; this.HighlightRules = SmartyHighlightRules;
this.$behaviour = new HtmlBehaviour();
this.foldingRules = new HtmlFoldMode();
}; };
oop.inherits(Mode, HtmlMode); oop.inherits(Mode, HtmlMode);

View file

@ -114,9 +114,9 @@ var SmartyHighlightRules = function() {
var smartyStart = smartyRules.start; var smartyStart = smartyRules.start;
["start", "qqstring_inner", "qstring_inner", "attributes", "cdata"].forEach(function(x) { for (var rule in this.$rules) {
this.$rules[x].unshift.apply(this.$rules[x], smartyStart); this.$rules[rule].unshift.apply(this.$rules[rule], smartyStart);
}, this); }
Object.keys(smartyRules).forEach(function(x) { Object.keys(smartyRules).forEach(function(x) {
if (!this.$rules[x]) if (!this.$rules[x])

View file

@ -49,7 +49,7 @@ var Mode = function() {
"js-": JavaScriptMode "js-": JavaScriptMode
}); });
this.foldingRules = new MixedFoldMode(new XmlFoldMode({}), { this.foldingRules = new MixedFoldMode(new XmlFoldMode(), {
"js-": new CStyleFoldMode() "js-": new CStyleFoldMode()
}); });
}; };

View file

@ -32,28 +32,16 @@ define(function(require, exports, module) {
"use strict"; "use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextMode = require("./text").Mode; var HtmlMode = require("./html").Mode;
var JavaScriptMode = require("./javascript").Mode;
var CssMode = require("./css").Mode;
var Tokenizer = require("../tokenizer").Tokenizer;
var TwigHighlightRules = require("./twig_highlight_rules").TwigHighlightRules; var TwigHighlightRules = require("./twig_highlight_rules").TwigHighlightRules;
var HtmlBehaviour = require("./behaviour/html").HtmlBehaviour;
var HtmlFoldMode = require("./folding/html").FoldMode;
var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent; var MatchingBraceOutdent = require("./matching_brace_outdent").MatchingBraceOutdent;
var Mode = function() { var Mode = function() {
HtmlMode.call(this);
this.HighlightRules = TwigHighlightRules; this.HighlightRules = TwigHighlightRules;
this.$outdent = new MatchingBraceOutdent(); this.$outdent = new MatchingBraceOutdent();
this.$behaviour = new HtmlBehaviour();
this.createModeDelegates({
"js-": JavaScriptMode,
"css-": CssMode
});
this.foldingRules = new HtmlFoldMode();
}; };
oop.inherits(Mode, TextMode); oop.inherits(Mode, HtmlMode);
(function() { (function() {
this.blockComment = {start: "{#", end: "#}"}; this.blockComment = {start: "{#", end: "#}"};

View file

@ -37,18 +37,17 @@ define(function(require, exports, module) {
"use strict"; "use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var TextMode = require("./text").Mode; var HtmlMode = require("./html").Mode;
var Tokenizer = require("../tokenizer").Tokenizer; var Tokenizer = require("../tokenizer").Tokenizer;
var VelocityHighlightRules = require("./velocity_highlight_rules").VelocityHighlightRules; var VelocityHighlightRules = require("./velocity_highlight_rules").VelocityHighlightRules;
var FoldMode = require("./folding/velocity").FoldMode; var FoldMode = require("./folding/velocity").FoldMode;
var HtmlBehaviour = require("./behaviour/html").HtmlBehaviour;
var Mode = function() { var Mode = function() {
HtmlMode.call(this);
this.HighlightRules = VelocityHighlightRules; this.HighlightRules = VelocityHighlightRules;
this.foldingRules = new FoldMode(); this.foldingRules = new FoldMode();
this.$behaviour = new HtmlBehaviour();
}; };
oop.inherits(Mode, TextMode); oop.inherits(Mode, HtmlMode);
(function() { (function() {
this.lineCommentStart = "##"; this.lineCommentStart = "##";

View file

@ -32,6 +32,7 @@ define(function(require, exports, module) {
"use strict"; "use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var lang = require("../lib/lang");
var TextMode = require("./text").Mode; var TextMode = require("./text").Mode;
var Tokenizer = require("../tokenizer").Tokenizer; var Tokenizer = require("../tokenizer").Tokenizer;
var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules; var XmlHighlightRules = require("./xml_highlight_rules").XmlHighlightRules;
@ -47,7 +48,9 @@ var Mode = function() {
oop.inherits(Mode, TextMode); oop.inherits(Mode, TextMode);
(function() { (function() {
this.voidElements = lang.arrayToMap([]);
this.blockComment = {start: "<!--", end: "-->"}; this.blockComment = {start: "<!--", end: "-->"};
this.$id = "ace/mode/xml"; this.$id = "ace/mode/xml";

View file

@ -38,57 +38,72 @@ var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var XmlHighlightRules = function(normalize) { var XmlHighlightRules = function(normalize) {
this.$rules = { this.$rules = {
start : [ start : [
{token : "punctuation.string.begin", regex : "<\\!\\[CDATA\\[", next : "cdata"}, {token : "string.cdata.xml", regex : "<\\!\\[CDATA\\[", next : "cdata"},
{ {
token : ["punctuation.instruction.begin", "keyword.instruction"], token : ["punctuation.xml-decl.xml", "keyword.xml-decl.xml"],
regex : "(<\\?)(xml)(?=[\\s])", next : "xml_declaration" regex : "(<\\?)(xml)(?=[\\s])", next : "xml_decl", caseInsensitive: true
}, },
{ {
token : ["punctuation.instruction.begin", "keyword.instruction"], token : ["punctuation.instruction.xml", "keyword.instruction.xml"],
regex : "(<\\?)([-_a-zA-Z0-9]+)", next : "instruction" regex : "(<\\?)([-_a-zA-Z0-9]+)", next : "processing_instruction",
}, },
{token : "comment", regex : "<\\!--", next : "comment"}, {token : "comment.xml", regex : "<\\!--", next : "comment"},
{ {
token : ["punctuation.doctype.begin", "meta.tag.doctype"], token : ["xml-pe.doctype.xml", "xml-pe.doctype.xml"],
regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype" regex : "(<\\!)(DOCTYPE)(?=[\\s])", next : "doctype", caseInsensitive: true
}, },
{include : "tag"}, {include : "tag"},
{include : "reference"} {token : "text.end-tag-open.xml", regex: "</"},
{token : "text.tag-open.xml", regex: "<"},
{include : "reference"},
{defaultToken : "text.xml"}
], ],
xml_declaration : [ xml_decl : [{
{include : "attributes"}, token : "entity.other.attribute-name.decl-attribute-name.xml",
{include : "instruction"} regex : "(?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+"
], }, {
token : "keyword.operator.decl-attribute-equals.xml",
regex : "="
}, {
include: "whitespace"
}, {
include: "string"
}, {
token : "punctuation.xml-decl.xml",
regex : "\\?>",
next : "start"
}],
instruction : [ processing_instruction : [
{token : "punctuation.instruction.end", regex : "\\?>", next : "start"} {token : "punctuation.instruction.xml", regex : "\\?>", next : "start"},
{defaultToken : "instruction.xml"}
], ],
doctype : [ doctype : [
{include : "space"}, {include : "whitespace"},
{include : "string"}, {include : "string"},
{token : "punctuation.doctype.end", regex : ">", next : "start"}, {token : "xml-pe.doctype.xml", regex : ">", next : "start"},
{token : "xml-pe", regex : "[-_a-zA-Z0-9:]+"}, {token : "xml-pe.xml", regex : "[-_a-zA-Z0-9:]+"},
{token : "punctuation.begin", regex : "\\[", push : "declarations"} {token : "punctuation.int-subset", regex : "\\[", push : "int_subset"}
], ],
declarations : [{ int_subset : [{
token : "text", token : "text.xml",
regex : "\\s+" regex : "\\s+"
}, { }, {
token: "punctuation.end", token: "punctuation.int-subset.xml",
regex: "]", regex: "]",
next: "pop" next: "pop"
}, { }, {
token : ["punctuation.begin", "keyword"], token : ["punctuation.markup-decl.xml", "keyword.markup-decl.xml"],
regex : "(<\\!)([-_a-zA-Z0-9]+)", regex : "(<\\!)([-_a-zA-Z0-9]+)",
push : [{ push : [{
token : "text", token : "text",
regex : "\\s+" regex : "\\s+"
}, },
{ {
token : "punctuation.end", token : "punctuation.markup-decl.xml",
regex : ">", regex : ">",
next : "pop" next : "pop"
}, },
@ -96,75 +111,88 @@ var XmlHighlightRules = function(normalize) {
}], }],
cdata : [ cdata : [
{token : "string.end", regex : "\\]\\]>", next : "start"}, {token : "string.cdata.xml", regex : "\\]\\]>", next : "start"},
{token : "text", regex : "\\s+"}, {token : "text.xml", regex : "\\s+"},
{token : "text", regex : "(?:[^\\]]|\\](?!\\]>))+"} {token : "text.xml", regex : "(?:[^\\]]|\\](?!\\]>))+"}
], ],
comment : [ comment : [
{token : "comment", regex : "-->", next : "start"}, {token : "comment.xml", regex : "-->", next : "start"},
{defaultToken : "comment"} {defaultToken : "comment.xml"}
],
tag : [{
token : ["meta.tag.punctuation.begin", "meta.tag.name"],
regex : "(<)((?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+)",
next: [
{include : "attributes"},
{token : "meta.tag.punctuation.end", regex : "/?>", next : "start"}
]
}, {
token : ["meta.tag.punctuation.begin", "meta.tag.name"],
regex : "(</)((?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+)",
next: [
{include : "space"},
{token : "meta.tag.punctuation.end", regex : ">", next : "start"}
]
}],
space : [
{token : "text", regex : "\\s+"}
], ],
reference : [{ reference : [{
token : "constant.language.escape", token : "constant.language.escape.reference.xml",
regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)" regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
}, {
token : "text", regex : "&"
}], }],
attr_reference : [{
token : "constant.language.escape.reference.attribute-value.xml",
regex : "(?:&#[0-9]+;)|(?:&#x[0-9a-fA-F]+;)|(?:&[a-zA-Z0-9_:\\.-]+;)"
}],
tag : [{
token : ["meta.tag.punctuation.tag-open.xml", "meta.tag.punctuation.end-tag-open.xml", "meta.tag.tag-name.xml"],
regex : "(?:(<)|(</))((?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+)",
next: [
{include : "attributes"},
{token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : "start"}
]
}],
tag_whitespace : [
{token : "text.tag-whitespace.xml", regex : "\\s+"}
],
// for doctype and processing instructions
whitespace : [
{token : "text.whitespace.xml", regex : "\\s+"}
],
// for doctype and processing instructions
string: [{ string: [{
token : "string", token : "string.xml",
regex : "'", regex : "'",
push : "qstring_inner" push : [
{token : "string.xml", regex: "'", next: "pop"},
{defaultToken : "string.xml"}
]
}, { }, {
token : "string", token : "string.xml",
regex : '"', regex : '"',
push : "qqstring_inner" push : [
{token : "string.xml", regex: '"', next: "pop"},
{defaultToken : "string.xml"}
]
}], }],
qstring_inner: [
{token : "string", regex: "'", next: "pop"},
{include : "reference"},
{defaultToken : "string"}
],
qqstring_inner: [
{token : "string", regex: '"', next: "pop"},
{include : "reference"},
{defaultToken : "string"}
],
attributes: [{ attributes: [{
token : "entity.other.attribute-name", token : "entity.other.attribute-name.xml",
regex : "(?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+" regex : "(?:[-_a-zA-Z0-9]+:)?[-_a-zA-Z0-9]+"
}, { }, {
token : "keyword.operator.separator", token : "keyword.operator.attribute-equals.xml",
regex : "=" regex : "="
}, { }, {
include : "space" include: "tag_whitespace"
}, { }, {
include : "string" include: "attribute_value"
}],
attribute_value: [{
token : "string.attribute-value.xml",
regex : "'",
push : [
{token : "string.attribute-value.xml", regex: "'", next: "pop"},
{include : "attr_reference"},
{defaultToken : "string.attribute-value.xml"}
]
}, {
token : "string.attribute-value.xml",
regex : '"',
push : [
{token : "string.attribute-value.xml", regex: '"', next: "pop"},
{include : "attr_reference"},
{defaultToken : "string.attribute-value.xml"}
]
}] }]
}; };
@ -177,18 +205,17 @@ var XmlHighlightRules = function(normalize) {
this.embedTagRules = function(HighlightRules, prefix, tag){ this.embedTagRules = function(HighlightRules, prefix, tag){
this.$rules.tag.unshift({ this.$rules.tag.unshift({
token : ["meta.tag.punctuation.begin", "meta.tag.name." + tag], token : ["meta.tag.punctuation.tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
regex : "(<)(" + tag + ")", regex : "(<)(" + tag + ")",
next: [ next: [
{include : "space"},
{include : "attributes"}, {include : "attributes"},
{token : "meta.tag.punctuation.end", regex : "/?>", next : prefix + "start"} {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next : prefix + "start"}
] ]
}); });
this.$rules[tag + "-end"] = [ this.$rules[tag + "-end"] = [
{include : "space"}, {include : "attributes"},
{token : "meta.tag.punctuation.end", regex : ">", next: "start", {token : "meta.tag.punctuation.tag-close.xml", regex : "/?>", next: "start",
onMatch : function(value, currentState, stack) { onMatch : function(value, currentState, stack) {
stack.splice(0); stack.splice(0);
return this.token; return this.token;
@ -196,14 +223,14 @@ var XmlHighlightRules = function(normalize) {
] ]
this.embedRules(HighlightRules, prefix, [{ this.embedRules(HighlightRules, prefix, [{
token: ["meta.tag.punctuation.begin", "meta.tag.name." + tag], token: ["meta.tag.punctuation.end-tag-open.xml", "meta.tag." + tag + ".tag-name.xml"],
regex : "(</)(" + tag + ")", regex : "(</)(" + tag + ")",
next: tag + "-end" next: tag + "-end"
}, { }, {
token: "string.begin", token: "string.cdata.xml",
regex : "<\\!\\[CDATA\\[" regex : "<\\!\\[CDATA\\["
}, { }, {
token: "string.end", token: "string.cdata.xml",
regex : "\\]\\]>" regex : "\\]\\]>"
}]); }]);
}; };

View file

@ -51,7 +51,7 @@ module.exports = {
assert.ok(tokenizer instanceof Tokenizer); assert.ok(tokenizer instanceof Tokenizer);
var tokens = tokenizer.getLineTokens("<juhu>", "start").tokens; var tokens = tokenizer.getLineTokens("<juhu>", "start").tokens;
assert.equal("meta.tag.punctuation.begin", tokens[0].type); assert.equal("meta.tag.punctuation.tag-open.xml", tokens[0].type);
}, },
"test: toggle comment lines should not do anything" : function() { "test: toggle comment lines should not do anything" : function() {

View file

@ -86,9 +86,6 @@ var YamlHighlightRules = function() {
}, { }, {
token : "constant.language.boolean", token : "constant.language.boolean",
regex : "(?:true|false|TRUE|FALSE|True|False|yes|no)\\b" regex : "(?:true|false|TRUE|FALSE|True|False|yes|no)\\b"
}, {
token : "invalid.illegal", // comments are not allowed
regex : "\\/\\/.*$"
}, { }, {
token : "paren.lparen", token : "paren.lparen",
regex : "[[({]" regex : "[[({]"

View file

@ -72,8 +72,7 @@ function DefaultHandlers(mouseHandler) {
var selectionEmpty = selectionRange.isEmpty(); var selectionEmpty = selectionRange.isEmpty();
if (selectionEmpty) { if (selectionEmpty) {
editor.moveCursorToPosition(pos); editor.selection.moveToPosition(pos);
editor.selection.clearSelection();
} }
// 2: contextmenu, 1: linux paste // 2: contextmenu, 1: linux paste
@ -93,6 +92,7 @@ function DefaultHandlers(mouseHandler) {
} }
} }
this.captureMouse(ev);
if (!inSelection || this.$clickSelection || ev.getShiftKey() || editor.inMultiSelectMode) { if (!inSelection || this.$clickSelection || ev.getShiftKey() || editor.inMultiSelectMode) {
// Directly pick STATE_SELECT, since the user is not clicking inside // Directly pick STATE_SELECT, since the user is not clicking inside
// a selection. // a selection.
@ -101,7 +101,6 @@ function DefaultHandlers(mouseHandler) {
this.mousedownEvent.time = Date.now(); this.mousedownEvent.time = Date.now();
this.startSelect(pos); this.startSelect(pos);
} }
this.captureMouse(ev);
return ev.preventDefault(); return ev.preventDefault();
}; };
@ -114,8 +113,7 @@ function DefaultHandlers(mouseHandler) {
editor.selection.selectToPosition(pos); editor.selection.selectToPosition(pos);
} }
else if (!this.$clickSelection) { else if (!this.$clickSelection) {
editor.moveCursorToPosition(pos); editor.selection.moveToPosition(pos);
editor.selection.clearSelection();
} }
if (editor.renderer.scroller.setCapture) { if (editor.renderer.scroller.setCapture) {
editor.renderer.scroller.setCapture(); editor.renderer.scroller.setCapture();

View file

@ -32,7 +32,6 @@ define(function(require, exports, module) {
var event = require("../lib/event"); var event = require("../lib/event");
// mouse // mouse
function isSamePoint(p1, p2) { function isSamePoint(p1, p2) {
return p1.row == p2.row && p1.column == p2.column; return p1.row == p2.row && p1.column == p2.column;
@ -51,7 +50,7 @@ function onMouseDown(e) {
} }
if (!ctrl && !alt) { if (!ctrl && !alt) {
if (button == 0 && e.editor.inMultiSelectMode) if (button === 0 && e.editor.inMultiSelectMode)
e.editor.exitMultiSelectMode(); e.editor.exitMultiSelectMode();
return; return;
} }
@ -79,8 +78,7 @@ function onMouseDown(e) {
return; return;
screenCursor = newCursor; screenCursor = newCursor;
editor.selection.moveCursorToPosition(cursor); editor.selection.moveToPosition(cursor);
editor.selection.clearSelection();
editor.renderer.scrollCursorIntoView(); editor.renderer.scrollCursorIntoView();
editor.removeSelectionMarkers(rectSel); editor.removeSelectionMarkers(rectSel);
@ -95,7 +93,7 @@ function onMouseDown(e) {
if (ctrl && !shift && !alt && button == 0) { if (ctrl && !alt && !shift && button === 0) {
if (!isMultiSelect && inSelection) if (!isMultiSelect && inSelection)
return; // dragging return; // dragging
@ -122,7 +120,7 @@ function onMouseDown(e) {
editor.$blockScrolling--; editor.$blockScrolling--;
}); });
} else if (alt && button == 0) { } else if (alt && button === 0) {
e.stop(); e.stop();
if (isMultiSelect && !ctrl) if (isMultiSelect && !ctrl)
@ -135,8 +133,7 @@ function onMouseDown(e) {
screenAnchor = session.documentToScreenPosition(selection.lead); screenAnchor = session.documentToScreenPosition(selection.lead);
blockSelect(); blockSelect();
} else { } else {
selection.moveCursorToPosition(pos); selection.moveToPosition(pos);
selection.clearSelection();
} }

View file

@ -437,6 +437,7 @@ var Editor = require("./editor").Editor;
this.commands.removeDefaultHandler("exec", this.$onMultiSelectExec); this.commands.removeDefaultHandler("exec", this.$onMultiSelectExec);
this.renderer.updateCursor(); this.renderer.updateCursor();
this.renderer.updateBackMarkers(); this.renderer.updateBackMarkers();
this._emit("changeSelection");
}; };
this.$onMultiSelectExec = function(e) { this.$onMultiSelectExec = function(e) {
@ -487,9 +488,10 @@ var Editor = require("./editor").Editor;
i--; i--;
} }
tmpSel.fromOrientedRange(rangeList.ranges[i]); tmpSel.fromOrientedRange(rangeList.ranges[i]);
tmpSel.id = rangeList.ranges[i].marker;
this.selection = session.selection = tmpSel; this.selection = session.selection = tmpSel;
var cmdResult = cmd.exec(this, args || {}); var cmdResult = cmd.exec(this, args || {});
if (!result == undefined) if (result !== undefined)
result = cmdResult; result = cmdResult;
tmpSel.toOrientedRange(rangeList.ranges[i]); tmpSel.toOrientedRange(rangeList.ranges[i]);
} }

View file

@ -112,12 +112,15 @@ oop.inherits(Occur, Search);
occurSession.$occur = this; occurSession.$occur = this;
occurSession.$occurMatchingLines = found; occurSession.$occurMatchingLines = found;
editor.setSession(occurSession); editor.setSession(occurSession);
this.$useEmacsStyleLineStart = this.$originalSession.$useEmacsStyleLineStart;
occurSession.$useEmacsStyleLineStart = this.$useEmacsStyleLineStart;
this.highlight(occurSession, options.re); this.highlight(occurSession, options.re);
occurSession._emit('changeBackMarker'); occurSession._emit('changeBackMarker');
} }
this.displayOriginalContent = function(editor) { this.displayOriginalContent = function(editor) {
editor.setSession(this.$originalSession); editor.setSession(this.$originalSession);
this.$originalSession.$useEmacsStyleLineStart = this.$useEmacsStyleLineStart;
} }
/** /**

View file

@ -298,6 +298,27 @@ var Selection = function(session) {
}); });
}; };
/**
* Moves the selection cursor to the indicated row and column.
* @param {Number} row The row to select to
* @param {Number} column The column to select to
*
**/
this.moveTo = function(row, column) {
this.clearSelection();
this.moveCursorTo(row, column);
};
/**
* Moves the selection cursor to the row and column indicated by `pos`.
* @param {Object} pos An object containing the row and column
**/
this.moveToPosition = function(pos) {
this.clearSelection();
this.moveCursorToPosition(pos);
};
/** /**
* *
* Moves the selection up one row. * Moves the selection up one row.
@ -868,6 +889,27 @@ var Selection = function(session) {
return range; return range;
} }
/**
* Saves the current cursor position and calls `func` that can change the cursor
* postion. The result is the range of the starting and eventual cursor position.
* Will reset the cursor position.
* @param {Function} The callback that should change the cursor position
* @returns {Range}
*
**/
this.getRangeOfMovements = function(func) {
var start = this.getCursor();
try {
func.call(null, this);
var end = this.getCursor();
return Range.fromPoints(start,end);
} catch(e) {
return Range.fromPoints(start,start);
} finally {
this.moveCursorToPosition(start);
}
}
this.toJSON = function() { this.toJSON = function() {
if (this.rangeCount) { if (this.rangeCount) {
var data = this.ranges.map(function(r) { var data = this.ranges.map(function(r) {

File diff suppressed because it is too large Load diff

View file

@ -114,7 +114,6 @@ var Tokenizer = function(rules) {
// makes property access faster // makes property access faster
if (!rule.onMatch) if (!rule.onMatch)
rule.onMatch = null; rule.onMatch = null;
rule.__proto__ = null;
} }
splitterRurles.forEach(function(rule) { splitterRurles.forEach(function(rule) {

View file

@ -33,7 +33,6 @@ define(function(require, exports, module) {
var oop = require("./lib/oop"); var oop = require("./lib/oop");
var dom = require("./lib/dom"); var dom = require("./lib/dom");
var useragent = require("./lib/useragent");
var config = require("./config"); var config = require("./config");
var GutterLayer = require("./layer/gutter").Gutter; var GutterLayer = require("./layer/gutter").Gutter;
var MarkerLayer = require("./layer/marker").Marker; var MarkerLayer = require("./layer/marker").Marker;
@ -42,6 +41,7 @@ var CursorLayer = require("./layer/cursor").Cursor;
var HScrollBar = require("./scrollbar").HScrollBar; var HScrollBar = require("./scrollbar").HScrollBar;
var VScrollBar = require("./scrollbar").VScrollBar; var VScrollBar = require("./scrollbar").VScrollBar;
var RenderLoop = require("./renderloop").RenderLoop; var RenderLoop = require("./renderloop").RenderLoop;
var FontMetrics = require("./layer/font_metrics").FontMetrics;
var EventEmitter = require("./lib/event_emitter").EventEmitter; var EventEmitter = require("./lib/event_emitter").EventEmitter;
var editorCss = require("./requirejs/text!./css/editor.css"); var editorCss = require("./requirejs/text!./css/editor.css");
@ -125,10 +125,12 @@ var VirtualRenderer = function(container, theme) {
column : 0 column : 0
}; };
this.$textLayer.addEventListener("changeCharacterSize", function() { this.$fontMetrics = new FontMetrics(this.container, 500);
this.$textLayer.$setFontMetrics(this.$fontMetrics);
this.$textLayer.addEventListener("changeCharacterSize", function(e) {
_self.updateCharacterSize(); _self.updateCharacterSize();
_self.onResize(true, _self.gutterWidth, _self.$size.width, _self.$size.height); _self.onResize(true, _self.gutterWidth, _self.$size.width, _self.$size.height);
_self._signal("changeCharacterSize"); _self._signal("changeCharacterSize", e);
}); });
this.$size = { this.$size = {
@ -150,7 +152,8 @@ var VirtualRenderer = function(container, theme) {
minHeight : 1, minHeight : 1,
maxHeight : 1, maxHeight : 1,
offset : 0, offset : 0,
height : 1 height : 1,
gutterOffset: 1
}; };
this.scrollMargin = { this.scrollMargin = {
@ -224,8 +227,13 @@ var VirtualRenderer = function(container, theme) {
* Associates the renderer with an [[EditSession `EditSession`]]. * Associates the renderer with an [[EditSession `EditSession`]].
**/ **/
this.setSession = function(session) { this.setSession = function(session) {
if (this.session)
this.session.doc.off("changeNewLineMode", this.onChangeNewLineMode);
this.session = session; this.session = session;
if (!session)
return;
if (this.scrollMargin.top && session.getScrollTop() <= 0) if (this.scrollMargin.top && session.getScrollTop() <= 0)
session.setScrollTop(-this.scrollMargin.top); session.setScrollTop(-this.scrollMargin.top);
@ -235,6 +243,11 @@ var VirtualRenderer = function(container, theme) {
this.$gutterLayer.setSession(session); this.$gutterLayer.setSession(session);
this.$textLayer.setSession(session); this.$textLayer.setSession(session);
this.$loop.schedule(this.CHANGE_FULL); this.$loop.schedule(this.CHANGE_FULL);
this.session.$setFontMetrics(this.$fontMetrics);
this.onChangeNewLineMode = this.onChangeNewLineMode.bind(this);
this.onChangeNewLineMode()
this.session.doc.on("changeNewLineMode", this.onChangeNewLineMode);
}; };
/** /**
@ -268,6 +281,11 @@ var VirtualRenderer = function(container, theme) {
this.$loop.schedule(this.CHANGE_LINES); this.$loop.schedule(this.CHANGE_LINES);
}; };
this.onChangeNewLineMode = function() {
this.$loop.schedule(this.CHANGE_TEXT);
this.$textLayer.$updateEolChar();
};
this.onChangeTabSize = function() { this.onChangeTabSize = function() {
this.$loop.schedule(this.CHANGE_TEXT | this.CHANGE_MARKER); this.$loop.schedule(this.CHANGE_TEXT | this.CHANGE_MARKER);
this.$textLayer.onChangeTabSize(); this.$textLayer.onChangeTabSize();
@ -702,7 +720,7 @@ var VirtualRenderer = function(container, theme) {
sm.v = sm.top + sm.bottom; sm.v = sm.top + sm.bottom;
sm.h = sm.left + sm.right; sm.h = sm.left + sm.right;
if (sm.top && this.scrollTop <= 0 && this.session) if (sm.top && this.scrollTop <= 0 && this.session)
this.session.setScrollTop(sm.top); this.session.setScrollTop(-sm.top);
this.updateFull(); this.updateFull();
}; };
@ -984,7 +1002,7 @@ var VirtualRenderer = function(container, theme) {
minHeight : minHeight, minHeight : minHeight,
maxHeight : maxHeight, maxHeight : maxHeight,
offset : offset, offset : offset,
gutterOffset : Math.ceil((offset + size.height - size.scrollerHeight) / lineHeight), gutterOffset : Math.max(0, Math.ceil((offset + size.height - size.scrollerHeight) / lineHeight)),
height : this.$size.scrollerHeight height : this.$size.scrollerHeight
}; };
@ -1605,6 +1623,7 @@ config.defineOptions(VirtualRenderer.prototype, "renderer", {
showGutter: { showGutter: {
set: function(show){ set: function(show){
this.$gutter.style.display = show ? "block" : "none"; this.$gutter.style.display = show ? "block" : "none";
this.$loop.schedule(this.CHANGE_FULL);
this.onGutterResize(); this.onGutterResize();
}, },
initialValue: true initialValue: true

View file

@ -42,7 +42,7 @@ window.normalizeModule = function(parentId, moduleName) {
window.require = function(parentId, id) { window.require = function(parentId, id) {
if (!id) { if (!id) {
id = parentId id = parentId;
parentId = null; parentId = null;
} }
if (!id.charAt) if (!id.charAt)
@ -81,14 +81,14 @@ window.define = function(id, deps, factory) {
} }
} else if (arguments.length == 1) { } else if (arguments.length == 1) {
factory = id; factory = id;
deps = [] deps = [];
id = window.require.id; id = window.require.id;
} }
if (!deps.length) if (!deps.length)
// If there is no dependencies, we inject 'require', 'exports' and // If there is no dependencies, we inject 'require', 'exports' and
// 'module' as dependencies, to provide CommonJS compatibility. // 'module' as dependencies, to provide CommonJS compatibility.
deps = ['require', 'exports', 'module'] deps = ['require', 'exports', 'module'];
if (id.indexOf("text!") === 0) if (id.indexOf("text!") === 0)
return; return;
@ -105,12 +105,12 @@ window.define = function(id, deps, factory) {
switch(dep) { switch(dep) {
// Because 'require', 'exports' and 'module' aren't actual // Because 'require', 'exports' and 'module' aren't actual
// dependencies, we must handle them seperately. // dependencies, we must handle them seperately.
case 'require': return req case 'require': return req;
case 'exports': return module.exports case 'exports': return module.exports;
case 'module': return module case 'module': return module;
// But for all other dependencies, we can just go ahead and // But for all other dependencies, we can just go ahead and
// require them. // require them.
default: return req(dep) default: return req(dep);
} }
})); }));
if (returnExports) if (returnExports)
@ -119,11 +119,11 @@ window.define = function(id, deps, factory) {
} }
}; };
}; };
window.define.amd = {} window.define.amd = {};
window.initBaseUrls = function initBaseUrls(topLevelNamespaces) { window.initBaseUrls = function initBaseUrls(topLevelNamespaces) {
require.tlns = topLevelNamespaces; require.tlns = topLevelNamespaces;
} };
window.initSender = function initSender() { window.initSender = function initSender() {
@ -155,10 +155,10 @@ window.initSender = function initSender() {
}).call(Sender.prototype); }).call(Sender.prototype);
return new Sender(); return new Sender();
} };
window.main = null; var main = window.main = null;
window.sender = null; var sender = window.sender = null;
window.onmessage = function(e) { window.onmessage = function(e) {
var msg = e.data; var msg = e.data;
@ -171,9 +171,9 @@ window.onmessage = function(e) {
else if (msg.init) { else if (msg.init) {
initBaseUrls(msg.tlns); initBaseUrls(msg.tlns);
require("ace/lib/es5-shim"); require("ace/lib/es5-shim");
sender = initSender(); sender = window.sender = initSender();
var clazz = require(msg.module)[msg.classname]; var clazz = require(msg.module)[msg.classname];
main = new clazz(sender); main = window.main = new clazz(sender);
} }
else if (msg.event && sender) { else if (msg.event && sender) {
sender._signal(msg.event, msg.data); sender._signal(msg.event, msg.data);

View file

@ -32,6 +32,7 @@ define(function(require, exports, module) {
"use strict"; "use strict";
var oop = require("../lib/oop"); var oop = require("../lib/oop");
var net = require("../lib/net");
var EventEmitter = require("../lib/event_emitter").EventEmitter; var EventEmitter = require("../lib/event_emitter").EventEmitter;
var config = require("../config"); var config = require("../config");
@ -183,16 +184,17 @@ var WorkerClient = function(topLevelNamespaces, mod, classname, workerUrl) {
}; };
this.$workerBlob = function(workerUrl) { this.$workerBlob = function(workerUrl) {
var script = 'importScripts("' + workerUrl + '");'; // workerUrl can be protocol relative
// importScripts only takes fully qualified urls
var script = "importScripts('" + net.qualifyURL( workerUrl ) + "');";
try { try {
var blob = new Blob([script], {'type': 'application/javascript'}); return new Blob([script], {"type": "application/javascript"});
} catch (e) { // Backwards-compatibility } catch (e) { // Backwards-compatibility
var BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder; var BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder;
var blobBuilder = new BlobBuilder(); var blobBuilder = new BlobBuilder();
blobBuilder.append(script); blobBuilder.append(script);
blob = blobBuilder.getBlob('application/javascript'); return blobBuilder.getBlob("application/javascript");
} }
return blob;
}; };
}).call(WorkerClient.prototype); }).call(WorkerClient.prototype);
@ -206,6 +208,7 @@ var UIWorkerClient = function(topLevelNamespaces, mod, classname) {
this.messageBuffer = []; this.messageBuffer = [];
var main = null; var main = null;
var emitSync = false;
var sender = Object.create(EventEmitter); var sender = Object.create(EventEmitter);
var _self = this; var _self = this;
@ -213,8 +216,14 @@ var UIWorkerClient = function(topLevelNamespaces, mod, classname) {
this.$worker.terminate = function() {}; this.$worker.terminate = function() {};
this.$worker.postMessage = function(e) { this.$worker.postMessage = function(e) {
_self.messageBuffer.push(e); _self.messageBuffer.push(e);
main && setTimeout(processNext); if (main) {
if (emitSync)
setTimeout(processNext);
else
processNext();
}
}; };
this.setEmitSync = function(val) { emitSync = val };
var processNext = function() { var processNext = function() {
var msg = _self.messageBuffer.shift(); var msg = _self.messageBuffer.shift();