pull/333/head
nightwing 2016-07-16 20:25:30 +04:00
rodzic 6600767506
commit d200fccfd6
21 zmienionych plików z 298 dodań i 100 usunięć

Wyświetl plik

@ -75,19 +75,20 @@ var supportedModes = {
Elixir: ["ex|exs"],
Elm: ["elm"],
Erlang: ["erl|hrl"],
Forth: ["frt|fs|ldr"],
Forth: ["frt|fs|ldr|fth|4th"],
Fortran: ["f|f90"],
FTL: ["ftl"],
Gcode: ["gcode"],
Gherkin: ["feature"],
Gitignore: ["^.gitignore"],
Glsl: ["glsl|frag|vert"],
Gobstones: ["gbs"],
Gobstones: ["gbs"],
golang: ["go"],
Groovy: ["groovy"],
HAML: ["haml"],
Handlebars: ["hbs|handlebars|tpl|mustache"],
Haskell: ["hs"],
Haskell_Cabal: ["cabal"],
haXe: ["hx"],
HTML: ["html|htm|xhtml"],
HTML_Elixir: ["eex|html.eex"],
@ -104,7 +105,6 @@ var supportedModes = {
JSX: ["jsx"],
Julia: ["jl"],
LaTeX: ["tex|latex|ltx|bib"],
Lean: ["lean|hlean"],
LESS: ["less"],
Liquid: ["liquid"],
Lisp: ["lisp"],
@ -206,4 +206,5 @@ module.exports = {
modesByName: modesByName
};
});
});

Wyświetl plik

@ -4993,7 +4993,7 @@ dom.importCssString(".normal-mode .ace_cursor{\
}
}
}
throw Error('No such mapping.');
// throw Error('No such mapping.');
}
};

Wyświetl plik

@ -243,7 +243,7 @@ function testVim(name, run, opts, expectedFail) {
// Record for insert mode.
if (handled == "handled" && cm.state.vim.insertMode && arguments[i] != 'Esc') {
var lastChange = CodeMirror.Vim.getVimGlobalState_().macroModeState.lastInsertModeChanges;
if (lastChange) {
if (lastChange && (key.indexOf('Delete') != -1 || key.indexOf('Backspace') != -1)) {
lastChange.changes.push(new CodeMirror.Vim.InsertModeKey(key));
}
}
@ -2905,6 +2905,14 @@ testVim('._insert', function(cm, vim, helpers) {
helpers.doKeys('.');
eq('testestt', cm.getValue());
helpers.assertCursorAt(0, 6);
helpers.doKeys('O');
cm.replaceRange('xyz', cm.getCursor());
helpers.doInsertModeKeys('Backspace');
helpers.doInsertModeKeys('Down');
helpers.doKeys('<Esc>');
helpers.doKeys('.');
eq('xy\nxy\ntestestt', cm.getValue());
helpers.assertCursorAt(1, 1);
}, { value: ''});
testVim('._insert_repeat', function(cm, vim, helpers) {
helpers.doKeys('i');

Wyświetl plik

@ -94,7 +94,9 @@
["keyword.operator","-"],
["identifier","o"],
["text"," "],
["string","\"git@github.com:[^ ]*\""],
["string.start","\""],
["string","git@github.com:[^ ]*"],
["string.end","\""],
["keyword.operator","`"],
["punctuation.operator",";"],
["text"," "],
@ -113,12 +115,16 @@
["keyword.operator","-"],
["identifier","e"],
["text"," "],
["string","\"s/^git@github\\.com://\""],
["string.start","\""],
["string","s/^git@github\\.com://"],
["string.end","\""],
["text"," "],
["keyword.operator","-"],
["identifier","e"],
["text"," "],
["string","\"s/\\.git$//\""]
["string.start","\""],
["string","s/\\.git$//"],
["string.end","\""]
],[
"start",
["text"," "],
@ -150,7 +156,9 @@
["keyword.operator","-"],
["identifier","o"],
["text"," "],
["string","\"https?://([^@]*@)?github.com/[^ ]*\\.git\""],
["string.start","\""],
["string","https?://([^@]*@)?github.com/[^ ]*\\.git"],
["string.end","\""],
["keyword.operator","`"],
["punctuation.operator",";"],
["text"," "],
@ -169,17 +177,23 @@
["keyword.operator","-"],
["identifier","e"],
["text"," "],
["string","\"s|^https?://||\""],
["string.start","\""],
["string","s|^https?://||"],
["string.end","\""],
["text"," "],
["keyword.operator","-"],
["identifier","e"],
["text"," "],
["string","\"s/^.*github\\.com\\///\""],
["string.start","\""],
["string","s/^.*github\\.com\\///"],
["string.end","\""],
["text"," "],
["keyword.operator","-"],
["identifier","e"],
["text"," "],
["string","\"s/\\.git$//\""]
["string.start","\""],
["string","s/\\.git$//"],
["string.end","\""]
],[
"start",
["text"," "],
@ -211,7 +225,9 @@
["keyword.operator","-"],
["identifier","o"],
["text"," "],
["string","\"git://github.com/[^ ]*\\.git\""],
["string.start","\""],
["string","git://github.com/[^ ]*\\.git"],
["string.end","\""],
["keyword.operator","`"],
["punctuation.operator",";"],
["text"," "],
@ -230,12 +246,16 @@
["keyword.operator","-"],
["identifier","e"],
["text"," "],
["string","\"s|^git://github.com/||\""],
["string.start","\""],
["string","s|^git://github.com/||"],
["string.end","\""],
["text"," "],
["keyword.operator","-"],
["identifier","e"],
["text"," "],
["string","\"s/\\.git$//\""]
["string.start","\""],
["string","s/\\.git$//"],
["string.end","\""]
],[
"start",
["text"," "],
@ -275,7 +295,9 @@
["text"," "],
["support.function.builtin","echo"],
["text"," "],
["string","\"Couldn't find a valid remote\""],
["string.start","\""],
["string","Couldn't find a valid remote"],
["string.end","\""],
["text"," "],
["keyword.operator",">"],
["support.function","&2"]
@ -344,7 +366,8 @@
["text"," "],
["support.function.builtin","echo"],
["text"," "],
["string","\"http://github.com/"],
["string.start","\""],
["string","http://github.com/"],
["variable","$repo"],
["string","/pull/new/"],
["variable","$"],
@ -356,7 +379,7 @@
["identifier","heads"],
["keyword.operator","/"],
["paren.rparen","}"],
["string","\""]
["string.end","\""]
],[
"start",
["keyword","else"]

Wyświetl plik

@ -77,9 +77,8 @@
],[
"start",
["text"," x="],
["keyword","\\left\\"],
["paren.keyword.operator","{"],
["text"," "],
["keyword","\\left"],
["text", "\\{ "],
["keyword","\\begin"],
["paren.keyword.operator","{"],
["nospell.text","array"],
@ -127,4 +126,4 @@
["paren.keyword.operator","{"],
["nospell.text","equation"],
["paren.keyword.operator","}"]
]]
]]

Wyświetl plik

@ -100,14 +100,18 @@
["string","'button'"],
["paren.rparen",")"]
],[
"no_regex",
"start",
["identifier","button"],
["punctuation.operator","."],
["identifier","innerText"],
["text"," "],
["keyword.operator","="],
["text"," "],
["string","\"Say Hello\""]
["keyword.operator","<"],
["storage.type.variable.ts","string"],
["keyword.operator",">"],
["string","\"Say Hello\""],
["punctuation.operator",";"]
],[
"start",
["storage.type","button"],

Wyświetl plik

@ -69,7 +69,7 @@ var c_cppHighlightRules = function() {
next : "comment"
}, {
token : "string", // character
regex : "'(?:" + escapeRe + "|.)'"
regex : "'(?:" + escapeRe + "|.)?'"
}, {
token : "string.start",
regex : '"',

Wyświetl plik

@ -52,8 +52,7 @@ define(function(require, exports, module) {
var illegal = (
"case|const|default|function|var|void|with|enum|export|implements|" +
"interface|let|package|private|protected|public|static|yield|" +
"__hasProp|slice|bind|indexOf"
"interface|let|package|private|protected|public|static|yield"
);
var supportClass = (

Wyświetl plik

@ -28,7 +28,7 @@ var CSharpHighlightRules = function() {
next : "comment"
}, {
token : "string", // character
regex : /'(?:.|\\(:?u[\da-fA-F]+|x[\da-fA-F]+|[tbrf'"n]))'/
regex : /'(?:.|\\(:?u[\da-fA-F]+|x[\da-fA-F]+|[tbrf'"n]))?'/
}, {
token : "string", start : '"', end : '"|$', next: [
{token: "constant.language.escape", regex: /\\(:?u[\da-fA-F]+|x[\da-fA-F]+|[tbrf'"n])/},

2
node_modules/ace/lib/ace/mode/ejs.js wygenerowano vendored
Wyświetl plik

@ -52,7 +52,7 @@ var EjsHighlightRules = function(start, end) {
});
}
this.embedRules(JavaScriptHighlightRules, "ejs-", [{
this.embedRules(new JavaScriptHighlightRules({jsx: false}).getRules(), "ejs-", [{
token : "markup.list.meta.tag",
regex : "-?" + end,
next : "pop"

Wyświetl plik

@ -45,7 +45,7 @@ var ForthHighlightRules = function() {
// regexps are ordered -> the first match is used
this.$rules = { start: [ { include: '#forth' } ],
'#comment':
'#comment':
[ { token: 'comment.line.double-dash.forth',
regex: '(?:^|\\s)--\\s.*$',
comment: 'line comments for iForth' },
@ -57,7 +57,7 @@ var ForthHighlightRules = function() {
comment: 'gForth line comment' },
{ token: 'comment.block.forth',
regex: '(?:^|\\s)\\(\\*(?=\\s|$)',
push:
push:
[ { token: 'comment.block.forth',
regex: '(?:^|\\s)\\*\\)(?=\\s|$)',
next: 'pop' },
@ -66,7 +66,7 @@ var ForthHighlightRules = function() {
{ token: 'comment.block.documentation.forth',
regex: '\\bDOC\\b',
caseInsensitive: true,
push:
push:
[ { token: 'comment.block.documentation.forth',
regex: '\\bENDDOC\\b',
caseInsensitive: true,
@ -76,7 +76,7 @@ var ForthHighlightRules = function() {
{ token: 'comment.line.parentheses.forth',
regex: '(?:^|\\s)\\.?\\( [^)]*\\)',
comment: 'ANSI line comment' } ],
'#constant':
'#constant':
[ { token: 'constant.language.forth',
regex: '(?:^|\\s)(?:TRUE|FALSE|BL|PI|CELL|C/L|R/O|W/O|R/W)(?=\\s|$)',
caseInsensitive: true},
@ -84,7 +84,7 @@ var ForthHighlightRules = function() {
regex: '(?:^|\\s)[$#%]?[-+]?[0-9]+(?:\\.[0-9]*e-?[0-9]+|\\.?[0-9a-fA-F]*)(?=\\s|$)'},
{ token: 'constant.character.forth',
regex: '(?:^|\\s)(?:[&^]\\S|(?:"|\')\\S(?:"|\'))(?=\\s|$)'}],
'#forth':
'#forth':
[ { include: '#constant' },
{ include: '#comment' },
{ include: '#string' },
@ -92,22 +92,22 @@ var ForthHighlightRules = function() {
{ include: '#variable' },
{ include: '#storage' },
{ include: '#word-def' } ],
'#storage':
'#storage':
[ { token: 'storage.type.forth',
regex: '(?:^|\\s)(?:2CONSTANT|2VARIABLE|ALIAS|CONSTANT|CREATE-INTERPRET/COMPILE[:]?|CREATE|DEFER|FCONSTANT|FIELD|FVARIABLE|USER|VALUE|VARIABLE|VOCABULARY)(?=\\s|$)',
caseInsensitive: true}],
'#string':
'#string':
[ { token: 'string.quoted.double.forth',
regex: '(ABORT" |BREAK" |\\." |C" |0"|S\\\\?" )([^"]+")',
caseInsensitive: true},
{ token: 'string.unquoted.forth',
regex: '(?:INCLUDE|NEEDS|REQUIRE|USE)[ ]\\S+(?=\\s|$)',
caseInsensitive: true}],
'#variable':
'#variable':
[ { token: 'variable.language.forth',
regex: '\\b(?:I|J)\\b',
caseInsensitive: true } ],
'#word':
'#word':
[ { token: 'keyword.control.immediate.forth',
regex: '(?:^|\\s)\\[(?:\\?DO|\\+LOOP|AGAIN|BEGIN|DEFINED|DO|ELSE|ENDIF|FOR|IF|IFDEF|IFUNDEF|LOOP|NEXT|REPEAT|THEN|UNTIL|WHILE)\\](?=\\s|$)',
caseInsensitive: true},
@ -126,15 +126,15 @@ var ForthHighlightRules = function() {
{ token: 'keyword.other.warning.forth',
regex: '(?:^|\\s)(?:~~|BREAK:|BREAK"|DBG)(?=\\s|$)',
caseInsensitive: true}],
'#word-def':
[ { token:
'#word-def':
[ { token:
[ 'keyword.other.compile-only.forth',
'keyword.other.compile-only.forth',
'meta.block.forth',
'entity.name.function.forth' ],
regex: '(:NONAME)|(^:|\\s:)(\\s)(\\S+)(?=\\s|$)',
caseInsensitive: true,
push:
push:
[ { token: 'keyword.other.compile-only.forth',
regex: ';(?:CODE)?',
caseInsensitive: true,
@ -150,7 +150,7 @@ var ForthHighlightRules = function() {
this.normalizeRules();
};
ForthHighlightRules.metaData = { fileTypes: [ 'frt', 'fs', 'ldr' ],
ForthHighlightRules.metaData = { fileTypes: [ 'frt', 'fs', 'ldr', 'fth', '4th' ],
foldingStartMarker: '/\\*\\*|\\{\\s*$',
foldingStopMarker: '\\*\\*/|^\\s*\\}',
keyEquivalent: '^~F',

60
node_modules/ace/lib/ace/mode/haskell_cabal.js wygenerowano vendored 100644
Wyświetl plik

@ -0,0 +1,60 @@
/* ***** BEGIN LICENSE BLOCK *****
* Distributed under the BSD license:
*
* Copyright (c) 2012, Ajax.org B.V.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of Ajax.org B.V. nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL AJAX.ORG B.V. BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
* Contributor(s):
*
*
*
* ***** END LICENSE BLOCK ***** */
/**
* Haskell Cabal files mode (https://www.haskell.org/cabal/users-guide/developing-packages.html)
**/
define(function(require, exports, module) {
"use strict";
var oop = require("../lib/oop");
var TextMode = require("./text").Mode;
var CabalHighlightRules = require("./haskell_cabal_highlight_rules").CabalHighlightRules;
var FoldMode = require("./folding/haskell_cabal").FoldMode;
var Mode = function() {
this.HighlightRules = CabalHighlightRules;
this.foldingRules = new FoldMode();
};
oop.inherits(Mode, TextMode);
(function() {
this.lineCommentStart = "--";
this.blockComment = null;
this.$id = "ace/mode/haskell_cabal";
}).call(Mode.prototype);
exports.Mode = Mode;
});

Wyświetl plik

@ -0,0 +1,68 @@
/* ***** 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 ***** */
/**
* Haskell Cabal files highlighter (https://www.haskell.org/cabal/users-guide/developing-packages.html)
**/
define(function(require, exports, module) {
"use strict";
var oop = require("../lib/oop");
var TextHighlightRules = require("./text_highlight_rules").TextHighlightRules;
var CabalHighlightRules = function() {
// regexp must not have capturing parentheses. Use (?:) instead.
// regexps are ordered -> the first match is used
this.$rules = {
"start" : [
{
token : "comment",
regex : "^\\s*--.*$"
}, {
token: ["keyword"],
regex: /^(\s*\w.*?)(\:(?:\s+|$))/
}, {
token : "constant.numeric", // float
regex : /[\d_]+(?:(?:[\.\d_]*)?)/
}, {
token : "constant.language.boolean",
regex : "(?:true|false|TRUE|FALSE|True|False|yes|no)\\b"
}, {
token : "markup.heading",
regex : /^(\w.*)$/
}
]};
};
oop.inherits(CabalHighlightRules, TextHighlightRules);
exports.CabalHighlightRules = CabalHighlightRules;
});

Wyświetl plik

@ -44,8 +44,8 @@ var HaskellHighlightRules = function() {
// regexp must not have capturing parentheses. Use (?:) instead.
// regexps are ordered -> the first match is used
this.$rules = { start:
[ { token:
this.$rules = { start:
[ { token:
[ 'punctuation.definition.entity.haskell',
'keyword.operator.function.infix.haskell',
'punctuation.definition.entity.haskell' ],
@ -56,7 +56,7 @@ var HaskellHighlightRules = function() {
regex: '\\[\\]' },
{ token: 'keyword.other.haskell',
regex: '\\bmodule\\b',
push:
push:
[ { token: 'keyword.other.haskell', regex: '\\bwhere\\b', next: 'pop' },
{ include: '#module_name' },
{ include: '#module_exports' },
@ -64,7 +64,7 @@ var HaskellHighlightRules = function() {
{ defaultToken: 'meta.declaration.module.haskell' } ] },
{ token: 'keyword.other.haskell',
regex: '\\bclass\\b',
push:
push:
[ { token: 'keyword.other.haskell',
regex: '\\bwhere\\b',
next: 'pop' },
@ -77,7 +77,7 @@ var HaskellHighlightRules = function() {
{ defaultToken: 'meta.declaration.class.haskell' } ] },
{ token: 'keyword.other.haskell',
regex: '\\binstance\\b',
push:
push:
[ { token: 'keyword.other.haskell',
regex: '\\bwhere\\b|$',
next: 'pop' },
@ -85,15 +85,15 @@ var HaskellHighlightRules = function() {
{ defaultToken: 'meta.declaration.instance.haskell' } ] },
{ token: 'keyword.other.haskell',
regex: 'import',
push:
[ { token: 'meta.import.haskell', regex: '$|;', next: 'pop' },
push:
[ { token: 'meta.import.haskell', regex: '$|;|^', next: 'pop' },
{ token: 'keyword.other.haskell', regex: 'qualified|as|hiding' },
{ include: '#module_name' },
{ include: '#module_exports' },
{ defaultToken: 'meta.import.haskell' } ] },
{ token: [ 'keyword.other.haskell', 'meta.deriving.haskell' ],
regex: '(deriving)(\\s*\\()',
push:
push:
[ { token: 'meta.deriving.haskell', regex: '\\)', next: 'pop' },
{ token: 'entity.other.inherited-class.haskell',
regex: '\\b[A-Z][a-zA-Z_\']*' },
@ -108,7 +108,7 @@ var HaskellHighlightRules = function() {
comment: 'Floats are always decimal' },
{ token: 'constant.numeric.haskell',
regex: '\\b(?:[0-9]+|0(?:[xX][0-9a-fA-F]+|[oO][0-7]+))\\b' },
{ token:
{ token:
[ 'meta.preprocessor.c',
'punctuation.definition.preprocessor.c',
'meta.preprocessor.c' ],
@ -117,7 +117,7 @@ var HaskellHighlightRules = function() {
{ include: '#pragma' },
{ token: 'punctuation.definition.string.begin.haskell',
regex: '"',
push:
push:
[ { token: 'punctuation.definition.string.end.haskell',
regex: '"',
next: 'pop' },
@ -128,7 +128,7 @@ var HaskellHighlightRules = function() {
{ token: 'constant.character.escape.control.haskell',
regex: '\\^[A-Z@\\[\\]\\\\\\^_]' },
{ defaultToken: 'string.quoted.double.haskell' } ] },
{ token:
{ token:
[ 'punctuation.definition.string.begin.haskell',
'string.quoted.single.haskell',
'constant.character.escape.haskell',
@ -137,13 +137,13 @@ var HaskellHighlightRules = function() {
'constant.character.escape.control.haskell',
'punctuation.definition.string.end.haskell' ],
regex: '(\')(?:([\\ -\\[\\]-~])|(\\\\(?:NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL|[abfnrtv\\\\\\"\'\\&]))|(\\\\o[0-7]+)|(\\\\x[0-9A-Fa-f]+)|(\\^[A-Z@\\[\\]\\\\\\^_]))(\')' },
{ token:
{ token:
[ 'meta.function.type-declaration.haskell',
'entity.name.function.haskell',
'meta.function.type-declaration.haskell',
'keyword.other.double-colon.haskell' ],
regex: '^(\\s*)([a-z_][a-zA-Z0-9_\']*|\\([|!%$+\\-.,=</>]+\\))(\\s*)(::)',
push:
push:
[ { token: 'meta.function.type-declaration.haskell',
regex: '$',
next: 'pop' },
@ -160,32 +160,32 @@ var HaskellHighlightRules = function() {
regex: '[|!%$?~+:\\-.=</>\\\\]+',
comment: 'In case this regex seems overly general, note that Haskell permits the definition of new operators which can be nearly any string of punctuation characters, such as $%^&*.' },
{ token: 'punctuation.separator.comma.haskell', regex: ',' } ],
'#block_comment':
'#block_comment':
[ { token: 'punctuation.definition.comment.haskell',
regex: '\\{-(?!#)',
push:
push:
[ { include: '#block_comment' },
{ token: 'punctuation.definition.comment.haskell',
regex: '-\\}',
next: 'pop' },
{ defaultToken: 'comment.block.haskell' } ] } ],
'#comments':
'#comments':
[ { token: 'punctuation.definition.comment.haskell',
regex: '--.*',
push_:
push_:
[ { token: 'comment.line.double-dash.haskell',
regex: '$',
next: 'pop' },
{ defaultToken: 'comment.line.double-dash.haskell' } ] },
{ include: '#block_comment' } ],
'#infix_op':
'#infix_op':
[ { token: 'entity.name.function.infix.haskell',
regex: '\\([|!%$+:\\-.=</>]+\\)|\\(,+\\)' } ],
'#module_exports':
'#module_exports':
[ { token: 'meta.declaration.exports.haskell',
regex: '\\(',
push:
[ { token: 'meta.declaration.exports.haskell',
push:
[ { token: 'meta.declaration.exports.haskell.end',
regex: '\\)',
next: 'pop' },
{ token: 'entity.name.function.haskell',
@ -196,22 +196,22 @@ var HaskellHighlightRules = function() {
{ token: 'meta.other.unknown.haskell',
regex: '\\(.*?\\)',
comment: 'So named because I don\'t know what to call this.' },
{ defaultToken: 'meta.declaration.exports.haskell' } ] } ],
'#module_name':
{ defaultToken: 'meta.declaration.exports.haskell.end' } ] } ],
'#module_name':
[ { token: 'support.other.module.haskell',
regex: '[A-Z][A-Za-z._\']*' } ],
'#pragma':
'#pragma':
[ { token: 'meta.preprocessor.haskell',
regex: '\\{-#',
push:
push:
[ { token: 'meta.preprocessor.haskell',
regex: '#-\\}',
next: 'pop' },
{ token: 'keyword.other.preprocessor.haskell',
regex: '\\b(?:LANGUAGE|UNPACK|INLINE)\\b' },
{ defaultToken: 'meta.preprocessor.haskell' } ] } ],
'#type_signature':
[ { token:
'#type_signature':
[ { token:
[ 'meta.class-constraint.haskell',
'entity.other.inherited-class.haskell',
'meta.class-constraint.haskell',
@ -230,7 +230,7 @@ var HaskellHighlightRules = function() {
regex: '\\b[A-Z][a-zA-Z0-9_\']*\\b' },
{ token: 'support.constant.unit.haskell', regex: '\\(\\)' },
{ include: '#comments' } ] }
this.normalizeRules();
};
@ -243,4 +243,4 @@ HaskellHighlightRules.metaData = { fileTypes: [ 'hs' ],
oop.inherits(HaskellHighlightRules, TextHighlightRules);
exports.HaskellHighlightRules = HaskellHighlightRules;
});
});

Wyświetl plik

@ -506,11 +506,26 @@ var PhpLangHighlightRules = function() {
'mysql_field_name|mysql_field_seek|mysql_field_table|mysql_field_type|mysql_free_result|mysql_get_client_info|mysql_get_host_info|' +
'mysql_get_proto_info|mysql_get_server_info|mysql_info|mysql_insert_id|mysql_list_dbs|mysql_list_fields|mysql_list_processes|' +
'mysql_list_tables|mysql_num_fields|mysql_num_rows|mysql_pconnect|mysql_ping|mysql_query|mysql_real_escape_string|mysql_result|' +
'mysql_select_db|mysql_set_charset|mysql_stat|mysql_tablename|mysql_thread_id|mysql_unbuffered_query|mysqli|mysqli_bind_param|' +
'mysqli_bind_result|mysqli_client_encoding|mysqli_connect|mysqli_disable_reads_from_master|mysqli_disable_rpl_parse|mysqli_driver|' +
'mysqli_enable_reads_from_master|mysqli_enable_rpl_parse|mysqli_escape_string|mysqli_execute|mysqli_fetch|mysqli_get_metadata|' +
'mysqli_master_query|mysqli_param_count|mysqli_report|mysqli_result|mysqli_rpl_parse_enabled|mysqli_rpl_probe|mysqli_rpl_query_type|' +
'mysqli_send_long_data|mysqli_send_query|mysqli_set_opt|mysqli_slave_query|mysqli_stmt|mysqli_warning|mysqlnd_ms_get_stats|' +
'mysql_select_db|mysql_set_charset|mysql_stat|mysql_tablename|mysql_thread_id|mysql_unbuffered_query|mysqli|mysqli_affected_rows|' +
'mysqli_autocommit|mysqli_bind_param|mysqli_bind_result|mysqli_cache_stats|mysqli_change_user|mysqli_character_set_name|' +
'mysqli_client_encoding|mysqli_close|mysqli_commit|mysqli_connect|mysqli_connect_errno|mysqli_connect_error|mysqli_data_seek|' +
'mysqli_debug|mysqli_disable_reads_from_master|mysqli_disable_rpl_parse|mysqli_driver|mysqli_dump_debug_info|mysqli_embedded_server_end|' +
'mysqli_embedded_server_start|mysqli_enable_reads_from_master|mysqli_enable_rpl_parse|mysqli_errno|mysqli_error|mysqli_escape_string|' +
'mysqli_execute|mysqli_fetch|mysqli_fetch_all|mysqli_fetch_array|mysqli_fetch_assoc|mysqli_fetch_field|mysqli_fetch_field_direct|' +
'mysqli_fetch_fields|mysqli_fetch_lengths|mysqli_fetch_object|mysqli_fetch_row|mysqli_field_count|mysqli_field_seek|mysqli_field_tell|' +
'mysqli_free_result|mysqli_get_charset|mysqli_get_client_info|mysqli_get_client_stats|mysqli_get_client_version|mysqli_get_connection_stats|' +
'mysqli_get_host_info|mysqli_get_metadata|mysqli_get_proto_info|mysqli_get_server_info|mysqli_get_server_version|mysqli_get_warnings|' +
'mysqli_info|mysqli_init|mysqli_insert_id|mysqli_kill|mysqli_link_construct|mysqli_master_query|mysqli_more_results|mysqli_multi_query|' +
'mysqli_next_result|mysqli_num_fields|mysqli_num_rows|mysqli_options|mysqli_param_count|mysqli_ping|mysqli_poll|mysqli_prepare|' +
'mysqli_query|mysqli_real_connect|mysqli_real_escape_string|mysqli_real_query|mysqli_reap_async_query|mysqli_refresh|mysqli_report|' +
'mysqli_result|mysqli_rollback|mysqli_rpl_parse_enabled|mysqli_rpl_probe|mysqli_rpl_query_type|mysqli_select_db|mysqli_send_long_data|' +
'mysqli_send_query|mysqli_set_charset|mysqli_set_local_infile_default|mysqli_set_local_infile_handler|mysqli_set_opt|mysqli_slave_query|' +
'mysqli_sqlstate|mysqli_ssl_set|mysqli_stat|mysqli_stmt|mysqli_stmt_affected_rows|mysqli_stmt_attr_get|mysqli_stmt_attr_set|' +
'mysqli_stmt_bind_param|mysqli_stmt_bind_result|mysqli_stmt_close|mysqli_stmt_data_seek|mysqli_stmt_errno|mysqli_stmt_error|' +
'mysqli_stmt_execute|mysqli_stmt_fetch|mysqli_stmt_field_count|mysqli_stmt_free_result|mysqli_stmt_get_result|mysqli_stmt_get_warnings|' +
'mysqli_stmt_init|mysqli_stmt_insert_id|mysqli_stmt_next_result|mysqli_stmt_num_rows|mysqli_stmt_param_count|mysqli_stmt_prepare|' +
'mysqli_stmt_reset|mysqli_stmt_result_metadata|mysqli_stmt_send_long_data|mysqli_stmt_sqlstate|mysqli_stmt_store_result|mysqli_store_result|' +
'mysqli_thread_id|mysqli_thread_safe|mysqli_use_result|mysqli_warning|mysqli_warning_count|mysqlnd_ms_get_stats|' +
'mysqlnd_ms_query_is_select|mysqlnd_ms_set_user_pick_server|mysqlnd_qc_change_handler|mysqlnd_qc_clear_cache|mysqlnd_qc_get_cache_info|' +
'mysqlnd_qc_get_core_stats|mysqlnd_qc_get_handler|mysqlnd_qc_get_query_trace_log|mysqlnd_qc_set_user_handlers|natcasesort|natsort|' +
'ncurses_addch|ncurses_addchnstr|ncurses_addchstr|ncurses_addnstr|ncurses_addstr|ncurses_assume_default_colors|ncurses_attroff|' +

Wyświetl plik

@ -64,7 +64,7 @@ var TexHighlightRules = function(textClass) {
next : "nospell"
}, {
token : "keyword", // command
regex : "\\\\(?:[a-zA-z0-9]+|[^a-zA-z0-9])"
regex : "\\\\(?:[a-zA-Z0-9]+|[^a-zA-Z0-9])"
}, {
// Obviously these are neither keywords nor operators, but
// labelling them as such was the easiest way to get them
@ -98,7 +98,7 @@ var TexHighlightRules = function(textClass) {
regex : "\\\\(?:documentclass|usepackage|newcounter|setcounter|addtocounter|value|arabic|stepcounter|newenvironment|renewenvironment|ref|vref|eqref|pageref|label|cite[a-zA-Z]*|tag|begin|end|bibitem)\\b"
}, {
token : "keyword", // command
regex : "\\\\(?:[a-zA-z0-9]+|[^a-zA-z0-9])",
regex : "\\\\(?:[a-zA-Z0-9]+|[^a-zA-Z0-9])",
next : "start"
}, {
token : "paren.keyword.operator",

11
node_modules/ace/lib/ace/scrollbar.js wygenerowano vendored
Wyświetl plik

@ -35,6 +35,9 @@ var oop = require("./lib/oop");
var dom = require("./lib/dom");
var event = require("./lib/event");
var EventEmitter = require("./lib/event_emitter").EventEmitter;
// on ie maximal element height is smaller than what we get from 4-5K line document
// so scrollbar doesn't work, as a workaround we do not set height higher than MAX_SCROLL_H
// and rescale scrolltop
var MAX_SCROLL_H = 0x8000;
/**
@ -90,6 +93,7 @@ var ScrollBar = function(parent) {
var VScrollBar = function(parent, renderer) {
ScrollBar.call(this, parent);
this.scrollTop = 0;
this.scrollHeight = 0;
// in OSX lion the scrollbars appear to have no width. In this case resize the
// element to show the scrollbar but still pretend that the scrollbar has a width
@ -116,7 +120,11 @@ oop.inherits(VScrollBar, ScrollBar);
**/
this.onScroll = function() {
if (!this.skipEvent) {
this.scrollTop = this.element.scrollTop / this.coeff;
this.scrollTop = this.element.scrollTop;
if (this.coeff != 1) {
var h = this.element.clientHeight / this.scrollHeight;
this.scrollTop = this.scrollTop * (1 - h) / (this.coeff - h);
}
this._emit("scroll", {data: this.scrollTop});
}
this.skipEvent = false;
@ -149,6 +157,7 @@ oop.inherits(VScrollBar, ScrollBar);
* @param {Number} height The new scroll height
**/
this.setScrollHeight = function(height) {
this.scrollHeight = height;
if (height > MAX_SCROLL_H) {
this.coeff = MAX_SCROLL_H / height;
height = MAX_SCROLL_H;

8
node_modules/ace/lib/ace/snippets.js wygenerowano vendored
Wyświetl plik

@ -277,6 +277,7 @@ var SnippetManager = function() {
if (cursor.column < indentString.length)
indentString = indentString.slice(0, cursor.column);
snippetText = snippetText.replace(/\r/g, "");
var tokens = this.tokenizeTmSnippet(snippetText);
tokens = this.resolveVariables(tokens, editor);
// indent
@ -362,9 +363,10 @@ var SnippetManager = function() {
var text = "";
tokens.forEach(function(t) {
if (typeof t === "string") {
if (t[0] === "\n"){
column = t.length - 1;
row ++;
var lines = t.split("\n");
if (lines.length > 1){
column = lines[lines.length - 1].length;
row += lines.length - 1;
} else
column += t.length;
text += t;

7
node_modules/ace/lib/ace/snippets/rst.js wygenerowano vendored 100644
Wyświetl plik

@ -0,0 +1,7 @@
define(function(require, exports, module) {
"use strict";
exports.snippetText = require("../requirejs/text!./.snippets");
exports.scope = "";
});

Wyświetl plik

@ -97,18 +97,25 @@ module.exports = {
assert.equal(tokens[1].flag, "g");
},
"test: expand snippet with nested tabstops": function() {
var content = "-${1}-${1:1}--${2:2 ${3} 2}-${3:3 $1 3}-${4:4 $2 4}";
var content = "-${1}-${1:t\n1}--${2:2 ${3} 2}-${3:3 $1 3}-${4:4 $2 4}";
this.editor.setValue("");
snippetManager.insertSnippet(this.editor, content);
assert.equal(this.editor.getValue(), "-1-1--2 3 1 3 2-3 1 3-4 2 3 1 3 2 4");
assert.equal(this.editor.getValue(), [
"-t",
"1-t",
"1--2 3 t",
"1 3 2-3 t",
"1 3-4 2 3 t",
"1 3 2 4"
].join("\n"));
assert.equal(this.editor.getSelectedText(), "1\n1\n1\n1\n1");
assert.equal(this.editor.getSelectedText(), "t\n1\nt\n1\nt\n1\nt\n1\nt\n1");
this.editor.tabstopManager.tabNext();
assert.equal(this.editor.getSelectedText(), "2 3 1 3 2\n2 3 1 3 2");
assert.equal(this.editor.getSelectedText(), "2 3 t\n1 3 2\n2 3 t\n1 3 2");
this.editor.tabstopManager.tabNext();
assert.equal(this.editor.getSelectedText(), "3 1 3\n3 1 3\n3 1 3");
assert.equal(this.editor.getSelectedText(), "3 t\n1 3\n3 t\n1 3\n3 t\n1 3");
this.editor.tabstopManager.tabNext();
assert.equal(this.editor.getSelectedText(), "4 2 3 1 3 2 4");
assert.equal(this.editor.getSelectedText(), "4 2 3 t\n1 3 2 4");
this.editor.tabstopManager.tabNext();
assert.equal(this.editor.getSelectedText(), "");

18
node_modules/ace/lib/ace/test/mockdom.js wygenerowano vendored
Wyświetl plik

@ -1,14 +1,10 @@
"use strict";
var dom = require('node-jsdom/lib/jsdom/living');
var browser = require('node-jsdom/lib/jsdom/browser/index').browserAugmentation(dom);
var doc = new browser.HTMLDocument({parsingMode: 'html'});
doc.write("<html><head></head><body></body></html>");
browser.document = doc;
browser.window = doc.defaultView;
var jsdom = require('jsdom/').jsdom;
var doc = jsdom("<html><head></head><body></body></html>")
global.document = browser.document;
global.window = browser.window;
global.self = browser.self;
global.navigator = browser.navigator;
global.location = browser.location;
global.document = doc;
global.window = doc.defaultView;
global.self = doc.self;
global.navigator = doc.navigator;
global.location = doc.location;