Compare commits
1 commit
master
...
highlighti
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
974ecccfc5 |
6 changed files with 881 additions and 0 deletions
64
lib/ace/mode/eex.js
Normal file
64
lib/ace/mode/eex.js
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
/* ***** 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.
|
||||
*
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
*
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
/*
|
||||
THIS FILE WAS AUTOGENERATED BY mode.tmpl.js
|
||||
*/
|
||||
|
||||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var oop = require("../lib/oop");
|
||||
var TextMode = require("./text").Mode;
|
||||
var Tokenizer = require("../tokenizer").Tokenizer;
|
||||
var EExHighlightRules = require("./eex_highlight_rules").EExHighlightRules;
|
||||
// TODO: pick appropriate fold mode
|
||||
var FoldMode = require("./folding/cstyle").FoldMode;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new EExHighlightRules();
|
||||
this.foldingRules = new FoldMode();
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
(function() {
|
||||
this.lineCommentStart = "<%+#";
|
||||
this.blockComment = {start: "/*", end: "*/"};
|
||||
// Extra logic goes here.
|
||||
}).call(Mode.prototype);
|
||||
|
||||
exports.Mode = Mode;
|
||||
});
|
||||
80
lib/ace/mode/eex_highlight_rules.js
Normal file
80
lib/ace/mode/eex_highlight_rules.js
Normal file
|
|
@ -0,0 +1,80 @@
|
|||
/* ***** 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 ***** */
|
||||
|
||||
/* This file was autogenerated from tool\tm bundles\elixir-tmbundle\Syntaxes\EEx.tmLanguage (uuid: ) */
|
||||
/****************************************************************************************
|
||||
* IT MIGHT NOT BE PERFECT ...But it's a good start from an existing *.tmlanguage file. *
|
||||
* fileTypes *
|
||||
****************************************************************************************/
|
||||
|
||||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var oop = require("../lib/oop");
|
||||
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
||||
|
||||
var EExHighlightRules = function() {
|
||||
// regexp must not have capturing parentheses. Use (?:) instead.
|
||||
// regexps are ordered -> the first match is used
|
||||
|
||||
this.$rules = { start:
|
||||
[ { token: 'punctuation.definition.comment.eex',
|
||||
regex: '<%+#',
|
||||
push:
|
||||
[ { token: 'punctuation.definition.comment.eex',
|
||||
regex: '%>',
|
||||
next: 'pop' },
|
||||
{ defaultToken: 'comment.block.eex' } ] },
|
||||
{ token: 'punctuation.section.embedded.elixir',
|
||||
regex: '<%+(?!>)[-=]+',
|
||||
push:
|
||||
[ { token: 'punctuation.section.embedded.elixir',
|
||||
regex: '-?%>',
|
||||
next: 'pop' },
|
||||
{ token:
|
||||
[ 'punctuation.definition.comment.elixir',
|
||||
'comment.line.number-sign.elixir' ],
|
||||
regex: '(#)(.*?)(?=-?%>)' },
|
||||
{ include: 'source.elixir' },
|
||||
{ defaultToken: 'source.elixir.embedded' } ] } ] }
|
||||
|
||||
this.normalizeRules();
|
||||
};
|
||||
|
||||
EExHighlightRules.metaData = { fileTypes: [ 'eex' ],
|
||||
keyEquivalent: '^~X',
|
||||
name: 'EEx',
|
||||
scopeName: 'text.elixir' }
|
||||
|
||||
|
||||
oop.inherits(EExHighlightRules, TextHighlightRules);
|
||||
|
||||
exports.EExHighlightRules = EExHighlightRules;
|
||||
});
|
||||
64
lib/ace/mode/elixir.js
Normal file
64
lib/ace/mode/elixir.js
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
/* ***** 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.
|
||||
*
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
*
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
/*
|
||||
THIS FILE WAS AUTOGENERATED BY mode.tmpl.js
|
||||
*/
|
||||
|
||||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var oop = require("../lib/oop");
|
||||
var TextMode = require("./text").Mode;
|
||||
var Tokenizer = require("../tokenizer").Tokenizer;
|
||||
var ElixirHighlightRules = require("./elixir_highlight_rules").ElixirHighlightRules;
|
||||
// TODO: pick appropriate fold mode
|
||||
var FoldMode = require("./folding/cstyle").FoldMode;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new ElixirHighlightRules();
|
||||
this.foldingRules = new FoldMode();
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
(function() {
|
||||
this.lineCommentStart = "@(?:module)?doc \"";
|
||||
this.blockComment = {start: "/*", end: "*/"};
|
||||
// Extra logic goes here.
|
||||
}).call(Mode.prototype);
|
||||
|
||||
exports.Mode = Mode;
|
||||
});
|
||||
547
lib/ace/mode/elixir_highlight_rules.js
Normal file
547
lib/ace/mode/elixir_highlight_rules.js
Normal file
|
|
@ -0,0 +1,547 @@
|
|||
/* ***** 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 ***** */
|
||||
|
||||
/* This file was autogenerated from tool\tm bundles\elixir-tmbundle\Syntaxes\Elixir.tmLanguage (uuid: ) */
|
||||
/****************************************************************************************
|
||||
* IT MIGHT NOT BE PERFECT ...But it's a good start from an existing *.tmlanguage file. *
|
||||
* fileTypes *
|
||||
****************************************************************************************/
|
||||
|
||||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var oop = require("../lib/oop");
|
||||
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
||||
|
||||
var ElixirHighlightRules = function() {
|
||||
// regexp must not have capturing parentheses. Use (?:) instead.
|
||||
// regexps are ordered -> the first match is used
|
||||
|
||||
this.$rules = { start:
|
||||
[ { token:
|
||||
[ 'meta.module.elixir',
|
||||
'keyword.control.module.elixir',
|
||||
'meta.module.elixir',
|
||||
'entity.name.type.module.elixir' ],
|
||||
regex: '^(\\s*)(defmodule)(\\s+)((?:[A-Z]\\w*\\s*\\.\\s*)*[A-Z]\\w*)' },
|
||||
{ token: 'comment.documentation.heredoc',
|
||||
regex: '@(?:module)?doc (?:%[a-z])?"""',
|
||||
push:
|
||||
[ { token: 'comment.documentation.heredoc',
|
||||
regex: '\\s*"""$',
|
||||
next: 'pop' },
|
||||
{ include: '#interpolated_elixir' },
|
||||
{ include: '#escaped_char' },
|
||||
{ defaultToken: 'comment.documentation.heredoc' } ],
|
||||
comment: '@doc with heredocs is treated as documentation' },
|
||||
{ token: 'comment.documentation.heredoc',
|
||||
regex: '@(?:module)?doc %[A-B]"""',
|
||||
push:
|
||||
[ { token: 'comment.documentation.heredoc',
|
||||
regex: '\\s*"""$',
|
||||
next: 'pop' },
|
||||
{ defaultToken: 'comment.documentation.heredoc' } ],
|
||||
comment: '@doc with heredocs is treated as documentation' },
|
||||
{ token: 'comment.documentation.false',
|
||||
regex: '@(?:module)?doc false',
|
||||
comment: '@doc false is treated as documentation' },
|
||||
{ token: 'comment.documentation.string',
|
||||
regex: '@(?:module)?doc "',
|
||||
push:
|
||||
[ { token: 'comment.documentation.string',
|
||||
regex: '"',
|
||||
next: 'pop' },
|
||||
{ include: '#interpolated_elixir' },
|
||||
{ include: '#escaped_char' },
|
||||
{ defaultToken: 'comment.documentation.string' } ],
|
||||
comment: '@doc with string is treated as documentation' },
|
||||
{ token: 'keyword.control.elixir',
|
||||
regex: '(?<!\\.)\\b(?:do|end|case|bc|lc|if|cond|unless|try|receive|fn|defmodule|defp?|defprotocol|defimpl|defrecord|defmacrop?|defdelegate|defcallback|defexception|exit|after|rescue|catch|else|raise|throw)\\b(?![?!])',
|
||||
TODO: 'FIXME: regexp doesn\'t have js equivalent',
|
||||
originalRegex: '(?<!\\.)\\b(do|end|case|bc|lc|if|cond|unless|try|receive|fn|defmodule|defp?|defprotocol|defimpl|defrecord|defmacrop?|defdelegate|defcallback|defexception|exit|after|rescue|catch|else|raise|throw)\\b(?![?!])' },
|
||||
{ token: 'keyword.operator.logical.elixir',
|
||||
regex: '(?<!\\.)\\b(?:and|not|or|when|xor|in|inlist|inbits)\\b',
|
||||
TODO: 'FIXME: regexp doesn\'t have js equivalent',
|
||||
originalRegex: '(?<!\\.)\\b(and|not|or|when|xor|in|inlist|inbits)\\b',
|
||||
comment: ' as above, just doesn\'t need a \'end\' and does a logic operation' },
|
||||
{ token: 'constant.language.elixir',
|
||||
regex: '\\b(?:nil|true|false)\\b(?![?!])' },
|
||||
{ token: 'variable.language.elixir',
|
||||
regex: '\\b__(?:FILE|CALLER|ENV|MODULE|DIR)__\\b(?![?!])' },
|
||||
{ token:
|
||||
[ 'punctuation.definition.variable.elixir',
|
||||
'variable.other.readwrite.module.elixir' ],
|
||||
regex: '(@)([a-zA-Z_]\\w*)' },
|
||||
{ token:
|
||||
[ 'punctuation.definition.variable.elixir',
|
||||
'variable.other.anonymous.elixir' ],
|
||||
regex: '(&)(\\d)' },
|
||||
{ token: 'keyword.other.special.elixir',
|
||||
regex: '\\b(?:import|require|alias|use|quote|unquote|super)\\b(?![?!])',
|
||||
comment: ' everything being a special function is a..' },
|
||||
{ token: 'variable.other.constant.elixir',
|
||||
regex: '\\b[A-Z]\\w*\\b' },
|
||||
{ token: 'constant.numeric.elixir',
|
||||
regex: '\\b(?:0[xX][\\da-fA-F](?>_?[\\da-fA-F])*|\\d(?>_?\\d)*(?:\\.(?![^[:space:][:digit:]])(?>_?\\d)*)?(?:[eE][-+]?\\d(?>_?\\d)*)?|0[bB][01]+)\\b',
|
||||
TODO: 'FIXME: regexp doesn\'t have js equivalent',
|
||||
originalRegex: '\\b(0[xX]\\h(?>_?\\h)*|\\d(?>_?\\d)*(\\.(?![^[:space:][:digit:]])(?>_?\\d)*)?([eE][-+]?\\d(?>_?\\d)*)?|0[bB][01]+)\\b' },
|
||||
{ token: 'punctuation.definition.constant.elixir',
|
||||
regex: ':\'',
|
||||
push:
|
||||
[ { token: 'punctuation.definition.constant.elixir',
|
||||
regex: '\'',
|
||||
next: 'pop' },
|
||||
{ include: '#interpolated_elixir' },
|
||||
{ include: '#escaped_char' },
|
||||
{ defaultToken: 'constant.other.symbol.single-quoted.elixir' } ] },
|
||||
{ token: 'punctuation.definition.constant.elixir',
|
||||
regex: ':"',
|
||||
push:
|
||||
[ { token: 'punctuation.definition.constant.elixir',
|
||||
regex: '"',
|
||||
next: 'pop' },
|
||||
{ include: '#interpolated_elixir' },
|
||||
{ include: '#escaped_char' },
|
||||
{ defaultToken: 'constant.other.symbol.double-quoted.elixir' } ] },
|
||||
{ token: 'punctuation.definition.string.begin.elixir',
|
||||
regex: '(?>\'\'\')',
|
||||
TODO: 'FIXME: regexp doesn\'t have js equivalent',
|
||||
originalRegex: '(?>\'\'\')',
|
||||
push:
|
||||
[ { token: 'punctuation.definition.string.end.elixir',
|
||||
regex: '^\\s*\'\'\'$',
|
||||
next: 'pop' },
|
||||
{ include: '#interpolated_elixir' },
|
||||
{ include: '#escaped_char' },
|
||||
{ defaultToken: 'support.function.variable.quoted.single.heredoc.elixir' } ],
|
||||
comment: 'Single-quoted heredocs' },
|
||||
{ token: 'punctuation.definition.string.begin.elixir',
|
||||
regex: '\'',
|
||||
push:
|
||||
[ { token: 'punctuation.definition.string.end.elixir',
|
||||
regex: '\'',
|
||||
next: 'pop' },
|
||||
{ include: '#interpolated_elixir' },
|
||||
{ include: '#escaped_char' },
|
||||
{ defaultToken: 'support.function.variable.quoted.single.elixir' } ],
|
||||
comment: 'single quoted string (allows for interpolation)' },
|
||||
{ token: 'punctuation.definition.string.begin.elixir',
|
||||
regex: '(?>""")',
|
||||
TODO: 'FIXME: regexp doesn\'t have js equivalent',
|
||||
originalRegex: '(?>""")',
|
||||
push:
|
||||
[ { token: 'punctuation.definition.string.end.elixir',
|
||||
regex: '^\\s*"""$',
|
||||
next: 'pop' },
|
||||
{ include: '#interpolated_elixir' },
|
||||
{ include: '#escaped_char' },
|
||||
{ defaultToken: 'string.quoted.double.heredoc.elixir' } ],
|
||||
comment: 'Double-quoted heredocs' },
|
||||
{ token: 'punctuation.definition.string.begin.elixir',
|
||||
regex: '"',
|
||||
push:
|
||||
[ { token: 'punctuation.definition.string.end.elixir',
|
||||
regex: '"',
|
||||
next: 'pop' },
|
||||
{ include: '#interpolated_elixir' },
|
||||
{ include: '#escaped_char' },
|
||||
{ defaultToken: 'string.quoted.double.elixir' } ],
|
||||
comment: 'double quoted string (allows for interpolation)' },
|
||||
{ token: 'punctuation.definition.string.begin.elixir',
|
||||
regex: '%[a-z](?>""")',
|
||||
TODO: 'FIXME: regexp doesn\'t have js equivalent',
|
||||
originalRegex: '%[a-z](?>""")',
|
||||
push:
|
||||
[ { token: 'punctuation.definition.string.end.elixir',
|
||||
regex: '^\\s*"""$',
|
||||
next: 'pop' },
|
||||
{ include: '#interpolated_elixir' },
|
||||
{ defaultToken: 'string.quoted.double.heredoc.elixir' } ],
|
||||
comment: 'Double-quoted heredocs sigils' },
|
||||
{ token: 'punctuation.definition.string.begin.elixir',
|
||||
regex: '%[a-z]\\{',
|
||||
push:
|
||||
[ { token: 'punctuation.definition.string.end.elixir',
|
||||
regex: '\\}[a-z]*',
|
||||
next: 'pop' },
|
||||
{ include: '#interpolated_elixir' },
|
||||
{ include: '#nest_curly_i' },
|
||||
{ defaultToken: 'string.interpolated.elixir' } ],
|
||||
comment: 'sigil (allow for interpolation)' },
|
||||
{ token: 'punctuation.definition.string.begin.elixir',
|
||||
regex: '%[a-z]\\[',
|
||||
push:
|
||||
[ { token: 'punctuation.definition.string.end.elixir',
|
||||
regex: '\\][a-z]*',
|
||||
next: 'pop' },
|
||||
{ include: '#interpolated_elixir' },
|
||||
{ include: '#nest_brackets_i' },
|
||||
{ defaultToken: 'string.interpolated.elixir' } ],
|
||||
comment: 'sigil (allow for interpolation)' },
|
||||
{ token: 'punctuation.definition.string.begin.elixir',
|
||||
regex: '%[a-z]\\<',
|
||||
push:
|
||||
[ { token: 'punctuation.definition.string.end.elixir',
|
||||
regex: '\\>[a-z]*',
|
||||
next: 'pop' },
|
||||
{ include: '#interpolated_elixir' },
|
||||
{ include: '#nest_ltgt_i' },
|
||||
{ defaultToken: 'string.interpolated.elixir' } ],
|
||||
comment: 'sigil (allow for interpolation)' },
|
||||
{ token: 'punctuation.definition.string.begin.elixir',
|
||||
regex: '%[a-z]\\(',
|
||||
push:
|
||||
[ { token: 'punctuation.definition.string.end.elixir',
|
||||
regex: '\\)[a-z]*',
|
||||
next: 'pop' },
|
||||
{ include: '#interpolated_elixir' },
|
||||
{ include: '#nest_parens_i' },
|
||||
{ defaultToken: 'string.interpolated.elixir' } ],
|
||||
comment: 'sigil (allow for interpolation)' },
|
||||
{ token: 'punctuation.definition.string.begin.elixir',
|
||||
regex: '%[a-z][^\\w]',
|
||||
push:
|
||||
[ { token: 'punctuation.definition.string.end.elixir',
|
||||
regex: '[^\\w][a-z]*',
|
||||
next: 'pop' },
|
||||
{ include: '#interpolated_elixir' },
|
||||
{ defaultToken: 'string.interpolated.elixir' } ],
|
||||
comment: 'sigil (allow for interpolation)' },
|
||||
{ token: 'punctuation.definition.string.begin.elixir',
|
||||
regex: '%[A-Z](?>""")',
|
||||
TODO: 'FIXME: regexp doesn\'t have js equivalent',
|
||||
originalRegex: '%[A-Z](?>""")',
|
||||
push:
|
||||
[ { token: 'punctuation.definition.string.end.elixir',
|
||||
regex: '^\\s*"""$',
|
||||
next: 'pop' },
|
||||
{ defaultToken: 'string.quoted.other.literal.upper.elixir' } ],
|
||||
comment: 'Double-quoted heredocs sigils' },
|
||||
{ token: 'punctuation.definition.string.begin.elixir',
|
||||
regex: '%[A-Z]\\{',
|
||||
push:
|
||||
[ { token: 'punctuation.definition.string.end.elixir',
|
||||
regex: '\\}[a-z]*',
|
||||
next: 'pop' },
|
||||
{ include: '#nest_curly_i' },
|
||||
{ defaultToken: 'string.quoted.other.literal.upper.elixir' } ],
|
||||
comment: 'sigil (without interpolation)' },
|
||||
{ token: 'punctuation.definition.string.begin.elixir',
|
||||
regex: '%[A-Z]\\[',
|
||||
push:
|
||||
[ { token: 'punctuation.definition.string.end.elixir',
|
||||
regex: '\\][a-z]*',
|
||||
next: 'pop' },
|
||||
{ include: '#nest_brackets_i' },
|
||||
{ defaultToken: 'string.quoted.other.literal.upper.elixir' } ],
|
||||
comment: 'sigil (without interpolation)' },
|
||||
{ token: 'punctuation.definition.string.begin.elixir',
|
||||
regex: '%[A-Z]\\<',
|
||||
push:
|
||||
[ { token: 'punctuation.definition.string.end.elixir',
|
||||
regex: '\\>[a-z]*',
|
||||
next: 'pop' },
|
||||
{ include: '#nest_ltgt_i' },
|
||||
{ defaultToken: 'string.quoted.other.literal.upper.elixir' } ],
|
||||
comment: 'sigil (without interpolation)' },
|
||||
{ token: 'punctuation.definition.string.begin.elixir',
|
||||
regex: '%[A-Z]\\(',
|
||||
push:
|
||||
[ { token: 'punctuation.definition.string.end.elixir',
|
||||
regex: '\\)[a-z]*',
|
||||
next: 'pop' },
|
||||
{ include: '#nest_parens_i' },
|
||||
{ defaultToken: 'string.quoted.other.literal.upper.elixir' } ],
|
||||
comment: 'sigil (without interpolation)' },
|
||||
{ token: 'punctuation.definition.string.begin.elixir',
|
||||
regex: '%[A-Z][^\\w]',
|
||||
push:
|
||||
[ { token: 'punctuation.definition.string.end.elixir',
|
||||
regex: '[^\\w][a-z]*',
|
||||
next: 'pop' },
|
||||
{ include: '#escaped_char' },
|
||||
{ defaultToken: 'string.quoted.other.literal.upper.elixir' } ],
|
||||
comment: 'sigil (without interpolation)' },
|
||||
{ token: 'punctuation.definition.constant.elixir',
|
||||
regex: '(?<!:):(?>[a-zA-Z_][\\w@]*(?>[?!]|=(?![>=]))?|\\<\\>|===?|!==?|<<>>|<<<|>>>|~~~|::|<\\-|/>|=~?|//?|\\*\\*?|\\.\\.?|>=?|<=?|&&?&?|\\+\\+?|\\-\\-?|\\|\\|?\\|?|\\!|@|\\^(?:\\^\\^)?)',
|
||||
TODO: 'FIXME: regexp doesn\'t have js equivalent',
|
||||
originalRegex: '(?<!:)(:)(?>[a-zA-Z_][\\w@]*(?>[?!]|=(?![>=]))?|\\<\\>|===?|!==?|<<>>|<<<|>>>|~~~|::|<\\-|/>|=~?|//?|\\*\\*?|\\.\\.?|>=?|<=?|&&?&?|\\+\\+?|\\-\\-?|\\|\\|?\\|?|\\!|@|\\^(\\^\\^)?)',
|
||||
comment: 'symbols' },
|
||||
{ token: 'punctuation.definition.constant.elixir',
|
||||
regex: '(?>[a-zA-Z_][\\w@]*(?>[?!])?):(?!:)',
|
||||
TODO: 'FIXME: regexp doesn\'t have js equivalent',
|
||||
originalRegex: '(?>[a-zA-Z_][\\w@]*(?>[?!])?)(:)(?!:)',
|
||||
comment: 'symbols' },
|
||||
{ token:
|
||||
[ 'punctuation.definition.comment.elixir',
|
||||
'comment.line.number-sign.elixir' ],
|
||||
regex: '(?:^[ \\t]+)?(#)(.*$)' },
|
||||
{ token: 'constant.numeric.elixir',
|
||||
regex: '(?<!\\w)\\?(?:\\\\(?:x[\\da-fA-F]{1,2}(?![\\da-fA-F])\\b|0[0-7]{0,2}(?![0-7])\\b|[^x0MC])|(?:\\\\[MC]-)+\\w|[^\\s\\\\])',
|
||||
TODO: 'FIXME: regexp doesn\'t have js equivalent',
|
||||
originalRegex: '(?<!\\w)\\?(\\\\(x\\h{1,2}(?!\\h)\\b|0[0-7]{0,2}(?![0-7])\\b|[^x0MC])|(\\\\[MC]-)+\\w|[^\\s\\\\])',
|
||||
comment: '\n\t\t\tmatches questionmark-letters.\n\n\t\t\texamples (1st alternation = hex):\n\t\t\t?\\x1 ?\\x61\n\n\t\t\texamples (2nd alternation = octal):\n\t\t\t?\\0 ?\\07 ?\\017\n\n\t\t\texamples (3rd alternation = escaped):\n\t\t\t?\\n ?\\b\n\n\t\t\texamples (4th alternation = meta-ctrl):\n\t\t\t?\\C-a ?\\M-a ?\\C-\\M-\\C-\\M-a\n\n\t\t\texamples (4th alternation = normal):\n\t\t\t?a ?A ?0 \n\t\t\t?* ?" ?( \n\t\t\t?. ?#\n\t\t\t\n\t\t\t\n\t\t\tthe negative lookbehind prevents against matching\n\t\t\tp(42.tainted?)\n\t\t\t' },
|
||||
{ token: 'string.unquoted.program-block.elixir',
|
||||
regex: '^__END__$',
|
||||
push:
|
||||
[ { token: 'string.unquoted.program-block.elixir',
|
||||
regex: '(?=not)impossible',
|
||||
next: 'pop' },
|
||||
{ token: 'text.html.embedded.elixir',
|
||||
regex: '(?=<?xml|<html\\b|!DOCTYPE html\\b)',
|
||||
caseInsensitive: true,
|
||||
push:
|
||||
[ { token: 'text.html.embedded.elixir',
|
||||
regex: '(?=not)impossible',
|
||||
next: 'pop' },
|
||||
{ include: 'text.html.basic' },
|
||||
{ defaultToken: 'text.html.embedded.elixir' } ] },
|
||||
{ defaultToken: 'text.plain' } ],
|
||||
comment: '__END__ marker' },
|
||||
{ token: 'punctuation.separator.variable.elixir',
|
||||
regex: '(?<=\\{|do|\\{\\s|do\\s)\\|',
|
||||
TODO: 'FIXME: regexp doesn\'t have js equivalent',
|
||||
originalRegex: '(?<=\\{|do|\\{\\s|do\\s)(\\|)',
|
||||
push:
|
||||
[ { token: 'punctuation.separator.variable.elixir',
|
||||
regex: '\\|',
|
||||
next: 'pop' },
|
||||
{ token: 'variable.other.block.elixir',
|
||||
regex: '[_a-zA-Z][_a-zA-Z0-9]*' },
|
||||
{ token: 'punctuation.separator.variable.elixir', regex: ',' } ] },
|
||||
{ token: 'keyword.operator.assignment.augmented.elixir',
|
||||
regex: '\\+=|\\-=|\\|\\|=' },
|
||||
{ token: 'keyword.operator.comparison.elixir',
|
||||
regex: '===?|!==?|<=?|>=?' },
|
||||
{ token: 'keyword.operator.bitwise.elixir',
|
||||
regex: '\\|\\|\\||&&&|^^^|<<<|>>>|~~~' },
|
||||
{ token: 'keyword.operator.logical.elixir',
|
||||
regex: '(?<=[ \\t])!+|\\bnot\\b|&&|\\band\\b|\\|\\||\\bor\\b|\\bxor\\b',
|
||||
TODO: 'FIXME: regexp doesn\'t have js equivalent',
|
||||
originalRegex: '(?<=[ \\t])!+|\\bnot\\b|&&|\\band\\b|\\|\\||\\bor\\b|\\bxor\\b' },
|
||||
{ token: 'keyword.operator.arithmetic.elixir',
|
||||
regex: '\\*|\\+|\\-|/' },
|
||||
{ token: 'keyword.operator.other.elixir',
|
||||
regex: '\\||\\+\\+|\\-\\-|\\*\\*|\\/\\/|\\<\\-|\\<\\>|\\<\\<|\\>\\>|\\:\\:|\\.\\.|/>|=~' },
|
||||
{ token: 'keyword.operator.assignment.elixir', regex: '=' },
|
||||
{ token: 'punctuation.separator.other.elixir', regex: ':' },
|
||||
{ token: 'punctuation.separator.statement.elixir',
|
||||
regex: '\\;' },
|
||||
{ token: 'punctuation.separator.object.elixir', regex: ',' },
|
||||
{ token: 'punctuation.separator.method.elixir', regex: '\\.' },
|
||||
{ token: 'punctuation.section.scope.elixir', regex: '\\{|\\}' },
|
||||
{ token: 'punctuation.section.array.elixir', regex: '\\[|\\]' },
|
||||
{ token: 'punctuation.section.function.elixir',
|
||||
regex: '\\(|\\)' } ],
|
||||
'#escaped_char':
|
||||
[ { token: 'constant.character.escape.elixir',
|
||||
regex: '\\\\(?:[0-7]{1,3}|x[\\da-fA-F]{1,2}|.)' } ],
|
||||
'#interpolated_elixir':
|
||||
[ { token:
|
||||
[ 'source.elixir.embedded.source',
|
||||
'source.elixir.embedded.source.empty' ],
|
||||
regex: '(#\\{)(\\})' },
|
||||
{ todo:
|
||||
{ token: 'punctuation.section.embedded.elixir',
|
||||
regex: '#\\{',
|
||||
push:
|
||||
[ { token: 'punctuation.section.embedded.elixir',
|
||||
regex: '\\}',
|
||||
next: 'pop' },
|
||||
{ include: '#nest_curly_and_self' },
|
||||
{ include: '$self' },
|
||||
{ defaultToken: 'source.elixir.embedded.source' } ] } } ],
|
||||
'#nest_brackets':
|
||||
[ { token: 'punctuation.section.scope.elixir',
|
||||
regex: '\\[',
|
||||
push:
|
||||
[ { token: 'punctuation.section.scope.elixir',
|
||||
regex: '\\]',
|
||||
next: 'pop' },
|
||||
{ include: '#nest_brackets' } ] } ],
|
||||
'#nest_brackets_i':
|
||||
[ { token: 'punctuation.section.scope.elixir',
|
||||
regex: '\\[',
|
||||
push:
|
||||
[ { token: 'punctuation.section.scope.elixir',
|
||||
regex: '\\]',
|
||||
next: 'pop' },
|
||||
{ include: '#interpolated_elixir' },
|
||||
{ include: '#escaped_char' },
|
||||
{ include: '#nest_brackets_i' } ] } ],
|
||||
'#nest_brackets_r':
|
||||
[ { token: 'punctuation.section.scope.elixir',
|
||||
regex: '\\[',
|
||||
push:
|
||||
[ { token: 'punctuation.section.scope.elixir',
|
||||
regex: '\\]',
|
||||
next: 'pop' },
|
||||
{ include: '#regex_sub' },
|
||||
{ include: '#nest_brackets_r' } ] } ],
|
||||
'#nest_curly':
|
||||
[ { token: 'punctuation.section.scope.elixir',
|
||||
regex: '\\{',
|
||||
push:
|
||||
[ { token: 'punctuation.section.scope.elixir',
|
||||
regex: '\\}',
|
||||
next: 'pop' },
|
||||
{ include: '#nest_curly' } ] } ],
|
||||
'#nest_curly_and_self':
|
||||
[ { token: 'punctuation.section.scope.elixir',
|
||||
regex: '\\{',
|
||||
push:
|
||||
[ { token: 'punctuation.section.scope.elixir',
|
||||
regex: '\\}',
|
||||
next: 'pop' },
|
||||
{ include: '#nest_curly_and_self' } ] },
|
||||
{ include: '$self' } ],
|
||||
'#nest_curly_i':
|
||||
[ { token: 'punctuation.section.scope.elixir',
|
||||
regex: '\\{',
|
||||
push:
|
||||
[ { token: 'punctuation.section.scope.elixir',
|
||||
regex: '\\}',
|
||||
next: 'pop' },
|
||||
{ include: '#interpolated_elixir' },
|
||||
{ include: '#escaped_char' },
|
||||
{ include: '#nest_curly_i' } ] } ],
|
||||
'#nest_curly_r':
|
||||
[ { token: 'punctuation.section.scope.elixir',
|
||||
regex: '\\{',
|
||||
push:
|
||||
[ { token: 'punctuation.section.scope.elixir',
|
||||
regex: '\\}',
|
||||
next: 'pop' },
|
||||
{ include: '#regex_sub' },
|
||||
{ include: '#nest_curly_r' } ] } ],
|
||||
'#nest_ltgt':
|
||||
[ { token: 'punctuation.section.scope.elixir',
|
||||
regex: '\\<',
|
||||
push:
|
||||
[ { token: 'punctuation.section.scope.elixir',
|
||||
regex: '\\>',
|
||||
next: 'pop' },
|
||||
{ include: '#nest_ltgt' } ] } ],
|
||||
'#nest_ltgt_i':
|
||||
[ { token: 'punctuation.section.scope.elixir',
|
||||
regex: '\\<',
|
||||
push:
|
||||
[ { token: 'punctuation.section.scope.elixir',
|
||||
regex: '\\>',
|
||||
next: 'pop' },
|
||||
{ include: '#interpolated_elixir' },
|
||||
{ include: '#escaped_char' },
|
||||
{ include: '#nest_ltgt_i' } ] } ],
|
||||
'#nest_ltgt_r':
|
||||
[ { token: 'punctuation.section.scope.elixir',
|
||||
regex: '\\<',
|
||||
push:
|
||||
[ { token: 'punctuation.section.scope.elixir',
|
||||
regex: '\\>',
|
||||
next: 'pop' },
|
||||
{ include: '#regex_sub' },
|
||||
{ include: '#nest_ltgt_r' } ] } ],
|
||||
'#nest_parens':
|
||||
[ { token: 'punctuation.section.scope.elixir',
|
||||
regex: '\\(',
|
||||
push:
|
||||
[ { token: 'punctuation.section.scope.elixir',
|
||||
regex: '\\)',
|
||||
next: 'pop' },
|
||||
{ include: '#nest_parens' } ] } ],
|
||||
'#nest_parens_i':
|
||||
[ { token: 'punctuation.section.scope.elixir',
|
||||
regex: '\\(',
|
||||
push:
|
||||
[ { token: 'punctuation.section.scope.elixir',
|
||||
regex: '\\)',
|
||||
next: 'pop' },
|
||||
{ include: '#interpolated_elixir' },
|
||||
{ include: '#escaped_char' },
|
||||
{ include: '#nest_parens_i' } ] } ],
|
||||
'#nest_parens_r':
|
||||
[ { token: 'punctuation.section.scope.elixir',
|
||||
regex: '\\(',
|
||||
push:
|
||||
[ { token: 'punctuation.section.scope.elixir',
|
||||
regex: '\\)',
|
||||
next: 'pop' },
|
||||
{ include: '#regex_sub' },
|
||||
{ include: '#nest_parens_r' } ] } ],
|
||||
'#regex_sub':
|
||||
[ { include: '#interpolated_elixir' },
|
||||
{ include: '#escaped_char' },
|
||||
{ token:
|
||||
[ 'punctuation.definition.arbitrary-repitition.elixir',
|
||||
'string.regexp.arbitrary-repitition.elixir',
|
||||
'string.regexp.arbitrary-repitition.elixir',
|
||||
'punctuation.definition.arbitrary-repitition.elixir' ],
|
||||
regex: '(\\{)(\\d+)((?:,\\d+)?)(\\})' },
|
||||
{ token: 'punctuation.definition.character-class.elixir',
|
||||
regex: '\\[(?:\\^?\\])?',
|
||||
push:
|
||||
[ { token: 'punctuation.definition.character-class.elixir',
|
||||
regex: '\\]',
|
||||
next: 'pop' },
|
||||
{ include: '#escaped_char' },
|
||||
{ defaultToken: 'string.regexp.character-class.elixir' } ] },
|
||||
{ token: 'punctuation.definition.group.elixir',
|
||||
regex: '\\(',
|
||||
push:
|
||||
[ { token: 'punctuation.definition.group.elixir',
|
||||
regex: '\\)',
|
||||
next: 'pop' },
|
||||
{ include: '#regex_sub' },
|
||||
{ defaultToken: 'string.regexp.group.elixir' } ] },
|
||||
{ token:
|
||||
[ 'punctuation.definition.comment.elixir',
|
||||
'comment.line.number-sign.elixir' ],
|
||||
regex: '(?<=^|\\s)(#)(\\s[[a-zA-Z0-9,. \\t?!-][^\\x00-\\x7F]]*$)',
|
||||
TODO: 'FIXME: regexp doesn\'t have js equivalent',
|
||||
originalRegex: '(?<=^|\\s)(#)\\s[[a-zA-Z0-9,. \\t?!-][^\\x{00}-\\x{7F}]]*$',
|
||||
comment: 'We are restrictive in what we allow to go after the comment character to avoid false positives, since the availability of comments depend on regexp flags.' } ] }
|
||||
|
||||
this.normalizeRules();
|
||||
};
|
||||
|
||||
ElixirHighlightRules.metaData = { comment: 'Textmate bundle for Elixir Programming Language.',
|
||||
fileTypes: [ 'ex', 'exs' ],
|
||||
firstLineMatch: '^#!/.*\\belixir',
|
||||
foldingStartMarker: '(after|else|catch|rescue|\\-\\>|\\{|\\[|do)\\s*$',
|
||||
foldingStopMarker: '^\\s*((\\}|\\]|after|else|catch|rescue)\\s*$|end\\b)',
|
||||
keyEquivalent: '^~E',
|
||||
name: 'Elixir',
|
||||
scopeName: 'source.elixir' }
|
||||
|
||||
|
||||
oop.inherits(ElixirHighlightRules, TextHighlightRules);
|
||||
|
||||
exports.ElixirHighlightRules = ElixirHighlightRules;
|
||||
});
|
||||
64
lib/ace/mode/html_eex.js
Normal file
64
lib/ace/mode/html_eex.js
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
/* ***** 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.
|
||||
*
|
||||
*
|
||||
* Contributor(s):
|
||||
*
|
||||
*
|
||||
*
|
||||
* ***** END LICENSE BLOCK ***** */
|
||||
|
||||
/*
|
||||
THIS FILE WAS AUTOGENERATED BY mode.tmpl.js
|
||||
*/
|
||||
|
||||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var oop = require("../lib/oop");
|
||||
var TextMode = require("./text").Mode;
|
||||
var Tokenizer = require("../tokenizer").Tokenizer;
|
||||
var HTMLEExHighlightRules = require("./html_eex_highlight_rules").HTMLEExHighlightRules;
|
||||
// TODO: pick appropriate fold mode
|
||||
var FoldMode = require("./folding/cstyle").FoldMode;
|
||||
|
||||
var Mode = function() {
|
||||
var highlighter = new HTMLEExHighlightRules();
|
||||
this.foldingRules = new FoldMode();
|
||||
this.$tokenizer = new Tokenizer(highlighter.getRules());
|
||||
};
|
||||
oop.inherits(Mode, TextMode);
|
||||
|
||||
(function() {
|
||||
this.lineCommentStart = "//";
|
||||
this.blockComment = {start: "/*", end: "*/"};
|
||||
// Extra logic goes here.
|
||||
}).call(Mode.prototype);
|
||||
|
||||
exports.Mode = Mode;
|
||||
});
|
||||
62
lib/ace/mode/html_eex_highlight_rules.js
Normal file
62
lib/ace/mode/html_eex_highlight_rules.js
Normal file
|
|
@ -0,0 +1,62 @@
|
|||
/* ***** 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 ***** */
|
||||
|
||||
/* This file was autogenerated from tool\tm bundles\elixir-tmbundle\Syntaxes\HTML (EEx).tmLanguage (uuid: ) */
|
||||
/****************************************************************************************
|
||||
* IT MIGHT NOT BE PERFECT ...But it's a good start from an existing *.tmlanguage file. *
|
||||
* fileTypes *
|
||||
****************************************************************************************/
|
||||
|
||||
define(function(require, exports, module) {
|
||||
"use strict";
|
||||
|
||||
var oop = require("../lib/oop");
|
||||
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
|
||||
|
||||
var HTMLEExHighlightRules = function() {
|
||||
// regexp must not have capturing parentheses. Use (?:) instead.
|
||||
// regexps are ordered -> the first match is used
|
||||
|
||||
this.$rules = { start: [ { include: 'text.elixir' }, { include: 'text.html.basic' } ] }
|
||||
|
||||
this.normalizeRules();
|
||||
};
|
||||
|
||||
HTMLEExHighlightRules.metaData = { fileTypes: [ 'html.eex' ],
|
||||
foldingStartMarker: '(?x)\n\t\t(<(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|form|dl)\\b.*?>\n\t\t|<!--(?!.*-->)\n\t\t|\\{\\s*($|\\?>\\s*$|//|/\\*(.*\\*/\\s*$|(?!.*?\\*/)))\n\t\t)',
|
||||
foldingStopMarker: '(?x)\n\t\t(</(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style|script|ul|ol|form|dl)>\n\t\t|^\\s*-->\n\t\t|(^|\\s)\\}\n\t\t)',
|
||||
name: 'HTML (EEx)',
|
||||
scopeName: 'text.html.elixir' }
|
||||
|
||||
|
||||
oop.inherits(HTMLEExHighlightRules, TextHighlightRules);
|
||||
|
||||
exports.HTMLEExHighlightRules = HTMLEExHighlightRules;
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue