Merge remote-tracking branch 'origin/master' into pr/msftrncs/85
This commit is contained in:
Коммит
17b2d336d4
|
@ -5,12 +5,10 @@
|
|||
/scripts/
|
||||
/src/
|
||||
/test-cases/
|
||||
/typings/
|
||||
/.npmignore
|
||||
/.travis.yml
|
||||
/gulpfile.js
|
||||
/npm-debug.log
|
||||
/ThirdPartyNotices.txt
|
||||
/tsconfig.json
|
||||
/typings.json
|
||||
/tslint.json
|
|
@ -10,8 +10,4 @@ addons:
|
|||
packages:
|
||||
- g++-4.8
|
||||
script:
|
||||
- npm run compile
|
||||
- npm run test-travis
|
||||
after_script:
|
||||
- remap-istanbul -i ./coverage/coverage.json -t lcovonly > ./coverage/lcov-remap.info
|
||||
- cat ./coverage/lcov-remap.info | ./node_modules/coveralls/bin/coveralls.js
|
||||
- npm run test
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# VSCode TextMate [![Build Status](https://travis-ci.org/Microsoft/vscode-textmate.svg?branch=master)](https://travis-ci.org/Microsoft/vscode-textmate) [![Coverage Status](https://coveralls.io/repos/github/Microsoft/vscode-textmate/badge.svg?branch=master)](https://coveralls.io/github/Microsoft/vscode-textmate?branch=master)
|
||||
# VSCode TextMate [![Build Status](https://travis-ci.org/Microsoft/vscode-textmate.svg?branch=master)](https://travis-ci.org/Microsoft/vscode-textmate)
|
||||
|
||||
An interpreter for grammar files as defined by TextMate. Supports loading grammar files from JSON or PLIST format. Cross - grammar injections are currently not supported.
|
||||
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
17
package.json
17
package.json
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "vscode-textmate",
|
||||
"version": "4.0.1",
|
||||
"version": "4.1.0",
|
||||
"description": "VSCode TextMate grammar helpers",
|
||||
"author": {
|
||||
"name": "Microsoft Corporation"
|
||||
|
@ -19,7 +19,6 @@
|
|||
"watch": "tsc -watch",
|
||||
"compile": "tsc",
|
||||
"test": "npm run compile && mocha out/tests/*.test.js",
|
||||
"test-travis": "istanbul cover ./node_modules/mocha/bin/_mocha -- -R spec out/tests/",
|
||||
"benchmark": "node benchmark/benchmark.js",
|
||||
"inspect": "node scripts/inspect.js",
|
||||
"version": "npm run test && node scripts/release.js",
|
||||
|
@ -30,16 +29,12 @@
|
|||
"oniguruma": "^7.0.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/mocha": "2.2.39",
|
||||
"@types/node": "^7.0.43",
|
||||
"coveralls": "^3.0.2",
|
||||
"@types/mocha": "5.2.6",
|
||||
"@types/node": "^11.9.6",
|
||||
"durations": "^3.4.1",
|
||||
"istanbul": "^0.4.4",
|
||||
"mocha": "^5.2.0",
|
||||
"mocha": "^6.0.2",
|
||||
"onigasm": "^2.1.0",
|
||||
"remap-istanbul": "^0.6.4",
|
||||
"tslint": "^3.15.1",
|
||||
"typescript": "^2.0.8",
|
||||
"typings": "^1.3.2"
|
||||
"tslint": "^5.13.1",
|
||||
"typescript": "^3.3.3333"
|
||||
}
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ export declare const enum StandardTokenType {
|
|||
Other = 0,
|
||||
Comment = 1,
|
||||
String = 2,
|
||||
RegEx = 4,
|
||||
RegEx = 4
|
||||
}
|
||||
export interface IGrammarConfiguration {
|
||||
embeddedLanguages?: IEmbeddedLanguagesMap;
|
||||
|
@ -81,7 +81,7 @@ export declare class Registry {
|
|||
* Load the grammar for `scopeName` and all referenced included grammars asynchronously.
|
||||
*/
|
||||
loadGrammar(initialScopeName: string): Thenable<IGrammar>;
|
||||
private _loadGrammar(initialScopeName, initialLanguage, embeddedLanguages, tokenTypes);
|
||||
private _loadGrammar;
|
||||
/**
|
||||
* Adds a rawGrammar.
|
||||
*/
|
||||
|
@ -148,7 +148,7 @@ export declare const enum MetadataConsts {
|
|||
TOKEN_TYPE_OFFSET = 8,
|
||||
FONT_STYLE_OFFSET = 11,
|
||||
FOREGROUND_OFFSET = 14,
|
||||
BACKGROUND_OFFSET = 23,
|
||||
BACKGROUND_OFFSET = 23
|
||||
}
|
||||
export interface ITokenizeLineResult2 {
|
||||
/**
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
|
||||
(function (factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define([], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
module.exports = factory();
|
||||
}
|
||||
})(function () {
|
||||
|
||||
/*---------------------------------------------------------
|
||||
* Copyright (C) Microsoft Corporation. All rights reserved.
|
||||
*--------------------------------------------------------*/
|
||||
|
@ -1596,9 +1605,12 @@ $load('./rule', function(require, module, exports) {
|
|||
*--------------------------------------------------------*/
|
||||
'use strict';
|
||||
var __extends = (this && this.__extends) || (function () {
|
||||
var extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
||||
var extendStatics = function (d, b) {
|
||||
extendStatics = Object.setPrototypeOf ||
|
||||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
||||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
|
||||
return extendStatics(d, b);
|
||||
};
|
||||
return function (d, b) {
|
||||
extendStatics(d, b);
|
||||
function __() { this.constructor = d; }
|
||||
|
@ -2816,7 +2828,7 @@ function _tokenizeString(grammar, lineText, isFirstLine, linePos, stack, lineTok
|
|||
function scanNext() {
|
||||
if (debug_1.IN_DEBUG_MODE) {
|
||||
console.log('');
|
||||
console.log("@@scanNext " + linePos + ": |" + lineText.content.replace(/\n$/, '\\n').substr(linePos) + "|");
|
||||
console.log("@@scanNext " + linePos + ": |" + lineText.content.substr(linePos).replace(/\n$/, '\\n') + "|");
|
||||
}
|
||||
var r = matchRuleOrInjections(grammar, lineText, isFirstLine, linePos, stack, anchorPosition);
|
||||
if (!r) {
|
||||
|
@ -3360,8 +3372,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|||
function step(op) {
|
||||
if (f) throw new TypeError("Generator is already executing.");
|
||||
while (_) try {
|
||||
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
|
||||
if (y = 0, t) op = [0, t.value];
|
||||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
||||
if (y = 0, t) op = [op[0] & 2, t.value];
|
||||
switch (op[0]) {
|
||||
case 0: case 1: t = op; break;
|
||||
case 4: _.label++; return { value: op[1], done: false };
|
||||
|
@ -3493,8 +3505,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|||
function step(op) {
|
||||
if (f) throw new TypeError("Generator is already executing.");
|
||||
while (_) try {
|
||||
if (f = 1, y && (t = y[op[0] & 2 ? "return" : op[0] ? "throw" : "next"]) && !(t = t.call(y, op[1])).done) return t;
|
||||
if (y = 0, t) op = [0, t.value];
|
||||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
||||
if (y = 0, t) op = [op[0] & 2, t.value];
|
||||
switch (op[0]) {
|
||||
case 0: case 1: t = op; break;
|
||||
case 4: _.label++; return { value: op[1], done: false };
|
||||
|
@ -3561,7 +3573,7 @@ var Registry = /** @class */ (function () {
|
|||
};
|
||||
Registry.prototype._loadGrammar = function (initialScopeName, initialLanguage, embeddedLanguages, tokenTypes) {
|
||||
return __awaiter(this, void 0, void 0, function () {
|
||||
var remainingScopeNames, seenScopeNames, scopeName, grammar, injections, deps, e_1;
|
||||
var remainingScopeNames, seenScopeNames, scopeName, grammar, injections, deps;
|
||||
return __generator(this, function (_a) {
|
||||
switch (_a.label) {
|
||||
case 0:
|
||||
|
@ -3570,37 +3582,31 @@ var Registry = /** @class */ (function () {
|
|||
seenScopeNames[initialScopeName] = true;
|
||||
_a.label = 1;
|
||||
case 1:
|
||||
if (!(remainingScopeNames.length > 0)) return [3 /*break*/, 6];
|
||||
if (!(remainingScopeNames.length > 0)) return [3 /*break*/, 3];
|
||||
scopeName = remainingScopeNames.shift();
|
||||
if (this._syncRegistry.lookup(scopeName)) {
|
||||
return [3 /*break*/, 1];
|
||||
}
|
||||
_a.label = 2;
|
||||
case 2:
|
||||
_a.trys.push([2, 4, , 5]);
|
||||
return [4 /*yield*/, this._locator.loadGrammar(scopeName)];
|
||||
case 3:
|
||||
case 2:
|
||||
grammar = _a.sent();
|
||||
if (!grammar) {
|
||||
throw new Error("No grammar provided for <" + initialScopeName);
|
||||
}
|
||||
injections = (typeof this._locator.getInjections === 'function') && this._locator.getInjections(scopeName);
|
||||
deps = this._syncRegistry.addGrammar(grammar, injections);
|
||||
deps.forEach(function (dep) {
|
||||
if (!seenScopeNames[dep]) {
|
||||
seenScopeNames[dep] = true;
|
||||
remainingScopeNames.push(dep);
|
||||
if (scopeName === initialScopeName) {
|
||||
throw new Error("No grammar provided for <" + initialScopeName);
|
||||
}
|
||||
});
|
||||
return [3 /*break*/, 5];
|
||||
case 4:
|
||||
e_1 = _a.sent();
|
||||
if (scopeName === initialScopeName) {
|
||||
throw new Error('Unable to load grammar <' + initialScopeName + '>' + e_1);
|
||||
}
|
||||
return [3 /*break*/, 5];
|
||||
case 5: return [3 /*break*/, 1];
|
||||
case 6: return [2 /*return*/, this.grammarForScopeName(initialScopeName, initialLanguage, embeddedLanguages, tokenTypes)];
|
||||
else {
|
||||
injections = (typeof this._locator.getInjections === 'function') && this._locator.getInjections(scopeName);
|
||||
deps = this._syncRegistry.addGrammar(grammar, injections);
|
||||
deps.forEach(function (dep) {
|
||||
if (!seenScopeNames[dep]) {
|
||||
seenScopeNames[dep] = true;
|
||||
remainingScopeNames.push(dep);
|
||||
}
|
||||
});
|
||||
}
|
||||
return [3 /*break*/, 1];
|
||||
case 3: return [2 /*return*/, this.grammarForScopeName(initialScopeName, initialLanguage, embeddedLanguages, tokenTypes)];
|
||||
}
|
||||
});
|
||||
});
|
||||
|
@ -3631,5 +3637,6 @@ exports.INITIAL = grammar_1.StackElement.NULL;
|
|||
exports.parseRawGrammar = grammarReader.parseRawGrammar;
|
||||
//# sourceMappingURL=main.js.map
|
||||
});
|
||||
module.exports = $map['./main'].exports;
|
||||
//# sourceMappingURL=_suffix.js.map
|
||||
|
||||
return $map['./main'].exports;;
|
||||
});
|
|
@ -41,8 +41,21 @@ var sources = [
|
|||
var all = [];
|
||||
all.push(fs.readFileSync(path.join(OUT_FOLDER, '_prefix.js')).toString());
|
||||
all = all.concat(sources);
|
||||
all.push(fs.readFileSync(path.join(OUT_FOLDER, '_suffix.js')).toString());
|
||||
|
||||
fs.writeFileSync(path.join(RELEASE_FOLDER, 'main.js'), all.join('\n'));
|
||||
const result = `
|
||||
(function (factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define([], factory);
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
module.exports = factory();
|
||||
}
|
||||
})(function () {
|
||||
|
||||
${all.join('\n')}
|
||||
|
||||
return $map['./main'].exports;;
|
||||
});`;
|
||||
|
||||
fs.writeFileSync(path.join(RELEASE_FOLDER, 'main.js'), result);
|
||||
fs.writeFileSync(path.join(RELEASE_FOLDER, 'main.d.ts'), fs.readFileSync(path.join(OUT_FOLDER, 'main.d.ts')));
|
||||
fs.writeFileSync(path.join(RELEASE_FOLDER, 'types.d.ts'), fs.readFileSync(path.join(OUT_FOLDER, 'types.d.ts')));
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
module.exports = $map['./main'].exports;
|
|
@ -1,6 +0,0 @@
|
|||
{
|
||||
"globalDependencies": {
|
||||
"mocha": "registry:env/mocha#2.2.5+20160723033700",
|
||||
"node": "registry:env/node#6.0.0+20160813135048"
|
||||
}
|
||||
}
|
Загрузка…
Ссылка в новой задаче