@histoire/vendors 0.8.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/entries.js +0 -1
- package/package.json +1 -2
- package/dist/client/shiki.d.ts +0 -1
- package/dist/client/shiki.js +0 -2301
- package/src/client/shiki.ts +0 -1
package/dist/client/shiki.js
DELETED
|
@@ -1,2301 +0,0 @@
|
|
|
1
|
-
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
2
|
-
|
|
3
|
-
function getDefaultExportFromCjs (x) {
|
|
4
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
function getDefaultExportFromNamespaceIfPresent (n) {
|
|
8
|
-
return n && Object.prototype.hasOwnProperty.call(n, 'default') ? n['default'] : n;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
function getDefaultExportFromNamespaceIfNotNamed (n) {
|
|
12
|
-
return n && Object.prototype.hasOwnProperty.call(n, 'default') && Object.keys(n).length === 1 ? n['default'] : n;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
function getAugmentedNamespace(n) {
|
|
16
|
-
var f = n.default;
|
|
17
|
-
if (typeof f == "function") {
|
|
18
|
-
var a = function () {
|
|
19
|
-
return f.apply(this, arguments);
|
|
20
|
-
};
|
|
21
|
-
a.prototype = f.prototype;
|
|
22
|
-
} else a = {};
|
|
23
|
-
Object.defineProperty(a, '__esModule', {value: true});
|
|
24
|
-
Object.keys(n).forEach(function (k) {
|
|
25
|
-
var d = Object.getOwnPropertyDescriptor(n, k);
|
|
26
|
-
Object.defineProperty(a, k, d.get ? d : {
|
|
27
|
-
enumerable: true,
|
|
28
|
-
get: function () {
|
|
29
|
-
return n[k];
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
});
|
|
33
|
-
return a;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
var main$3 = {exports: {}};
|
|
37
|
-
|
|
38
|
-
(function (module, exports) {
|
|
39
|
-
!function(t,n){"object"=='object'&&"object"=='object'?module.exports=n():"function"==typeof undefined&&undefined.amd?undefined([],n):"object"=='object'?exports.onig=n():t.onig=n();}(commonjsGlobal,(function(){return t={770:function(t,n,e){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(n,"__esModule",{value:!0}),n.setDefaultDebugCall=n.createOnigScanner=n.createOnigString=n.loadWASM=n.OnigScanner=n.OnigString=void 0;const i=r(e(418));let o=null,a=!1;class f{constructor(t){const n=t.length,e=f._utf8ByteLength(t),r=e!==n,i=r?new Uint32Array(n+1):null;r&&(i[n]=e);const o=r?new Uint32Array(e+1):null;r&&(o[e]=n);const a=new Uint8Array(e);let s=0;for(let e=0;e<n;e++){const f=t.charCodeAt(e);let u=f,c=!1;if(f>=55296&&f<=56319&&e+1<n){const n=t.charCodeAt(e+1);n>=56320&&n<=57343&&(u=65536+(f-55296<<10)|n-56320,c=!0);}r&&(i[e]=s,c&&(i[e+1]=s),u<=127?o[s+0]=e:u<=2047?(o[s+0]=e,o[s+1]=e):u<=65535?(o[s+0]=e,o[s+1]=e,o[s+2]=e):(o[s+0]=e,o[s+1]=e,o[s+2]=e,o[s+3]=e)),u<=127?a[s++]=u:u<=2047?(a[s++]=192|(1984&u)>>>6,a[s++]=128|(63&u)>>>0):u<=65535?(a[s++]=224|(61440&u)>>>12,a[s++]=128|(4032&u)>>>6,a[s++]=128|(63&u)>>>0):(a[s++]=240|(1835008&u)>>>18,a[s++]=128|(258048&u)>>>12,a[s++]=128|(4032&u)>>>6,a[s++]=128|(63&u)>>>0),c&&e++;}this.utf16Length=n,this.utf8Length=e,this.utf16Value=t,this.utf8Value=a,this.utf16OffsetToUtf8=i,this.utf8OffsetToUtf16=o;}static _utf8ByteLength(t){let n=0;for(let e=0,r=t.length;e<r;e++){const i=t.charCodeAt(e);let o=i,a=!1;if(i>=55296&&i<=56319&&e+1<r){const n=t.charCodeAt(e+1);n>=56320&&n<=57343&&(o=65536+(i-55296<<10)|n-56320,a=!0);}n+=o<=127?1:o<=2047?2:o<=65535?3:4,a&&e++;}return n}createString(t){const n=t._omalloc(this.utf8Length);return t.HEAPU8.set(this.utf8Value,n),n}}class s{constructor(t){if(this.id=++s.LAST_ID,!o)throw new Error("Must invoke loadWASM first.");this._onigBinding=o,this.content=t;const n=new f(t);this.utf16Length=n.utf16Length,this.utf8Length=n.utf8Length,this.utf16OffsetToUtf8=n.utf16OffsetToUtf8,this.utf8OffsetToUtf16=n.utf8OffsetToUtf16,this.utf8Length<1e4&&!s._sharedPtrInUse?(s._sharedPtr||(s._sharedPtr=o._omalloc(1e4)),s._sharedPtrInUse=!0,o.HEAPU8.set(n.utf8Value,s._sharedPtr),this.ptr=s._sharedPtr):this.ptr=n.createString(o);}convertUtf8OffsetToUtf16(t){return this.utf8OffsetToUtf16?t<0?0:t>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[t]:t}convertUtf16OffsetToUtf8(t){return this.utf16OffsetToUtf8?t<0?0:t>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[t]:t}dispose(){this.ptr===s._sharedPtr?s._sharedPtrInUse=!1:this._onigBinding._ofree(this.ptr);}}n.OnigString=s,s.LAST_ID=0,s._sharedPtr=0,s._sharedPtrInUse=!1;class u{constructor(t){if(!o)throw new Error("Must invoke loadWASM first.");const n=[],e=[];for(let r=0,i=t.length;r<i;r++){const i=new f(t[r]);n[r]=i.createString(o),e[r]=i.utf8Length;}const r=o._omalloc(4*t.length);o.HEAPU32.set(n,r/4);const i=o._omalloc(4*t.length);o.HEAPU32.set(e,i/4);const a=o._createOnigScanner(r,i,t.length);for(let e=0,r=t.length;e<r;e++)o._ofree(n[e]);o._ofree(i),o._ofree(r),0===a&&function(t){throw new Error(t.UTF8ToString(t._getLastOnigError()))}(o),this._onigBinding=o,this._ptr=a;}dispose(){this._onigBinding._freeOnigScanner(this._ptr);}findNextMatchSync(t,n,e){let r=a,i=0;if("number"==typeof e?(8&e&&(r=!0),i=e):"boolean"==typeof e&&(r=e),"string"==typeof t){t=new s(t);const e=this._findNextMatchSync(t,n,r,i);return t.dispose(),e}return this._findNextMatchSync(t,n,r,i)}_findNextMatchSync(t,n,e,r){const i=this._onigBinding;let o;if(o=e?i._findNextOnigScannerMatchDbg(this._ptr,t.id,t.ptr,t.utf8Length,t.convertUtf16OffsetToUtf8(n),r):i._findNextOnigScannerMatch(this._ptr,t.id,t.ptr,t.utf8Length,t.convertUtf16OffsetToUtf8(n),r),0===o)return null;const a=i.HEAPU32;let f=o/4;const s=a[f++],u=a[f++];let c=[];for(let n=0;n<u;n++){const e=t.convertUtf8OffsetToUtf16(a[f++]),r=t.convertUtf8OffsetToUtf16(a[f++]);c[n]={start:e,end:r,length:r-e};}return {index:s,captureIndices:c}}}n.OnigScanner=u;let c=!1,l=null;n.loadWASM=function(t){if(c)return l;let n,e,r,a;if(c=!0,function(t){return "function"==typeof t.instantiator}(t))n=t.instantiator,e=t.print;else {let r;!function(t){return void 0!==t.data}(t)?r=t:(r=t.data,e=t.print),n=function(t){return "undefined"!=typeof Response&&t instanceof Response}(r)?"function"==typeof WebAssembly.instantiateStreaming?function(t){return n=>WebAssembly.instantiateStreaming(t,n)}(r):function(t){return async n=>{const e=await t.arrayBuffer();return WebAssembly.instantiate(e,n)}}(r):function(t){return n=>WebAssembly.instantiate(t,n)}(r);}return l=new Promise(((t,n)=>{r=t,a=n;})),function(t,n,e,r){i.default({print:n,instantiateWasm:(n,e)=>{if("undefined"==typeof performance){const t=()=>Date.now();n.env.emscripten_get_now=t,n.wasi_snapshot_preview1.emscripten_get_now=t;}return t(n).then((t=>e(t.instance)),r),{}}}).then((t=>{o=t,e();}));}(n,e,r,a),l},n.createOnigString=function(t){return new s(t)},n.createOnigScanner=function(t){return new u(t)},n.setDefaultDebugCall=function(t){a=t;};},418:t=>{var n=("undefined"!=typeof document&&document.currentScript&&document.currentScript.src,function(t){var n,e,r=void 0!==(t=t||{})?t:{};r.ready=new Promise((function(t,r){n=t,e=r;}));var i,o={};for(i in r)r.hasOwnProperty(i)&&(o[i]=r[i]);var a,f=[],s=!1,u=!1,c=!0,l="";function p(t){return r.locateFile?r.locateFile(t,l):l+t}c&&(a=function(t){var n;return "function"==typeof readbuffer?new Uint8Array(readbuffer(t)):(v("object"==typeof(n=read(t,"binary"))),n)},"undefined"!=typeof scriptArgs?f=scriptArgs:void 0!==arguments&&(f=arguments),"undefined"!=typeof onig_print&&("undefined"==typeof console&&(console={}),console.log=onig_print,console.warn=console.error="undefined"!=typeof printErr?printErr:onig_print));var h=r.print||console.log.bind(console),d=r.printErr||console.warn.bind(console);for(i in o)o.hasOwnProperty(i)&&(r[i]=o[i]);o=null,r.arguments&&(f=r.arguments),r.thisProgram&&r.thisProgram,r.quit&&r.quit;var g,_,m=function(t){};r.wasmBinary&&(g=r.wasmBinary),r.noExitRuntime,"object"!=typeof WebAssembly&&z("no native wasm support detected");var y=!1;function v(t,n){t||z("Assertion failed: "+n);}var w,S,A,b="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function O(t,n,e){for(var r=n+e,i=n;t[i]&&!(i>=r);)++i;if(i-n>16&&t.subarray&&b)return b.decode(t.subarray(n,i));for(var o="";n<i;){var a=t[n++];if(128&a){var f=63&t[n++];if(192!=(224&a)){var s=63&t[n++];if((a=224==(240&a)?(15&a)<<12|f<<6|s:(7&a)<<18|f<<12|s<<6|63&t[n++])<65536)o+=String.fromCharCode(a);else {var u=a-65536;o+=String.fromCharCode(55296|u>>10,56320|1023&u);}}else o+=String.fromCharCode((31&a)<<6|f);}else o+=String.fromCharCode(a);}return o}function U(t,n){return t?O(S,t,n):""}function x(t,n){return t%n>0&&(t+=n-t%n),t}function P(t){w=t,r.HEAP8=new Int8Array(t),r.HEAP16=new Int16Array(t),r.HEAP32=A=new Int32Array(t),r.HEAPU8=S=new Uint8Array(t),r.HEAPU16=new Uint16Array(t),r.HEAPU32=new Uint32Array(t),r.HEAPF32=new Float32Array(t),r.HEAPF64=new Float64Array(t);}"undefined"!=typeof TextDecoder&&new TextDecoder("utf-16le"),r.INITIAL_MEMORY;var T,R=[],E=[],M=[],L=[];function I(){if(r.preRun)for("function"==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)N(r.preRun.shift());$(R);}function D(){$(E);}function W(){$(M);}function C(){if(r.postRun)for("function"==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;)k(r.postRun.shift());$(L);}function N(t){R.unshift(t);}function k(t){L.unshift(t);}E.push({func:function(){ut();}});var B=0,H=null,j=null;function F(t){B++,r.monitorRunDependencies&&r.monitorRunDependencies(B);}function V(t){if(B--,r.monitorRunDependencies&&r.monitorRunDependencies(B),0==B&&(null!==H&&(clearInterval(H),H=null),j)){var n=j;j=null,n();}}function z(t){r.onAbort&&r.onAbort(t),d(t+=""),y=!0,t="abort("+t+"). Build with -s ASSERTIONS=1 for more info.";var n=new WebAssembly.RuntimeError(t);throw e(n),n}function q(t,n){return String.prototype.startsWith?t.startsWith(n):0===t.indexOf(n)}r.preloadedImages={},r.preloadedAudios={};var Y="data:application/octet-stream;base64,";function G(t){return q(t,Y)}var J,K="onig.wasm";function Q(t){try{if(t==K&&g)return new Uint8Array(g);if(a)return a(t);throw "both async and sync fetching of the wasm failed"}catch(t){z(t);}}function X(){return g||!s&&!u||"function"!=typeof fetch?Promise.resolve().then((function(){return Q(K)})):fetch(K,{credentials:"same-origin"}).then((function(t){if(!t.ok)throw "failed to load wasm binary file at '"+K+"'";return t.arrayBuffer()})).catch((function(){return Q(K)}))}function Z(){var t={env:st,wasi_snapshot_preview1:st};function n(t,n){var e=t.exports;r.asm=e,P((_=r.asm.memory).buffer),T=r.asm.__indirect_function_table,V();}function i(t){n(t.instance);}function o(n){return X().then((function(n){return WebAssembly.instantiate(n,t)})).then(n,(function(t){d("failed to asynchronously prepare wasm: "+t),z(t);}))}if(F(),r.instantiateWasm)try{return r.instantiateWasm(t,n)}catch(t){return d("Module.instantiateWasm callback failed with error: "+t),!1}return (g||"function"!=typeof WebAssembly.instantiateStreaming||G(K)||"function"!=typeof fetch?o(i):fetch(K,{credentials:"same-origin"}).then((function(n){return WebAssembly.instantiateStreaming(n,t).then(i,(function(t){return d("wasm streaming compile failed: "+t),d("falling back to ArrayBuffer instantiation"),o(i)}))}))).catch(e),{}}function $(t){for(;t.length>0;){var n=t.shift();if("function"!=typeof n){var e=n.func;"number"==typeof e?void 0===n.arg?T.get(e)():T.get(e)(n.arg):e(void 0===n.arg?null:n.arg);}else n(r);}}function tt(t,n,e){S.copyWithin(t,n,n+e);}function nt(){return S.length}function et(t){try{return _.grow(t-w.byteLength+65535>>>16),P(_.buffer),1}catch(t){}}function rt(t){var n=nt(),e=2147483648;if(t>e)return !1;for(var r=1;r<=4;r*=2){var i=n*(1+.2/r);if(i=Math.min(i,t+100663296),et(Math.min(e,x(Math.max(t,i),65536))))return !0}return !1}G(K)||(K=p(K)),J="undefined"!=typeof dateNow?dateNow:function(){return performance.now()};var it={mappings:{},buffers:[null,[],[]],printChar:function(t,n){var e=it.buffers[t];0===n||10===n?((1===t?h:d)(O(e,0)),e.length=0):e.push(n);},varargs:void 0,get:function(){return it.varargs+=4,A[it.varargs-4>>2]},getStr:function(t){return U(t)},get64:function(t,n){return t}};function ot(t,n,e,r){for(var i=0,o=0;o<e;o++){for(var a=A[n+8*o>>2],f=A[n+(8*o+4)>>2],s=0;s<f;s++)it.printChar(t,S[a+s]);i+=f;}return A[r>>2]=i,0}function at(t){m(0|t);}var ft,st={emscripten_get_now:J,emscripten_memcpy_big:tt,emscripten_resize_heap:rt,fd_write:ot,setTempRet0:at},ut=(Z(),r.___wasm_call_ctors=function(){return (ut=r.___wasm_call_ctors=r.asm.__wasm_call_ctors).apply(null,arguments)});function ct(t){function e(){ft||(ft=!0,r.calledRun=!0,y||(D(),W(),n(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),C()));}t=t||f,B>0||(I(),B>0||(r.setStatus?(r.setStatus("Running..."),setTimeout((function(){setTimeout((function(){r.setStatus("");}),1),e();}),1)):e()));}if(r.___errno_location=function(){return (r.___errno_location=r.asm.__errno_location).apply(null,arguments)},r._omalloc=function(){return (r._omalloc=r.asm.omalloc).apply(null,arguments)},r._ofree=function(){return (r._ofree=r.asm.ofree).apply(null,arguments)},r._getLastOnigError=function(){return (r._getLastOnigError=r.asm.getLastOnigError).apply(null,arguments)},r._createOnigScanner=function(){return (r._createOnigScanner=r.asm.createOnigScanner).apply(null,arguments)},r._freeOnigScanner=function(){return (r._freeOnigScanner=r.asm.freeOnigScanner).apply(null,arguments)},r._findNextOnigScannerMatch=function(){return (r._findNextOnigScannerMatch=r.asm.findNextOnigScannerMatch).apply(null,arguments)},r._findNextOnigScannerMatchDbg=function(){return (r._findNextOnigScannerMatchDbg=r.asm.findNextOnigScannerMatchDbg).apply(null,arguments)},r.stackSave=function(){return (r.stackSave=r.asm.stackSave).apply(null,arguments)},r.stackRestore=function(){return (r.stackRestore=r.asm.stackRestore).apply(null,arguments)},r.stackAlloc=function(){return (r.stackAlloc=r.asm.stackAlloc).apply(null,arguments)},r.dynCall_jiji=function(){return (r.dynCall_jiji=r.asm.dynCall_jiji).apply(null,arguments)},r.UTF8ToString=U,j=function t(){ft||ct(),ft||(j=t);},r.run=ct,r.preInit)for("function"==typeof r.preInit&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();return ct(),t.ready});t.exports=n;}},n={},function e(r){var i=n[r];if(void 0!==i)return i.exports;var o=n[r]={exports:{}};return t[r].call(o.exports,o,o.exports,e),o.exports}(770);var t,n;}));
|
|
40
|
-
} (main$3, main$3.exports));
|
|
41
|
-
|
|
42
|
-
var main$2 = /*@__PURE__*/getDefaultExportFromCjs(main$3.exports);
|
|
43
|
-
|
|
44
|
-
var main$1 = {exports: {}};
|
|
45
|
-
|
|
46
|
-
(function (module, exports) {
|
|
47
|
-
!function(e,t){"object"=='object'&&"object"=='object'?module.exports=t():"function"==typeof undefined&&undefined.amd?undefined([],t):"object"=='object'?exports.vscodetextmate=t():e.vscodetextmate=t();}(commonjsGlobal,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var i=t[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,n),i.l=!0,i.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r});},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0});},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)n.d(r,i,function(t){return e[t]}.bind(null,i));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=3)}([function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),i=n(5),o=n(6),s=n(2),a="undefined"==typeof performance?function(){return Date.now()}:function(){return performance.now()};t.createGrammar=function(e,t,n,r,i,o){return new v(e,t,n,r,i,o)};var c=function(e){this.scopeName=e;};t.FullScopeDependency=c;var u=function(){function e(e,t){this.scopeName=e,this.include=t;}return e.prototype.toKey=function(){return this.scopeName+"#"+this.include},e}();t.PartialScopeDependency=u;var l=function(){function e(){this.full=[],this.partial=[],this.visitedRule=new Set,this._seenFull=new Set,this._seenPartial=new Set;}return e.prototype.add=function(e){e instanceof c?this._seenFull.has(e.scopeName)||(this._seenFull.add(e.scopeName),this.full.push(e)):this._seenPartial.has(e.toKey())||(this._seenPartial.add(e.toKey()),this.partial.push(e));},e}();function h(e,t,n,i,o){for(var s=0,a=i;s<a.length;s++){var l=a[s];if(!e.visitedRule.has(l)){e.visitedRule.add(l);var d=l.repository?r.mergeObjects({},o,l.repository):o;Array.isArray(l.patterns)&&h(e,t,n,l.patterns,d);var g=l.include;if(g)if("$base"===g||g===t.scopeName)f(e,t,t);else if("$self"===g||g===n.scopeName)f(e,t,n);else if("#"===g.charAt(0))p(e,t,n,g.substring(1),d);else {var m=g.indexOf("#");if(m>=0){var _=g.substring(0,m),y=g.substring(m+1);_===t.scopeName?p(e,t,t,y,d):_===n.scopeName?p(e,t,n,y,d):e.add(new u(_,g.substring(m+1)));}else e.add(new c(g));}}}}function p(e,t,n,r,i){(void 0===i&&(i=n.repository),i&&i[r])&&h(e,t,n,[i[r]],i);}function f(e,t,n){if(n.patterns&&Array.isArray(n.patterns)&&h(e,t,n,n.patterns,n.repository),n.injections){var r=[];for(var i in n.injections)r.push(n.injections[i]);h(e,t,n,r,n.repository);}}function d(e,t){if(!e)return !1;if(e===t)return !0;var n=t.length;return e.length>n&&e.substr(0,n)===t&&"."===e[n]}function g(e,t){if(t.length<e.length)return !1;var n=0;return e.every((function(e){for(var r=n;r<t.length;r++)if(d(t[r],e))return n=r+1,!0;return !1}))}function m(e,t,n,r,s){for(var a=o.createMatchers(t,g),c=i.RuleFactory.getCompiledRuleId(n,r,s.repository),u=0,l=a;u<l.length;u++){var h=l[u];e.push({matcher:h.matcher,ruleId:c,grammar:s,priority:h.priority});}}t.ScopeDependencyCollector=l,t.collectSpecificDependencies=p,t.collectDependencies=f;var _=function(e,t,n,r){this.scopeName=e,this.languageId=t,this.tokenType=n,this.themeData=r;};t.ScopeMetadata=_;var y=function(){function e(t,n,r){if(this._initialLanguage=t,this._themeProvider=n,this._cache=new Map,this._defaultMetaData=new _("",this._initialLanguage,0,[this._themeProvider.getDefaults()]),this._embeddedLanguages=Object.create(null),r)for(var i=Object.keys(r),o=0,s=i.length;o<s;o++){var a=i[o],c=r[a];"number"==typeof c&&0!==c?this._embeddedLanguages[a]=c:console.warn("Invalid embedded language found at scope "+a+": <<"+c+">>");}var u=Object.keys(this._embeddedLanguages).map((function(t){return e._escapeRegExpCharacters(t)}));0===u.length?this._embeddedLanguagesRegex=null:(u.sort(),u.reverse(),this._embeddedLanguagesRegex=new RegExp("^(("+u.join(")|(")+"))($|\\.)",""));}return e.prototype.onDidChangeTheme=function(){this._cache=new Map,this._defaultMetaData=new _("",this._initialLanguage,0,[this._themeProvider.getDefaults()]);},e.prototype.getDefaultMetadata=function(){return this._defaultMetaData},e._escapeRegExpCharacters=function(e){return e.replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")},e.prototype.getMetadataForScope=function(t){if(null===t)return e._NULL_SCOPE_METADATA;var n=this._cache.get(t);return n||(n=this._doGetMetadataForScope(t),this._cache.set(t,n),n)},e.prototype._doGetMetadataForScope=function(e){var t=this._scopeToLanguage(e),n=this._toStandardTokenType(e),r=this._themeProvider.themeMatch(e);return new _(e,t,n,r)},e.prototype._scopeToLanguage=function(e){if(!e)return 0;if(!this._embeddedLanguagesRegex)return 0;var t=e.match(this._embeddedLanguagesRegex);if(!t)return 0;var n=this._embeddedLanguages[t[1]]||0;return n||0},e.prototype._toStandardTokenType=function(t){var n=t.match(e.STANDARD_TOKEN_TYPE_REGEXP);if(!n)return 0;switch(n[1]){case"comment":return 1;case"string":return 2;case"regex":return 4;case"meta.embedded":return 8}throw new Error("Unexpected match for standard token type!")},e._NULL_SCOPE_METADATA=new _("",0,0,null),e.STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/,e}(),v=function(){function e(e,t,n,r,i,s){if(this._scopeMetadataProvider=new y(t,i,n),this._onigLib=s,this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=i,this._grammar=C(e,null),this._injections=null,this._tokenTypeMatchers=[],r)for(var a=0,c=Object.keys(r);a<c.length;a++)for(var u=c[a],l=0,h=o.createMatchers(u,g);l<h.length;l++){var p=h[l];this._tokenTypeMatchers.push({matcher:p.matcher,type:r[u]});}}return e.prototype.dispose=function(){for(var e=0,t=this._ruleId2desc;e<t.length;e++){var n=t[e];n&&n.dispose();}},e.prototype.createOnigScanner=function(e){return this._onigLib.createOnigScanner(e)},e.prototype.createOnigString=function(e){return this._onigLib.createOnigString(e)},e.prototype.onDidChangeTheme=function(){this._scopeMetadataProvider.onDidChangeTheme();},e.prototype.getMetadataForScope=function(e){return this._scopeMetadataProvider.getMetadataForScope(e)},e.prototype.getInjections=function(){var e=this;if(null===this._injections){this._injections=[];var t=this._grammar.injections;if(t)for(var n in t)m(this._injections,n,t[n],this,this._grammar);if(this._grammarRepository){var r=this._grammarRepository.injections(this._grammar.scopeName);r&&r.forEach((function(t){var n=e.getExternalGrammar(t);if(n){var r=n.injectionSelector;r&&m(e._injections,r,n,e,n);}}));}this._injections.sort((function(e,t){return e.priority-t.priority}));}return this._injections},e.prototype.registerRule=function(e){var t=++this._lastRuleId,n=e(t);return this._ruleId2desc[t]=n,n},e.prototype.getRule=function(e){return this._ruleId2desc[e]},e.prototype.getExternalGrammar=function(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){var n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=C(n,t&&t.$base),this._includedGrammars[e]}return null},e.prototype.tokenizeLine=function(e,t){var n=this._tokenize(e,t,!1);return {tokens:n.lineTokens.getResult(n.ruleStack,n.lineLength),ruleStack:n.ruleStack}},e.prototype.tokenizeLine2=function(e,t){var n=this._tokenize(e,t,!0);return {tokens:n.lineTokens.getBinaryResult(n.ruleStack,n.lineLength),ruleStack:n.ruleStack}},e.prototype._tokenize=function(e,t,n){var r;if(-1===this._rootId&&(this._rootId=i.RuleFactory.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository)),t&&t!==I.NULL)r=!1,t.reset();else {r=!0;var o=this._scopeMetadataProvider.getDefaultMetadata(),s=o.themeData[0],a=P.set(0,o.languageId,o.tokenType,s.fontStyle,s.foreground,s.background),c=this.getRule(this._rootId).getName(null,null),u=this._scopeMetadataProvider.getMetadataForScope(c),l=x.mergeMetadata(a,null,u),h=new x(null,null===c?"unknown":c,l);t=new I(null,this._rootId,-1,-1,!1,null,h,h);}e+="\n";var p=this.createOnigString(e),f=p.content.length,d=new T(n,e,this._tokenTypeMatchers),g=S(this,p,r,0,t,d,!0);return b(p),{lineLength:f,lineTokens:d,ruleStack:g}},e}();function b(e){"function"==typeof e.dispose&&e.dispose();}function C(e,t){return (e=r.clone(e)).repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}function w(e,t,n,r,i,o,s){if(0!==o.length){for(var a=t.content,c=Math.min(o.length,s.length),u=[],l=s[0].end,h=0;h<c;h++){var p=o[h];if(null!==p){var f=s[h];if(0!==f.length){if(f.start>l)break;for(;u.length>0&&u[u.length-1].endPos<=f.start;)i.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop();if(u.length>0?i.produceFromScopes(u[u.length-1].scopes,f.start):i.produce(r,f.start),p.retokenizeCapturedWithRuleId){var d=p.getName(a,s),g=r.contentNameScopesList.push(e,d),m=p.getContentName(a,s),_=g.push(e,m),y=r.push(p.retokenizeCapturedWithRuleId,f.start,-1,!1,null,g,_),v=e.createOnigString(a.substring(0,f.end));S(e,v,n&&0===f.start,f.start,y,i,!1),b(v);}else {var C=p.getName(a,s);if(null!==C){var w=(u.length>0?u[u.length-1].scopes:r.contentNameScopesList).push(e,C);u.push(new A(w,f.end));}}}}}for(;u.length>0;)i.produceFromScopes(u[u.length-1].scopes,u[u.length-1].endPos),u.pop();}}function k(e){for(var t=[],n=0,r=e.rules.length;n<r;n++)t.push(" - "+e.rules[n]+": "+e.debugRegExps[n]);return t.join("\n")}function R(e,t,n,r,i,o){var c=function(e,t,n,r,i,o){var c=i.getRule(e),u=c.compile(e,i.endRule,n,r===o),l=0;s.DebugFlags.InDebugMode&&(l=a());var h=u.scanner.findNextMatchSync(t,r);if(s.DebugFlags.InDebugMode){var p=a()-l;p>5&&console.warn("Rule "+c.debugName+" ("+c.id+") matching took "+p+" against '"+t+"'"),h&&console.log("matched rule id: "+u.rules[h.index]+" from "+h.captureIndices[0].start+" to "+h.captureIndices[0].end);}return h?{captureIndices:h.captureIndices,matchedRuleId:u.rules[h.index]}:null}(e,t,n,r,i,o),u=e.getInjections();if(0===u.length)return c;var l=function(e,t,n,r,i,o,a){for(var c,u=Number.MAX_VALUE,l=null,h=0,p=o.contentNameScopesList.generateScopes(),f=0,d=e.length;f<d;f++){var g=e[f];if(g.matcher(p)){var m=t.getRule(g.ruleId).compile(t,null,r,i===a),_=m.scanner.findNextMatchSync(n,i);if(s.DebugFlags.InDebugMode&&(console.log(" scanning for injections"),console.log(k(m))),_){var y=_.captureIndices[0].start;if(!(y>=u)&&(u=y,l=_.captureIndices,c=m.rules[_.index],h=g.priority,u===i))break}}}return l?{priorityMatch:-1===h,captureIndices:l,matchedRuleId:c}:null}(u,e,t,n,r,i,o);if(!l)return c;if(!c)return l;var h=c.captureIndices[0].start,p=l.captureIndices[0].start;return p<h||l.priorityMatch&&p===h?l:c}function S(e,t,n,r,o,a,c){var u=t.content.length,l=!1,h=-1;if(c){var p=function(e,t,n,r,o,a){for(var c=o.beginRuleCapturedEOL?0:-1,u=[],l=o;l;l=l.pop()){var h=l.getRule(e);h instanceof i.BeginWhileRule&&u.push({rule:h,stack:l});}for(var p=u.pop();p;p=u.pop()){var f=p.rule.compileWhile(e,p.stack.endRule,n,c===r),d=f.scanner.findNextMatchSync(t,r);if(s.DebugFlags.InDebugMode&&(console.log(" scanning for while rule"),console.log(k(f))),!d){s.DebugFlags.InDebugMode&&console.log(" popping "+p.rule.debugName+" - "+p.rule.debugWhileRegExp),o=p.stack.pop();break}if(-2!==f.rules[d.index]){o=p.stack.pop();break}d.captureIndices&&d.captureIndices.length&&(a.produce(p.stack,d.captureIndices[0].start),w(e,t,n,p.stack,a,p.rule.whileCaptures,d.captureIndices),a.produce(p.stack,d.captureIndices[0].end),c=d.captureIndices[0].end,d.captureIndices[0].end>r&&(r=d.captureIndices[0].end,n=!1));}return {stack:o,linePos:r,anchorPosition:c,isFirstLine:n}}(e,t,n,r,o,a);o=p.stack,r=p.linePos,n=p.isFirstLine,h=p.anchorPosition;}for(;!l;)f();function f(){s.DebugFlags.InDebugMode&&(console.log(""),console.log("@@scanNext "+r+": |"+t.content.substr(r).replace(/\n$/,"\\n")+"|"));var c=R(e,t,n,r,o,h);if(!c)return s.DebugFlags.InDebugMode&&console.log(" no more matches."),a.produce(o,u),void(l=!0);var p=c.captureIndices,f=c.matchedRuleId,d=!!(p&&p.length>0)&&p[0].end>r;if(-1===f){var g=o.getRule(e);s.DebugFlags.InDebugMode&&console.log(" popping "+g.debugName+" - "+g.debugEndRegExp),a.produce(o,p[0].start),o=o.setContentNameScopesList(o.nameScopesList),w(e,t,n,o,a,g.endCaptures,p),a.produce(o,p[0].end);var m=o;if(o=o.pop(),h=m.getAnchorPos(),!d&&m.getEnterPos()===r)return s.DebugFlags.InDebugMode&&console.error("[1] - Grammar is in an endless loop - Grammar pushed & popped a rule without advancing"),o=m,a.produce(o,u),void(l=!0)}else {var _=e.getRule(f);a.produce(o,p[0].start);var y=o,v=_.getName(t.content,p),b=o.contentNameScopesList.push(e,v);if(o=o.push(f,r,h,p[0].end===u,null,b,b),_ instanceof i.BeginEndRule){var C=_;s.DebugFlags.InDebugMode&&console.log(" pushing "+C.debugName+" - "+C.debugBeginRegExp),w(e,t,n,o,a,C.beginCaptures,p),a.produce(o,p[0].end),h=p[0].end;var k=C.getContentName(t.content,p),S=b.push(e,k);if(o=o.setContentNameScopesList(S),C.endHasBackReferences&&(o=o.setEndRule(C.getEndWithResolvedBackReferences(t.content,p))),!d&&y.hasSameRuleAs(o))return s.DebugFlags.InDebugMode&&console.error("[2] - Grammar is in an endless loop - Grammar pushed the same rule without advancing"),o=o.pop(),a.produce(o,u),void(l=!0)}else if(_ instanceof i.BeginWhileRule){C=_;s.DebugFlags.InDebugMode&&console.log(" pushing "+C.debugName),w(e,t,n,o,a,C.beginCaptures,p),a.produce(o,p[0].end),h=p[0].end;k=C.getContentName(t.content,p),S=b.push(e,k);if(o=o.setContentNameScopesList(S),C.whileHasBackReferences&&(o=o.setEndRule(C.getWhileWithResolvedBackReferences(t.content,p))),!d&&y.hasSameRuleAs(o))return s.DebugFlags.InDebugMode&&console.error("[3] - Grammar is in an endless loop - Grammar pushed the same rule without advancing"),o=o.pop(),a.produce(o,u),void(l=!0)}else {var P=_;if(s.DebugFlags.InDebugMode&&console.log(" matched "+P.debugName+" - "+P.debugMatchRegExp),w(e,t,n,o,a,P.captures,p),a.produce(o,p[0].end),o=o.pop(),!d)return s.DebugFlags.InDebugMode&&console.error("[4] - Grammar is in an endless loop - Grammar is not advancing, nor is it pushing/popping"),o=o.safePop(),a.produce(o,u),void(l=!0)}}p[0].end>r&&(r=p[0].end,n=!1);}return o}t.Grammar=v;var P=function(){function e(){}return e.toBinaryStr=function(e){for(var t=e.toString(2);t.length<32;)t="0"+t;return t},e.printMetadata=function(t){var n=e.getLanguageId(t),r=e.getTokenType(t),i=e.getFontStyle(t),o=e.getForeground(t),s=e.getBackground(t);console.log({languageId:n,tokenType:r,fontStyle:i,foreground:o,background:s});},e.getLanguageId=function(e){return (255&e)>>>0},e.getTokenType=function(e){return (1792&e)>>>8},e.getFontStyle=function(e){return (14336&e)>>>11},e.getForeground=function(e){return (8372224&e)>>>14},e.getBackground=function(e){return (4286578688&e)>>>23},e.set=function(t,n,r,i,o,s){var a=e.getLanguageId(t),c=e.getTokenType(t),u=e.getFontStyle(t),l=e.getForeground(t),h=e.getBackground(t);return 0!==n&&(a=n),0!==r&&(c=8===r?0:r),-1!==i&&(u=i),0!==o&&(l=o),0!==s&&(h=s),(a<<0|c<<8|u<<11|l<<14|h<<23)>>>0},e}();t.StackElementMetadata=P;var x=function(){function e(e,t,n){this.parent=e,this.scope=t,this.metadata=n;}return e._equals=function(e,t){for(;;){if(e===t)return !0;if(!e&&!t)return !0;if(!e||!t)return !1;if(e.scope!==t.scope||e.metadata!==t.metadata)return !1;e=e.parent,t=t.parent;}},e.prototype.equals=function(t){return e._equals(this,t)},e._matchesScope=function(e,t,n){return t===e||e.substring(0,n.length)===n},e._matches=function(e,t){if(null===t)return !0;for(var n=t.length,r=0,i=t[r],o=i+".";e;){if(this._matchesScope(e.scope,i,o)){if(++r===n)return !0;o=(i=t[r])+".";}e=e.parent;}return !1},e.mergeMetadata=function(e,t,n){if(null===n)return e;var r=-1,i=0,o=0;if(null!==n.themeData)for(var s=0,a=n.themeData.length;s<a;s++){var c=n.themeData[s];if(this._matches(t,c.parentScopes)){r=c.fontStyle,i=c.foreground,o=c.background;break}}return P.set(e,n.languageId,n.tokenType,r,i,o)},e._push=function(t,n,r){for(var i=0,o=r.length;i<o;i++){var s=r[i],a=n.getMetadataForScope(s),c=e.mergeMetadata(t.metadata,t,a);t=new e(t,s,c);}return t},e.prototype.push=function(t,n){return null===n?this:n.indexOf(" ")>=0?e._push(this,t,n.split(/ /g)):e._push(this,t,[n])},e._generateScopes=function(e){for(var t=[],n=0;e;)t[n++]=e.scope,e=e.parent;return t.reverse(),t},e.prototype.generateScopes=function(){return e._generateScopes(this)},e}();t.ScopeListElement=x;var I=function(){function e(e,t,n,r,i,o,s,a){this.parent=e,this.depth=this.parent?this.parent.depth+1:1,this.ruleId=t,this._enterPos=n,this._anchorPos=r,this.beginRuleCapturedEOL=i,this.endRule=o,this.nameScopesList=s,this.contentNameScopesList=a;}return e._structuralEquals=function(e,t){for(;;){if(e===t)return !0;if(!e&&!t)return !0;if(!e||!t)return !1;if(e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return !1;e=e.parent,t=t.parent;}},e._equals=function(e,t){return e===t||!!this._structuralEquals(e,t)&&e.contentNameScopesList.equals(t.contentNameScopesList)},e.prototype.clone=function(){return this},e.prototype.equals=function(t){return null!==t&&e._equals(this,t)},e._reset=function(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent;},e.prototype.reset=function(){e._reset(this);},e.prototype.pop=function(){return this.parent},e.prototype.safePop=function(){return this.parent?this.parent:this},e.prototype.push=function(t,n,r,i,o,s,a){return new e(this,t,n,r,i,o,s,a)},e.prototype.getEnterPos=function(){return this._enterPos},e.prototype.getAnchorPos=function(){return this._anchorPos},e.prototype.getRule=function(e){return e.getRule(this.ruleId)},e.prototype._writeString=function(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]="("+this.ruleId+", TODO-"+this.nameScopesList+", TODO-"+this.contentNameScopesList+")",t},e.prototype.toString=function(){var e=[];return this._writeString(e,0),"["+e.join(",")+"]"},e.prototype.setContentNameScopesList=function(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)},e.prototype.setEndRule=function(t){return this.endRule===t?this:new e(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,t,this.nameScopesList,this.contentNameScopesList)},e.prototype.hasSameRuleAs=function(e){return this.ruleId===e.ruleId},e.NULL=new e(null,0,0,0,!1,null,null,null),e}();t.StackElement=I;var A=function(e,t){this.scopes=e,this.endPos=t;};t.LocalStackElement=A;var T=function(){function e(e,t,n){this._emitBinaryTokens=e,this._tokenTypeOverrides=n,s.DebugFlags.InDebugMode?this._lineText=t:this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0;}return e.prototype.produce=function(e,t){this.produceFromScopes(e.contentNameScopesList,t);},e.prototype.produceFromScopes=function(e,t){if(!(this._lastTokenEndIndex>=t)){if(this._emitBinaryTokens){for(var n=e.metadata,r=0,i=this._tokenTypeOverrides;r<i.length;r++){var o=i[r];o.matcher(e.generateScopes())&&(n=P.set(n,0,L(o.type),-1,0,0));}return this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===n||(this._binaryTokens.push(this._lastTokenEndIndex),this._binaryTokens.push(n)),void(this._lastTokenEndIndex=t)}var a=e.generateScopes();if(s.DebugFlags.InDebugMode){console.log(" token: |"+this._lineText.substring(this._lastTokenEndIndex,t).replace(/\n$/,"\\n")+"|");for(var c=0;c<a.length;c++)console.log(" * "+a[c]);}this._tokens.push({startIndex:this._lastTokenEndIndex,endIndex:t,scopes:a}),this._lastTokenEndIndex=t;}},e.prototype.getResult=function(e,t){return this._tokens.length>0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),0===this._tokens.length&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens},e.prototype.getBinaryResult=function(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),0===this._binaryTokens.length&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);for(var n=new Uint32Array(this._binaryTokens.length),r=0,i=this._binaryTokens.length;r<i;r++)n[r]=this._binaryTokens[r];return n},e}();function L(e){switch(e){case 4:return 4;case 2:return 2;case 1:return 1;case 0:default:return 8}}},function(e,t,n){"use strict";function r(e){return Array.isArray(e)?function(e){for(var t=[],n=0,i=e.length;n<i;n++)t[n]=r(e[n]);return t}(e):"object"==typeof e?function(e){var t={};for(var n in e)t[n]=r(e[n]);return t}(e):e}Object.defineProperty(t,"__esModule",{value:!0}),t.clone=function(e){return r(e)},t.mergeObjects=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];return t.forEach((function(t){for(var n in t)e[n]=t[n];})),e},t.basename=function e(t){var n=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return 0===n?t:~n==t.length-1?e(t.substring(0,t.length-1)):t.substr(1+~n)};var i=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/,o=function(){function e(){}return e.hasCaptures=function(e){return null!==e&&i.test(e)},e.replaceCaptures=function(e,t,n){return e.replace(i,(function(e,r,i,o){var s=n[parseInt(r||i,10)];if(!s)return e;for(var a=t.substring(s.start,s.end);"."===a[0];)a=a.substring(1);switch(o){case"downcase":return a.toLowerCase();case"upcase":return a.toUpperCase();default:return a}}))},e}();t.RegexSource=o;},function(e,t,n){"use strict";(function(e){Object.defineProperty(t,"__esModule",{value:!0}),t.DebugFlags={InDebugMode:void 0!==e&&!!e.env.VSCODE_TEXTMATE_DEBUG};}).call(this,n(7));},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e));}catch(e){o(e);}}function a(e){try{c(r.throw(e));}catch(e){o(e);}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t);}))).then(s,a);}c((r=r.apply(e,t||[])).next());}))},i=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s);}catch(e){o=[6,e],r=0;}finally{n=i=0;}if(5&o[0])throw o[1];return {value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(4),s=n(8),a=n(11),c=n(0),u=function(){function e(e){this._options=e,this._syncRegistry=new o.SyncRegistry(a.Theme.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map;}return e.prototype.dispose=function(){this._syncRegistry.dispose();},e.prototype.setTheme=function(e,t){this._syncRegistry.setTheme(a.Theme.createFromRawTheme(e,t));},e.prototype.getColorMap=function(){return this._syncRegistry.getColorMap()},e.prototype.loadGrammarWithEmbeddedLanguages=function(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})},e.prototype.loadGrammarWithConfiguration=function(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes)},e.prototype.loadGrammar=function(e){return this._loadGrammar(e,0,null,null)},e.prototype._doLoadSingleGrammar=function(e){return r(this,void 0,void 0,(function(){var t,n;return i(this,(function(r){switch(r.label){case 0:return [4,this._options.loadGrammar(e)];case 1:return (t=r.sent())&&(n="function"==typeof this._options.getInjections?this._options.getInjections(e):void 0,this._syncRegistry.addGrammar(t,n)),[2]}}))}))},e.prototype._loadSingleGrammar=function(e){return r(this,void 0,void 0,(function(){return i(this,(function(t){return this._ensureGrammarCache.has(e)||this._ensureGrammarCache.set(e,this._doLoadSingleGrammar(e)),[2,this._ensureGrammarCache.get(e)]}))}))},e.prototype._collectDependenciesForDep=function(e,t,n){var r=this._syncRegistry.lookup(n.scopeName);if(r){n instanceof c.FullScopeDependency?c.collectDependencies(t,this._syncRegistry.lookup(e),r):c.collectSpecificDependencies(t,this._syncRegistry.lookup(e),r,n.include);var i=this._syncRegistry.injections(n.scopeName);if(i)for(var o=0,s=i;o<s.length;o++){var a=s[o];t.add(new c.FullScopeDependency(a));}}else if(n.scopeName===e)throw new Error("No grammar provided for <"+e+">")},e.prototype._loadGrammar=function(e,t,n,o){return r(this,void 0,void 0,(function(){var r,s,a,u,l,h,p,f,d,g,m,_,y=this;return i(this,(function(i){switch(i.label){case 0:r=new Set,s=new Set,r.add(e),a=[new c.FullScopeDependency(e)],i.label=1;case 1:return a.length>0?(u=a,a=[],[4,Promise.all(u.map((function(e){return y._loadSingleGrammar(e.scopeName)})))]):[3,3];case 2:for(i.sent(),l=new c.ScopeDependencyCollector,h=0,p=u;h<p.length;h++)_=p[h],this._collectDependenciesForDep(e,l,_);for(f=0,d=l.full;f<d.length;f++)_=d[f],r.has(_.scopeName)||(r.add(_.scopeName),a.push(_));for(g=0,m=l.partial;g<m.length;g++)_=m[g],r.has(_.scopeName)||s.has(_.toKey())||(s.add(_.toKey()),a.push(_));return [3,1];case 3:return [2,this.grammarForScopeName(e,t,n,o)]}}))}))},e.prototype.addGrammar=function(e,t,n,o){return void 0===t&&(t=[]),void 0===n&&(n=0),void 0===o&&(o=null),r(this,void 0,void 0,(function(){return i(this,(function(r){switch(r.label){case 0:return this._syncRegistry.addGrammar(e,t),[4,this.grammarForScopeName(e.scopeName,n,o)];case 1:return [2,r.sent()]}}))}))},e.prototype.grammarForScopeName=function(e,t,n,r){return void 0===t&&(t=0),void 0===n&&(n=null),void 0===r&&(r=null),this._syncRegistry.grammarForScopeName(e,t,n,r)},e}();t.Registry=u,t.INITIAL=c.StackElement.NULL,t.parseRawGrammar=s.parseRawGrammar;},function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e));}catch(e){o(e);}}function a(e){try{c(r.throw(e));}catch(e){o(e);}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t);}))).then(s,a);}c((r=r.apply(e,t||[])).next());}))},i=this&&this.__generator||function(e,t){var n,r,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;s;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,r=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s);}catch(e){o=[6,e],r=0;}finally{n=i=0;}if(5&o[0])throw o[1];return {value:o[0]?o[1]:void 0,done:!0}}([o,a])}}};Object.defineProperty(t,"__esModule",{value:!0});var o=n(0),s=function(){function e(e,t){this._theme=e,this._grammars={},this._rawGrammars={},this._injectionGrammars={},this._onigLibPromise=t;}return e.prototype.dispose=function(){for(var e in this._grammars)this._grammars.hasOwnProperty(e)&&this._grammars[e].dispose();},e.prototype.setTheme=function(e){var t=this;this._theme=e,Object.keys(this._grammars).forEach((function(e){t._grammars[e].onDidChangeTheme();}));},e.prototype.getColorMap=function(){return this._theme.getColorMap()},e.prototype.addGrammar=function(e,t){this._rawGrammars[e.scopeName]=e,t&&(this._injectionGrammars[e.scopeName]=t);},e.prototype.lookup=function(e){return this._rawGrammars[e]},e.prototype.injections=function(e){return this._injectionGrammars[e]},e.prototype.getDefaults=function(){return this._theme.getDefaults()},e.prototype.themeMatch=function(e){return this._theme.match(e)},e.prototype.grammarForScopeName=function(e,t,n,s){return r(this,void 0,void 0,(function(){var r,a,c,u,l;return i(this,(function(i){switch(i.label){case 0:return this._grammars[e]?[3,2]:(r=this._rawGrammars[e])?(a=this._grammars,c=e,u=o.createGrammar,l=[r,t,n,s,this],[4,this._onigLibPromise]):[2,null];case 1:a[c]=u.apply(void 0,l.concat([i.sent()])),i.label=2;case 2:return [2,this._grammars[e]]}}))}))},e}();t.SyncRegistry=s;},function(e,t,n){"use strict";var r,i=this&&this.__extends||(r=function(e,t){return (r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t;}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);})(e,t)},function(e,t){function n(){this.constructor=e;}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n);});Object.defineProperty(t,"__esModule",{value:!0});var o=n(1),s=/\\(\d+)/,a=/\\(\d+)/g,c=function(){function e(e,t,n){this.debugRegExps=t,this.rules=n,this.scanner=e.createOnigScanner(t);}return e.prototype.dispose=function(){"function"==typeof this.scanner.dispose&&this.scanner.dispose();},e}();t.CompiledRule=c;var u=function(){function e(e,t,n,r){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=o.RegexSource.hasCaptures(this._name),this._contentName=r||null,this._contentNameIsCapturing=o.RegexSource.hasCaptures(this._contentName);}return Object.defineProperty(e.prototype,"debugName",{get:function(){var e=this.$location?o.basename(this.$location.filename)+":"+this.$location.line:"unknown";return this.constructor.name+"#"+this.id+" @ "+e},enumerable:!0,configurable:!0}),e.prototype.getName=function(e,t){return this._nameIsCapturing&&null!==this._name&&null!==e&&null!==t?o.RegexSource.replaceCaptures(this._name,e,t):this._name},e.prototype.getContentName=function(e,t){return this._contentNameIsCapturing&&null!==this._contentName?o.RegexSource.replaceCaptures(this._contentName,e,t):this._contentName},e}();t.Rule=u;var l=function(e){function t(t,n,r,i,o){var s=e.call(this,t,n,r,i)||this;return s.retokenizeCapturedWithRuleId=o,s}return i(t,e),t.prototype.dispose=function(){},t.prototype.collectPatternsRecursive=function(e,t,n){throw new Error("Not supported!")},t.prototype.compile=function(e,t,n,r){throw new Error("Not supported!")},t}(u);t.CaptureRule=l;var h=function(){function e(e,t,n){if(void 0===n&&(n=!0),n)if(e){for(var r=e.length,i=0,o=[],a=!1,c=0;c<r;c++){if("\\"===e.charAt(c)&&c+1<r){var u=e.charAt(c+1);"z"===u?(o.push(e.substring(i,c)),o.push("$(?!\\n)(?<!\\n)"),i=c+2):"A"!==u&&"G"!==u||(a=!0),c++;}}this.hasAnchor=a,0===i?this.source=e:(o.push(e.substring(i,r)),this.source=o.join(""));}else this.hasAnchor=!1,this.source=e;else this.hasAnchor=!1,this.source=e;this.hasAnchor?this._anchorCache=this._buildAnchorCache():this._anchorCache=null,this.ruleId=t,this.hasBackReferences=s.test(this.source);}return e.prototype.clone=function(){return new e(this.source,this.ruleId,!0)},e.prototype.setSource=function(e){this.source!==e&&(this.source=e,this.hasAnchor&&(this._anchorCache=this._buildAnchorCache()));},e.prototype.resolveBackReferences=function(e,t){var n=t.map((function(t){return e.substring(t.start,t.end)}));return a.lastIndex=0,this.source.replace(a,(function(e,t){return (n[parseInt(t,10)]||"").replace(/[\-\\\{\}\*\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&")}))},e.prototype._buildAnchorCache=function(){var e,t,n,r,i=[],o=[],s=[],a=[];for(e=0,t=this.source.length;e<t;e++)n=this.source.charAt(e),i[e]=n,o[e]=n,s[e]=n,a[e]=n,"\\"===n&&e+1<t&&("A"===(r=this.source.charAt(e+1))?(i[e+1]="",o[e+1]="",s[e+1]="A",a[e+1]="A"):"G"===r?(i[e+1]="",o[e+1]="G",s[e+1]="",a[e+1]="G"):(i[e+1]=r,o[e+1]=r,s[e+1]=r,a[e+1]=r),e++);return {A0_G0:i.join(""),A0_G1:o.join(""),A1_G0:s.join(""),A1_G1:a.join("")}},e.prototype.resolveAnchors=function(e,t){return this.hasAnchor&&this._anchorCache?e?t?this._anchorCache.A1_G1:this._anchorCache.A1_G0:t?this._anchorCache.A0_G1:this._anchorCache.A0_G0:this.source},e}();t.RegExpSource=h;var p=function(){function e(){this._items=[],this._hasAnchors=!1,this._cached=null,this._anchorCache={A0_G0:null,A0_G1:null,A1_G0:null,A1_G1:null};}return e.prototype.dispose=function(){this._disposeCaches();},e.prototype._disposeCaches=function(){this._cached&&(this._cached.dispose(),this._cached=null),this._anchorCache.A0_G0&&(this._anchorCache.A0_G0.dispose(),this._anchorCache.A0_G0=null),this._anchorCache.A0_G1&&(this._anchorCache.A0_G1.dispose(),this._anchorCache.A0_G1=null),this._anchorCache.A1_G0&&(this._anchorCache.A1_G0.dispose(),this._anchorCache.A1_G0=null),this._anchorCache.A1_G1&&(this._anchorCache.A1_G1.dispose(),this._anchorCache.A1_G1=null);},e.prototype.push=function(e){this._items.push(e),this._hasAnchors=this._hasAnchors||e.hasAnchor;},e.prototype.unshift=function(e){this._items.unshift(e),this._hasAnchors=this._hasAnchors||e.hasAnchor;},e.prototype.length=function(){return this._items.length},e.prototype.setSource=function(e,t){this._items[e].source!==t&&(this._disposeCaches(),this._items[e].setSource(t));},e.prototype.compile=function(e,t,n){if(this._hasAnchors)return t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0);if(!this._cached){var r=this._items.map((function(e){return e.source}));this._cached=new c(e,r,this._items.map((function(e){return e.ruleId})));}return this._cached},e.prototype._resolveAnchors=function(e,t,n){var r=this._items.map((function(e){return e.resolveAnchors(t,n)}));return new c(e,r,this._items.map((function(e){return e.ruleId})))},e}();t.RegExpSourceList=p;var f=function(e){function t(t,n,r,i,o){var s=e.call(this,t,n,r,null)||this;return s._match=new h(i,s.id),s.captures=o,s._cachedCompiledPatterns=null,s}return i(t,e),t.prototype.dispose=function(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null);},Object.defineProperty(t.prototype,"debugMatchRegExp",{get:function(){return ""+this._match.source},enumerable:!0,configurable:!0}),t.prototype.collectPatternsRecursive=function(e,t,n){t.push(this._match);},t.prototype.compile=function(e,t,n,r){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new p,this.collectPatternsRecursive(e,this._cachedCompiledPatterns,!0)),this._cachedCompiledPatterns.compile(e,n,r)},t}(u);t.MatchRule=f;var d=function(e){function t(t,n,r,i,o){var s=e.call(this,t,n,r,i)||this;return s.patterns=o.patterns,s.hasMissingPatterns=o.hasMissingPatterns,s._cachedCompiledPatterns=null,s}return i(t,e),t.prototype.dispose=function(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null);},t.prototype.collectPatternsRecursive=function(e,t,n){var r,i;for(r=0,i=this.patterns.length;r<i;r++)e.getRule(this.patterns[r]).collectPatternsRecursive(e,t,!1);},t.prototype.compile=function(e,t,n,r){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new p,this.collectPatternsRecursive(e,this._cachedCompiledPatterns,!0)),this._cachedCompiledPatterns.compile(e,n,r)},t}(u);t.IncludeOnlyRule=d;var g=function(e){function t(t,n,r,i,o,s,a,c,u,l){var p=e.call(this,t,n,r,i)||this;return p._begin=new h(o,p.id),p.beginCaptures=s,p._end=new h(a||"",-1),p.endHasBackReferences=p._end.hasBackReferences,p.endCaptures=c,p.applyEndPatternLast=u||!1,p.patterns=l.patterns,p.hasMissingPatterns=l.hasMissingPatterns,p._cachedCompiledPatterns=null,p}return i(t,e),t.prototype.dispose=function(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null);},Object.defineProperty(t.prototype,"debugBeginRegExp",{get:function(){return ""+this._begin.source},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"debugEndRegExp",{get:function(){return ""+this._end.source},enumerable:!0,configurable:!0}),t.prototype.getEndWithResolvedBackReferences=function(e,t){return this._end.resolveBackReferences(e,t)},t.prototype.collectPatternsRecursive=function(e,t,n){if(n){var r,i=void 0;for(i=0,r=this.patterns.length;i<r;i++)e.getRule(this.patterns[i]).collectPatternsRecursive(e,t,!1);}else t.push(this._begin);},t.prototype.compile=function(e,t,n,r){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new p,this.collectPatternsRecursive(e,this._cachedCompiledPatterns,!0),this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)),this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns.compile(e,n,r)},t}(u);t.BeginEndRule=g;var m=function(e){function t(t,n,r,i,o,s,a,c,u){var l=e.call(this,t,n,r,i)||this;return l._begin=new h(o,l.id),l.beginCaptures=s,l.whileCaptures=c,l._while=new h(a,-2),l.whileHasBackReferences=l._while.hasBackReferences,l.patterns=u.patterns,l.hasMissingPatterns=u.hasMissingPatterns,l._cachedCompiledPatterns=null,l._cachedCompiledWhilePatterns=null,l}return i(t,e),t.prototype.dispose=function(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null);},Object.defineProperty(t.prototype,"debugBeginRegExp",{get:function(){return ""+this._begin.source},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"debugWhileRegExp",{get:function(){return ""+this._while.source},enumerable:!0,configurable:!0}),t.prototype.getWhileWithResolvedBackReferences=function(e,t){return this._while.resolveBackReferences(e,t)},t.prototype.collectPatternsRecursive=function(e,t,n){if(n){var r,i=void 0;for(i=0,r=this.patterns.length;i<r;i++)e.getRule(this.patterns[i]).collectPatternsRecursive(e,t,!1);}else t.push(this._begin);},t.prototype.compile=function(e,t,n,r){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new p,this.collectPatternsRecursive(e,this._cachedCompiledPatterns,!0)),this._cachedCompiledPatterns.compile(e,n,r)},t.prototype.compileWhile=function(e,t,n,r){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new p,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||""),this._cachedCompiledWhilePatterns.compile(e,n,r)},t}(u);t.BeginWhileRule=m;var _=function(){function e(){}return e.createCaptureRule=function(e,t,n,r,i){return e.registerRule((function(e){return new l(t,e,n,r,i)}))},e.getCompiledRuleId=function(t,n,r){return t.id||n.registerRule((function(i){if(t.id=i,t.match)return new f(t.$vscodeTextmateLocation,t.id,t.name,t.match,e._compileCaptures(t.captures,n,r));if(void 0===t.begin){t.repository&&(r=o.mergeObjects({},r,t.repository));var s=t.patterns;return void 0===s&&t.include&&(s=[{include:t.include}]),new d(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,e._compilePatterns(s,n,r))}return t.while?new m(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.while,e._compileCaptures(t.whileCaptures||t.captures,n,r),e._compilePatterns(t.patterns,n,r)):new g(t.$vscodeTextmateLocation,t.id,t.name,t.contentName,t.begin,e._compileCaptures(t.beginCaptures||t.captures,n,r),t.end,e._compileCaptures(t.endCaptures||t.captures,n,r),t.applyEndPatternLast,e._compilePatterns(t.patterns,n,r))})),t.id},e._compileCaptures=function(t,n,r){var i=[];if(t){var o=0;for(var s in t){if("$vscodeTextmateLocation"!==s)(c=parseInt(s,10))>o&&(o=c);}for(var a=0;a<=o;a++)i[a]=null;for(var s in t)if("$vscodeTextmateLocation"!==s){var c=parseInt(s,10),u=0;t[s].patterns&&(u=e.getCompiledRuleId(t[s],n,r)),i[c]=e.createCaptureRule(n,t[s].$vscodeTextmateLocation,t[s].name,t[s].contentName,u);}}return i},e._compilePatterns=function(t,n,r){var i=[];if(t)for(var o=0,s=t.length;o<s;o++){var a=t[o],c=-1;if(a.include)if("#"===a.include.charAt(0)){var u=r[a.include.substr(1)];u&&(c=e.getCompiledRuleId(u,n,r));}else if("$base"===a.include||"$self"===a.include)c=e.getCompiledRuleId(r[a.include],n,r);else {var l=null,h=null,p=a.include.indexOf("#");p>=0?(l=a.include.substring(0,p),h=a.include.substring(p+1)):l=a.include;var f=n.getExternalGrammar(l,r);if(f)if(h){var _=f.repository[h];_&&(c=e.getCompiledRuleId(_,n,f.repository));}else c=e.getCompiledRuleId(f.repository.$self,n,f.repository);}else c=e.getCompiledRuleId(a,n,r);if(-1!==c){var y=n.getRule(c),v=!1;if((y instanceof d||y instanceof g||y instanceof m)&&y.hasMissingPatterns&&0===y.patterns.length&&(v=!0),v)continue;i.push(c);}}return {patterns:i,hasMissingPatterns:(t?t.length:0)!==i.length}},e}();t.RuleFactory=_;},function(e,t,n){"use strict";function r(e){return !!e&&!!e.match(/[\w\.:]+/)}Object.defineProperty(t,"__esModule",{value:!0}),t.createMatchers=function(e,t){for(var n,i,o,s=[],a=(o=(i=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g).exec(n=e),{next:function(){if(!o)return null;var e=o[0];return o=i.exec(n),e}}),c=a.next();null!==c;){var u=0;if(2===c.length&&":"===c.charAt(1)){switch(c.charAt(0)){case"R":u=1;break;case"L":u=-1;break;default:console.log("Unknown priority "+c+" in scope selector");}c=a.next();}var l=p();if(s.push({matcher:l,priority:u}),","!==c)break;c=a.next();}return s;function h(){if("-"===c){c=a.next();var e=h();return function(t){return !!e&&!e(t)}}if("("===c){c=a.next();var n=function(){var e=[],t=p();for(;t&&(e.push(t),"|"===c||","===c);){do{c=a.next();}while("|"===c||","===c);t=p();}return function(t){return e.some((function(e){return e(t)}))}}();return ")"===c&&(c=a.next()),n}if(r(c)){var i=[];do{i.push(c),c=a.next();}while(r(c));return function(e){return t(i,e)}}return null}function p(){for(var e=[],t=h();t;)e.push(t),t=h();return function(t){return e.every((function(e){return e(t)}))}}};},function(e,t){var n,r,i=e.exports={};function o(){throw new Error("setTimeout has not been defined")}function s(){throw new Error("clearTimeout has not been defined")}function a(e){if(n===setTimeout)return setTimeout(e,0);if((n===o||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:o;}catch(e){n=o;}try{r="function"==typeof clearTimeout?clearTimeout:s;}catch(e){r=s;}}();var c,u=[],l=!1,h=-1;function p(){l&&c&&(l=!1,c.length?u=c.concat(u):h=-1,u.length&&f());}function f(){if(!l){var e=a(p);l=!0;for(var t=u.length;t;){for(c=u,u=[];++h<t;)c&&c[h].run();h=-1,t=u.length;}c=null,l=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e);}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e);}}function d(e,t){this.fun=e,this.array=t;}function g(){}i.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];u.push(new d(e,t)),1!==u.length||l||a(f);},d.prototype.run=function(){this.fun.apply(null,this.array);},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=g,i.addListener=g,i.once=g,i.off=g,i.removeListener=g,i.removeAllListeners=g,i.emit=g,i.prependListener=g,i.prependOnceListener=g,i.listeners=function(e){return []},i.binding=function(e){throw new Error("process.binding is not supported")},i.cwd=function(){return "/"},i.chdir=function(e){throw new Error("process.chdir is not supported")},i.umask=function(){return 0};},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(9),i=n(2),o=n(10);t.parseRawGrammar=function(e,t){return void 0===t&&(t=null),null!==t&&/\.json$/.test(t)?function(e,t){if(i.DebugFlags.InDebugMode)return o.parse(e,t,!0);return JSON.parse(e)}(e,t):function(e,t){if(i.DebugFlags.InDebugMode)return r.parseWithLocation(e,t,"$vscodeTextmateLocation");return r.parse(e)}(e,t)};},function(e,t,n){"use strict";function r(e,t,n){var r=e.length,i=0,o=1,s=0;function a(t){if(null===n)i+=t;else for(;t>0;){10===e.charCodeAt(i)?(i++,o++,s=0):(i++,s++),t--;}}function c(e){null===n?i=e:a(e-i);}function u(){for(;i<r;){var t=e.charCodeAt(i);if(32!==t&&9!==t&&13!==t&&10!==t)break;a(1);}}function l(t){return e.substr(i,t.length)===t&&(a(t.length),!0)}function h(t){var n=e.indexOf(t,i);c(-1!==n?n+t.length:r);}function p(t){var n=e.indexOf(t,i);if(-1!==n){var o=e.substring(i,n);return c(n+t.length),o}o=e.substr(i);return c(r),o}r>0&&65279===e.charCodeAt(0)&&(i=1);var f=0,d=null,g=[],m=[],_=null;function y(e,t){g.push(f),m.push(d),f=e,d=t;}function v(){if(0===g.length)return b("illegal state stack");f=g.pop(),d=m.pop();}function b(t){throw new Error("Near offset "+i+": "+t+" ~~~"+e.substr(i,50)+"~~~")}var C,w,k,R=function(){if(null===_)return b("missing <key>");var e={};null!==n&&(e[n]={filename:t,line:o,char:s}),d[_]=e,_=null,y(1,e);},S=function(){if(null===_)return b("missing <key>");var e=[];d[_]=e,_=null,y(2,e);},P=function(){var e={};null!==n&&(e[n]={filename:t,line:o,char:s}),d.push(e),y(1,e);},x=function(){var e=[];d.push(e),y(2,e);};function I(){if(1!==f)return b("unexpected </dict>");v();}function A(){return 1===f||2!==f?b("unexpected </array>"):void v()}function T(e){if(1===f){if(null===_)return b("missing <key>");d[_]=e,_=null;}else 2===f?d.push(e):d=e;}function L(e){if(isNaN(e))return b("cannot parse float");if(1===f){if(null===_)return b("missing <key>");d[_]=e,_=null;}else 2===f?d.push(e):d=e;}function M(e){if(isNaN(e))return b("cannot parse integer");if(1===f){if(null===_)return b("missing <key>");d[_]=e,_=null;}else 2===f?d.push(e):d=e;}function G(e){if(1===f){if(null===_)return b("missing <key>");d[_]=e,_=null;}else 2===f?d.push(e):d=e;}function D(e){if(1===f){if(null===_)return b("missing <key>");d[_]=e,_=null;}else 2===f?d.push(e):d=e;}function N(e){if(1===f){if(null===_)return b("missing <key>");d[_]=e,_=null;}else 2===f?d.push(e):d=e;}function E(e){if(e.isClosed)return "";var t=p("</");return h(">"),t.replace(/&#([0-9]+);/g,(function(e,t){return String.fromCodePoint(parseInt(t,10))})).replace(/&#x([0-9a-f]+);/g,(function(e,t){return String.fromCodePoint(parseInt(t,16))})).replace(/&|<|>|"|'/g,(function(e){switch(e){case"&":return "&";case"<":return "<";case">":return ">";case""":return '"';case"'":return "'"}return e}))}for(;i<r&&(u(),!(i>=r));){var O=e.charCodeAt(i);if(a(1),60!==O)return b("expected <");if(i>=r)return b("unexpected end of input");var j=e.charCodeAt(i);if(63!==j)if(33!==j){if(47===j){if(a(1),u(),l("plist")){h(">");continue}if(l("dict")){h(">"),I();continue}if(l("array")){h(">"),A();continue}return b("unexpected closed tag")}var F=(w=void 0,k=void 0,w=p(">"),k=!1,47===w.charCodeAt(w.length-1)&&(k=!0,w=w.substring(0,w.length-1)),{name:w.trim(),isClosed:k});switch(F.name){case"dict":1===f?R():2===f?P():(d={},null!==n&&(d[n]={filename:t,line:o,char:s}),y(1,d)),F.isClosed&&I();continue;case"array":1===f?S():2===f?x():y(2,d=[]),F.isClosed&&A();continue;case"key":C=E(F),1!==f?b("unexpected <key>"):null!==_?b("too many <key>"):_=C;continue;case"string":T(E(F));continue;case"real":L(parseFloat(E(F)));continue;case"integer":M(parseInt(E(F),10));continue;case"date":G(new Date(E(F)));continue;case"data":D(E(F));continue;case"true":E(F),N(!0);continue;case"false":E(F),N(!1);continue}if(!/^plist/.test(F.name))return b("unexpected opened tag "+F.name)}else {if(a(1),l("--")){h("--\x3e");continue}h(">");}else a(1),h("?>");}return d}Object.defineProperty(t,"__esModule",{value:!0}),t.parseWithLocation=function(e,t,n){return r(e,t,n)},t.parse=function(e){return r(e,null,null)};},function(e,t,n){"use strict";function r(e,t){throw new Error("Near offset "+e.pos+": "+t+" ~~~"+e.source.substr(e.pos,50)+"~~~")}Object.defineProperty(t,"__esModule",{value:!0}),t.parse=function(e,t,n){var a=new i(e),c=new o,u=0,l=null,h=[],p=[];function f(){h.push(u),p.push(l);}function d(){u=h.pop(),l=p.pop();}function g(e){r(a,e);}for(;s(a,c);){if(0===u){if(null!==l&&g("too many constructs in root"),3===c.type){l={},n&&(l.$vscodeTextmateLocation=c.toLocation(t)),f(),u=1;continue}if(2===c.type){l=[],f(),u=4;continue}g("unexpected token in root");}if(2===u){if(5===c.type){d();continue}if(7===c.type){u=3;continue}g("expected , or }");}if(1===u||3===u){if(1===u&&5===c.type){d();continue}if(1===c.type){var m=c.value;if(s(a,c)&&6===c.type||g("expected colon"),s(a,c)||g("expected value"),u=2,1===c.type){l[m]=c.value;continue}if(8===c.type){l[m]=null;continue}if(9===c.type){l[m]=!0;continue}if(10===c.type){l[m]=!1;continue}if(11===c.type){l[m]=parseFloat(c.value);continue}if(2===c.type){var _=[];l[m]=_,f(),u=4,l=_;continue}if(3===c.type){var y={};n&&(y.$vscodeTextmateLocation=c.toLocation(t)),l[m]=y,f(),u=1,l=y;continue}}g("unexpected token in dict");}if(5===u){if(4===c.type){d();continue}if(7===c.type){u=6;continue}g("expected , or ]");}if(4===u||6===u){if(4===u&&4===c.type){d();continue}if(u=5,1===c.type){l.push(c.value);continue}if(8===c.type){l.push(null);continue}if(9===c.type){l.push(!0);continue}if(10===c.type){l.push(!1);continue}if(11===c.type){l.push(parseFloat(c.value));continue}if(2===c.type){_=[];l.push(_),f(),u=4,l=_;continue}if(3===c.type){y={};n&&(y.$vscodeTextmateLocation=c.toLocation(t)),l.push(y),f(),u=1,l=y;continue}g("unexpected token in array");}g("unknown state");}return 0!==p.length&&g("unclosed constructs"),l};var i=function(e){this.source=e,this.pos=0,this.len=e.length,this.line=1,this.char=0;},o=function(){function e(){this.value=null,this.type=0,this.offset=-1,this.len=-1,this.line=-1,this.char=-1;}return e.prototype.toLocation=function(e){return {filename:e,line:this.line,char:this.char}},e}();function s(e,t){t.value=null,t.type=0,t.offset=-1,t.len=-1,t.line=-1,t.char=-1;for(var n,i=e.source,o=e.pos,s=e.len,a=e.line,c=e.char;;){if(o>=s)return !1;if(32!==(n=i.charCodeAt(o))&&9!==n&&13!==n){if(10!==n)break;o++,a++,c=0;}else o++,c++;}if(t.offset=o,t.line=a,t.char=c,34===n){for(t.type=1,o++,c++;;){if(o>=s)return !1;if(n=i.charCodeAt(o),o++,c++,92!==n){if(34===n)break}else o++,c++;}t.value=i.substring(t.offset+1,o-1).replace(/\\u([0-9A-Fa-f]{4})/g,(function(e,t){return String.fromCodePoint(parseInt(t,16))})).replace(/\\(.)/g,(function(t,n){switch(n){case'"':return '"';case"\\":return "\\";case"/":return "/";case"b":return "\b";case"f":return "\f";case"n":return "\n";case"r":return "\r";case"t":return "\t";default:r(e,"invalid escape sequence");}throw new Error("unreachable")}));}else if(91===n)t.type=2,o++,c++;else if(123===n)t.type=3,o++,c++;else if(93===n)t.type=4,o++,c++;else if(125===n)t.type=5,o++,c++;else if(58===n)t.type=6,o++,c++;else if(44===n)t.type=7,o++,c++;else if(110===n){if(t.type=8,o++,c++,117!==(n=i.charCodeAt(o)))return !1;if(o++,c++,108!==(n=i.charCodeAt(o)))return !1;if(o++,c++,108!==(n=i.charCodeAt(o)))return !1;o++,c++;}else if(116===n){if(t.type=9,o++,c++,114!==(n=i.charCodeAt(o)))return !1;if(o++,c++,117!==(n=i.charCodeAt(o)))return !1;if(o++,c++,101!==(n=i.charCodeAt(o)))return !1;o++,c++;}else if(102===n){if(t.type=10,o++,c++,97!==(n=i.charCodeAt(o)))return !1;if(o++,c++,108!==(n=i.charCodeAt(o)))return !1;if(o++,c++,115!==(n=i.charCodeAt(o)))return !1;if(o++,c++,101!==(n=i.charCodeAt(o)))return !1;o++,c++;}else for(t.type=11;;){if(o>=s)return !1;if(!(46===(n=i.charCodeAt(o))||n>=48&&n<=57||101===n||69===n||45===n||43===n))break;o++,c++;}return t.len=o-t.offset,null===t.value&&(t.value=i.substr(t.offset,t.len)),e.pos=o,e.line=a,e.char=c,!0}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=function(e,t,n,r,i,o){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=i,this.background=o;};function i(e){return !!/^#[0-9a-f]{6}$/i.test(e)||(!!/^#[0-9a-f]{8}$/i.test(e)||(!!/^#[0-9a-f]{3}$/i.test(e)||!!/^#[0-9a-f]{4}$/i.test(e)))}function o(e){if(!e)return [];if(!e.settings||!Array.isArray(e.settings))return [];for(var t=e.settings,n=[],o=0,s=0,a=t.length;s<a;s++){var c=t[s];if(c.settings){var u=void 0;if("string"==typeof c.scope)u=c.scope.replace(/^[,]+/,"").replace(/[,]+$/,"").split(",");else u=Array.isArray(c.scope)?c.scope:[""];var l=-1;if("string"==typeof c.settings.fontStyle){l=0;for(var h=0,p=(g=c.settings.fontStyle.split(" ")).length;h<p;h++){switch(g[h]){case"italic":l|=1;break;case"bold":l|=2;break;case"underline":l|=4;}}}var f=null;"string"==typeof c.settings.foreground&&i(c.settings.foreground)&&(f=c.settings.foreground);var d=null;"string"==typeof c.settings.background&&i(c.settings.background)&&(d=c.settings.background);for(h=0,p=u.length;h<p;h++){var g,m=(g=u[h].trim().split(" "))[g.length-1],_=null;g.length>1&&(_=g.slice(0,g.length-1)).reverse(),n[o++]=new r(m,_,s,l,f,d);}}}return n}function s(e,t){e.sort((function(e,t){var n=u(e.scope,t.scope);return 0!==n||0!==(n=l(e.parentScopes,t.parentScopes))?n:e.index-t.index}));for(var n=0,r="#000000",i="#ffffff";e.length>=1&&""===e[0].scope;){var o=e.shift();-1!==o.fontStyle&&(n=o.fontStyle),null!==o.foreground&&(r=o.foreground),null!==o.background&&(i=o.background);}for(var s=new a(t),f=new h(0,null,n,s.getId(r),s.getId(i)),d=new p(new h(0,null,-1,0,0),[]),g=0,m=e.length;g<m;g++){var _=e[g];d.insert(0,_.scope,_.parentScopes,_.fontStyle,s.getId(_.foreground),s.getId(_.background));}return new c(s,f,d)}t.ParsedThemeRule=r,t.parseTheme=o;var a=function(){function e(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(var t=0,n=e.length;t<n;t++)this._color2id[e[t]]=t,this._id2color[t]=e[t];}else this._isFrozen=!1;}return e.prototype.getId=function(e){if(null===e)return 0;e=e.toUpperCase();var t=this._color2id[e];if(t)return t;if(this._isFrozen)throw new Error("Missing color in color map - "+e);return t=++this._lastColorId,this._color2id[e]=t,this._id2color[t]=e,t},e.prototype.getColorMap=function(){return this._id2color.slice(0)},e}();t.ColorMap=a;var c=function(){function e(e,t,n){this._colorMap=e,this._root=n,this._defaults=t,this._cache={};}return e.createFromRawTheme=function(e,t){return this.createFromParsedTheme(o(e),t)},e.createFromParsedTheme=function(e,t){return s(e,t)},e.prototype.getColorMap=function(){return this._colorMap.getColorMap()},e.prototype.getDefaults=function(){return this._defaults},e.prototype.match=function(e){return this._cache.hasOwnProperty(e)||(this._cache[e]=this._root.match(e)),this._cache[e]},e}();function u(e,t){return e<t?-1:e>t?1:0}function l(e,t){if(null===e&&null===t)return 0;if(!e)return -1;if(!t)return 1;var n=e.length,r=t.length;if(n===r){for(var i=0;i<n;i++){var o=u(e[i],t[i]);if(0!==o)return o}return 0}return n-r}t.Theme=c,t.strcmp=u,t.strArrCmp=l;var h=function(){function e(e,t,n,r,i){this.scopeDepth=e,this.parentScopes=t,this.fontStyle=n,this.foreground=r,this.background=i;}return e.prototype.clone=function(){return new e(this.scopeDepth,this.parentScopes,this.fontStyle,this.foreground,this.background)},e.cloneArr=function(e){for(var t=[],n=0,r=e.length;n<r;n++)t[n]=e[n].clone();return t},e.prototype.acceptOverwrite=function(e,t,n,r){this.scopeDepth>e?console.log("how did this happen?"):this.scopeDepth=e,-1!==t&&(this.fontStyle=t),0!==n&&(this.foreground=n),0!==r&&(this.background=r);},e}();t.ThemeTrieElementRule=h;var p=function(){function e(e,t,n){void 0===t&&(t=[]),void 0===n&&(n={}),this._mainRule=e,this._rulesWithParentScopes=t,this._children=n;}return e._sortBySpecificity=function(e){return 1===e.length||e.sort(this._cmpBySpecificity),e},e._cmpBySpecificity=function(e,t){if(e.scopeDepth===t.scopeDepth){var n=e.parentScopes,r=t.parentScopes,i=null===n?0:n.length,o=null===r?0:r.length;if(i===o)for(var s=0;s<i;s++){var a=n[s].length,c=r[s].length;if(a!==c)return c-a}return o-i}return t.scopeDepth-e.scopeDepth},e.prototype.match=function(t){if(""===t)return e._sortBySpecificity([].concat(this._mainRule).concat(this._rulesWithParentScopes));var n,r,i=t.indexOf(".");return -1===i?(n=t,r=""):(n=t.substring(0,i),r=t.substring(i+1)),this._children.hasOwnProperty(n)?this._children[n].match(r):e._sortBySpecificity([].concat(this._mainRule).concat(this._rulesWithParentScopes))},e.prototype.insert=function(t,n,r,i,o,s){if(""!==n){var a,c,u,l=n.indexOf(".");-1===l?(a=n,c=""):(a=n.substring(0,l),c=n.substring(l+1)),this._children.hasOwnProperty(a)?u=this._children[a]:(u=new e(this._mainRule.clone(),h.cloneArr(this._rulesWithParentScopes)),this._children[a]=u),u.insert(t+1,c,r,i,o,s);}else this._doInsertHere(t,r,i,o,s);},e.prototype._doInsertHere=function(e,t,n,r,i){if(null!==t){for(var o=0,s=this._rulesWithParentScopes.length;o<s;o++){var a=this._rulesWithParentScopes[o];if(0===l(a.parentScopes,t))return void a.acceptOverwrite(e,n,r,i)}-1===n&&(n=this._mainRule.fontStyle),0===r&&(r=this._mainRule.foreground),0===i&&(i=this._mainRule.background),this._rulesWithParentScopes.push(new h(e,t,n,r,i));}else this._mainRule.acceptOverwrite(e,n,r,i);},e}();t.ThemeTrieElement=p;}])}));
|
|
48
|
-
|
|
49
|
-
} (main$1, main$1.exports));
|
|
50
|
-
|
|
51
|
-
var main = /*@__PURE__*/getDefaultExportFromCjs(main$1.exports);
|
|
52
|
-
|
|
53
|
-
const themes = [
|
|
54
|
-
'css-variables',
|
|
55
|
-
'dark-plus',
|
|
56
|
-
'dracula-soft',
|
|
57
|
-
'dracula',
|
|
58
|
-
'github-dark-dimmed',
|
|
59
|
-
'github-dark',
|
|
60
|
-
'github-light',
|
|
61
|
-
'light-plus',
|
|
62
|
-
'material-darker',
|
|
63
|
-
'material-default',
|
|
64
|
-
'material-lighter',
|
|
65
|
-
'material-ocean',
|
|
66
|
-
'material-palenight',
|
|
67
|
-
'min-dark',
|
|
68
|
-
'min-light',
|
|
69
|
-
'monokai',
|
|
70
|
-
'nord',
|
|
71
|
-
'one-dark-pro',
|
|
72
|
-
'poimandres',
|
|
73
|
-
'rose-pine-dawn',
|
|
74
|
-
'rose-pine-moon',
|
|
75
|
-
'rose-pine',
|
|
76
|
-
'slack-dark',
|
|
77
|
-
'slack-ochin',
|
|
78
|
-
'solarized-dark',
|
|
79
|
-
'solarized-light',
|
|
80
|
-
'vitesse-dark',
|
|
81
|
-
'vitesse-light'
|
|
82
|
-
];
|
|
83
|
-
|
|
84
|
-
const languages = [
|
|
85
|
-
{
|
|
86
|
-
id: 'abap',
|
|
87
|
-
scopeName: 'source.abap',
|
|
88
|
-
path: 'abap.tmLanguage.json',
|
|
89
|
-
samplePath: 'abap.sample'
|
|
90
|
-
},
|
|
91
|
-
{
|
|
92
|
-
id: 'actionscript-3',
|
|
93
|
-
scopeName: 'source.actionscript.3',
|
|
94
|
-
path: 'actionscript-3.tmLanguage.json',
|
|
95
|
-
samplePath: 'actionscript-3.sample'
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
id: 'ada',
|
|
99
|
-
scopeName: 'source.ada',
|
|
100
|
-
path: 'ada.tmLanguage.json',
|
|
101
|
-
samplePath: 'ada.sample'
|
|
102
|
-
},
|
|
103
|
-
{
|
|
104
|
-
id: 'apache',
|
|
105
|
-
scopeName: 'source.apacheconf',
|
|
106
|
-
path: 'apache.tmLanguage.json'
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
id: 'apex',
|
|
110
|
-
scopeName: 'source.apex',
|
|
111
|
-
path: 'apex.tmLanguage.json',
|
|
112
|
-
samplePath: 'apex.sample'
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
id: 'apl',
|
|
116
|
-
scopeName: 'source.apl',
|
|
117
|
-
path: 'apl.tmLanguage.json',
|
|
118
|
-
embeddedLangs: ['html', 'xml', 'css', 'javascript', 'json']
|
|
119
|
-
},
|
|
120
|
-
{
|
|
121
|
-
id: 'applescript',
|
|
122
|
-
scopeName: 'source.applescript',
|
|
123
|
-
path: 'applescript.tmLanguage.json',
|
|
124
|
-
samplePath: 'applescript.sample'
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
id: 'asm',
|
|
128
|
-
scopeName: 'source.asm.x86_64',
|
|
129
|
-
path: 'asm.tmLanguage.json',
|
|
130
|
-
samplePath: 'asm.sample'
|
|
131
|
-
},
|
|
132
|
-
{
|
|
133
|
-
id: 'astro',
|
|
134
|
-
scopeName: 'text.html.astro',
|
|
135
|
-
path: 'astro.tmLanguage.json',
|
|
136
|
-
samplePath: 'astro.sample',
|
|
137
|
-
embeddedLangs: ['css', 'javascript', 'less', 'sass', 'scss', 'stylus', 'typescript', 'tsx']
|
|
138
|
-
},
|
|
139
|
-
{
|
|
140
|
-
id: 'awk',
|
|
141
|
-
scopeName: 'source.awk',
|
|
142
|
-
path: 'awk.tmLanguage.json',
|
|
143
|
-
samplePath: 'awk.sample'
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
id: 'ballerina',
|
|
147
|
-
scopeName: 'source.ballerina',
|
|
148
|
-
path: 'ballerina.tmLanguage.json',
|
|
149
|
-
samplePath: 'ballerina.sample'
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
id: 'bat',
|
|
153
|
-
scopeName: 'source.batchfile',
|
|
154
|
-
path: 'bat.tmLanguage.json',
|
|
155
|
-
samplePath: 'bat.sample',
|
|
156
|
-
aliases: ['batch']
|
|
157
|
-
},
|
|
158
|
-
{
|
|
159
|
-
id: 'berry',
|
|
160
|
-
scopeName: 'source.berry',
|
|
161
|
-
path: 'berry.tmLanguage.json',
|
|
162
|
-
samplePath: 'berry.sample',
|
|
163
|
-
aliases: ['be']
|
|
164
|
-
},
|
|
165
|
-
{
|
|
166
|
-
id: 'bibtex',
|
|
167
|
-
scopeName: 'text.bibtex',
|
|
168
|
-
path: 'bibtex.tmLanguage.json'
|
|
169
|
-
},
|
|
170
|
-
{
|
|
171
|
-
id: 'bicep',
|
|
172
|
-
scopeName: 'source.bicep',
|
|
173
|
-
path: 'bicep.tmLanguage.json',
|
|
174
|
-
samplePath: 'bicep.sample'
|
|
175
|
-
},
|
|
176
|
-
{
|
|
177
|
-
id: 'c',
|
|
178
|
-
scopeName: 'source.c',
|
|
179
|
-
path: 'c.tmLanguage.json',
|
|
180
|
-
samplePath: 'c.sample'
|
|
181
|
-
},
|
|
182
|
-
{
|
|
183
|
-
id: 'clojure',
|
|
184
|
-
scopeName: 'source.clojure',
|
|
185
|
-
path: 'clojure.tmLanguage.json',
|
|
186
|
-
samplePath: 'clojure.sample',
|
|
187
|
-
aliases: ['clj']
|
|
188
|
-
},
|
|
189
|
-
{
|
|
190
|
-
id: 'cobol',
|
|
191
|
-
scopeName: 'source.cobol',
|
|
192
|
-
path: 'cobol.tmLanguage.json',
|
|
193
|
-
samplePath: 'cobol.sample',
|
|
194
|
-
embeddedLangs: ['sql', 'html', 'java']
|
|
195
|
-
},
|
|
196
|
-
{
|
|
197
|
-
id: 'codeql',
|
|
198
|
-
scopeName: 'source.ql',
|
|
199
|
-
path: 'codeql.tmLanguage.json',
|
|
200
|
-
samplePath: 'codeql.sample',
|
|
201
|
-
aliases: ['ql']
|
|
202
|
-
},
|
|
203
|
-
{
|
|
204
|
-
id: 'coffee',
|
|
205
|
-
scopeName: 'source.coffee',
|
|
206
|
-
path: 'coffee.tmLanguage.json',
|
|
207
|
-
samplePath: 'coffee.sample',
|
|
208
|
-
embeddedLangs: ['javascript']
|
|
209
|
-
},
|
|
210
|
-
{
|
|
211
|
-
id: 'cpp',
|
|
212
|
-
scopeName: 'source.cpp',
|
|
213
|
-
path: 'cpp.tmLanguage.json',
|
|
214
|
-
samplePath: 'cpp.sample',
|
|
215
|
-
embeddedLangs: ['sql']
|
|
216
|
-
},
|
|
217
|
-
{
|
|
218
|
-
id: 'crystal',
|
|
219
|
-
scopeName: 'source.crystal',
|
|
220
|
-
path: 'crystal.tmLanguage.json',
|
|
221
|
-
samplePath: 'crystal.sample',
|
|
222
|
-
embeddedLangs: ['html', 'sql', 'css', 'c', 'javascript', 'shellscript']
|
|
223
|
-
},
|
|
224
|
-
{
|
|
225
|
-
id: 'csharp',
|
|
226
|
-
scopeName: 'source.cs',
|
|
227
|
-
path: 'csharp.tmLanguage.json',
|
|
228
|
-
samplePath: 'csharp.sample',
|
|
229
|
-
aliases: ['c#']
|
|
230
|
-
},
|
|
231
|
-
{
|
|
232
|
-
id: 'css',
|
|
233
|
-
scopeName: 'source.css',
|
|
234
|
-
path: 'css.tmLanguage.json',
|
|
235
|
-
samplePath: 'css.sample'
|
|
236
|
-
},
|
|
237
|
-
{
|
|
238
|
-
id: 'cue',
|
|
239
|
-
scopeName: 'source.cue',
|
|
240
|
-
path: 'cue.tmLanguage.json',
|
|
241
|
-
samplePath: 'cue.sample'
|
|
242
|
-
},
|
|
243
|
-
{
|
|
244
|
-
id: 'd',
|
|
245
|
-
scopeName: 'source.d',
|
|
246
|
-
path: 'd.tmLanguage.json',
|
|
247
|
-
samplePath: 'd.sample'
|
|
248
|
-
},
|
|
249
|
-
{
|
|
250
|
-
id: 'dart',
|
|
251
|
-
scopeName: 'source.dart',
|
|
252
|
-
path: 'dart.tmLanguage.json',
|
|
253
|
-
samplePath: 'dart.sample'
|
|
254
|
-
},
|
|
255
|
-
{
|
|
256
|
-
id: 'diff',
|
|
257
|
-
scopeName: 'source.diff',
|
|
258
|
-
path: 'diff.tmLanguage.json',
|
|
259
|
-
samplePath: 'diff.sample'
|
|
260
|
-
},
|
|
261
|
-
{
|
|
262
|
-
id: 'docker',
|
|
263
|
-
scopeName: 'source.dockerfile',
|
|
264
|
-
path: 'docker.tmLanguage.json',
|
|
265
|
-
samplePath: 'docker.sample'
|
|
266
|
-
},
|
|
267
|
-
{
|
|
268
|
-
id: 'dream-maker',
|
|
269
|
-
scopeName: 'source.dm',
|
|
270
|
-
path: 'dream-maker.tmLanguage.json'
|
|
271
|
-
},
|
|
272
|
-
{
|
|
273
|
-
id: 'elixir',
|
|
274
|
-
scopeName: 'source.elixir',
|
|
275
|
-
path: 'elixir.tmLanguage.json',
|
|
276
|
-
samplePath: 'elixir.sample',
|
|
277
|
-
embeddedLangs: ['html']
|
|
278
|
-
},
|
|
279
|
-
{
|
|
280
|
-
id: 'elm',
|
|
281
|
-
scopeName: 'source.elm',
|
|
282
|
-
path: 'elm.tmLanguage.json',
|
|
283
|
-
samplePath: 'elm.sample'
|
|
284
|
-
},
|
|
285
|
-
{
|
|
286
|
-
id: 'erb',
|
|
287
|
-
scopeName: 'text.html.erb',
|
|
288
|
-
path: 'erb.tmLanguage.json',
|
|
289
|
-
samplePath: 'erb.sample',
|
|
290
|
-
embeddedLangs: ['html', 'ruby']
|
|
291
|
-
},
|
|
292
|
-
{
|
|
293
|
-
id: 'erlang',
|
|
294
|
-
scopeName: 'source.erlang',
|
|
295
|
-
path: 'erlang.tmLanguage.json',
|
|
296
|
-
samplePath: 'erlang.sample'
|
|
297
|
-
},
|
|
298
|
-
{
|
|
299
|
-
id: 'fish',
|
|
300
|
-
scopeName: 'source.fish',
|
|
301
|
-
path: 'fish.tmLanguage.json',
|
|
302
|
-
samplePath: 'fish.sample'
|
|
303
|
-
},
|
|
304
|
-
{
|
|
305
|
-
id: 'fsharp',
|
|
306
|
-
scopeName: 'source.fsharp',
|
|
307
|
-
path: 'fsharp.tmLanguage.json',
|
|
308
|
-
samplePath: 'fsharp.sample',
|
|
309
|
-
aliases: ['f#'],
|
|
310
|
-
embeddedLangs: ['markdown']
|
|
311
|
-
},
|
|
312
|
-
{
|
|
313
|
-
id: 'gherkin',
|
|
314
|
-
scopeName: 'text.gherkin.feature',
|
|
315
|
-
path: 'gherkin.tmLanguage.json'
|
|
316
|
-
},
|
|
317
|
-
{
|
|
318
|
-
id: 'git-commit',
|
|
319
|
-
scopeName: 'text.git-commit',
|
|
320
|
-
path: 'git-commit.tmLanguage.json',
|
|
321
|
-
embeddedLangs: ['diff']
|
|
322
|
-
},
|
|
323
|
-
{
|
|
324
|
-
id: 'git-rebase',
|
|
325
|
-
scopeName: 'text.git-rebase',
|
|
326
|
-
path: 'git-rebase.tmLanguage.json',
|
|
327
|
-
embeddedLangs: ['shellscript']
|
|
328
|
-
},
|
|
329
|
-
{
|
|
330
|
-
id: 'gnuplot',
|
|
331
|
-
scopeName: 'source.gnuplot',
|
|
332
|
-
path: 'gnuplot.tmLanguage.json'
|
|
333
|
-
},
|
|
334
|
-
{
|
|
335
|
-
id: 'go',
|
|
336
|
-
scopeName: 'source.go',
|
|
337
|
-
path: 'go.tmLanguage.json',
|
|
338
|
-
samplePath: 'go.sample'
|
|
339
|
-
},
|
|
340
|
-
{
|
|
341
|
-
id: 'graphql',
|
|
342
|
-
scopeName: 'source.graphql',
|
|
343
|
-
path: 'graphql.tmLanguage.json',
|
|
344
|
-
embeddedLangs: ['javascript', 'typescript', 'jsx', 'tsx']
|
|
345
|
-
},
|
|
346
|
-
{
|
|
347
|
-
id: 'groovy',
|
|
348
|
-
scopeName: 'source.groovy',
|
|
349
|
-
path: 'groovy.tmLanguage.json'
|
|
350
|
-
},
|
|
351
|
-
{
|
|
352
|
-
id: 'hack',
|
|
353
|
-
scopeName: 'source.hack',
|
|
354
|
-
path: 'hack.tmLanguage.json',
|
|
355
|
-
embeddedLangs: ['html', 'sql']
|
|
356
|
-
},
|
|
357
|
-
{
|
|
358
|
-
id: 'haml',
|
|
359
|
-
scopeName: 'text.haml',
|
|
360
|
-
path: 'haml.tmLanguage.json',
|
|
361
|
-
embeddedLangs: ['ruby', 'javascript', 'sass', 'coffee', 'markdown', 'css']
|
|
362
|
-
},
|
|
363
|
-
{
|
|
364
|
-
id: 'handlebars',
|
|
365
|
-
scopeName: 'text.html.handlebars',
|
|
366
|
-
path: 'handlebars.tmLanguage.json',
|
|
367
|
-
aliases: ['hbs'],
|
|
368
|
-
embeddedLangs: ['html', 'css', 'javascript', 'yaml']
|
|
369
|
-
},
|
|
370
|
-
{
|
|
371
|
-
id: 'haskell',
|
|
372
|
-
scopeName: 'source.haskell',
|
|
373
|
-
path: 'haskell.tmLanguage.json'
|
|
374
|
-
},
|
|
375
|
-
{
|
|
376
|
-
id: 'hcl',
|
|
377
|
-
scopeName: 'source.hcl',
|
|
378
|
-
path: 'hcl.tmLanguage.json'
|
|
379
|
-
},
|
|
380
|
-
{
|
|
381
|
-
id: 'hlsl',
|
|
382
|
-
scopeName: 'source.hlsl',
|
|
383
|
-
path: 'hlsl.tmLanguage.json'
|
|
384
|
-
},
|
|
385
|
-
{
|
|
386
|
-
id: 'html',
|
|
387
|
-
scopeName: 'text.html.basic',
|
|
388
|
-
path: 'html.tmLanguage.json',
|
|
389
|
-
samplePath: 'html.sample',
|
|
390
|
-
embeddedLangs: ['javascript', 'css']
|
|
391
|
-
},
|
|
392
|
-
{
|
|
393
|
-
id: 'ini',
|
|
394
|
-
scopeName: 'source.ini',
|
|
395
|
-
path: 'ini.tmLanguage.json'
|
|
396
|
-
},
|
|
397
|
-
{
|
|
398
|
-
id: 'java',
|
|
399
|
-
scopeName: 'source.java',
|
|
400
|
-
path: 'java.tmLanguage.json',
|
|
401
|
-
samplePath: 'java.sample'
|
|
402
|
-
},
|
|
403
|
-
{
|
|
404
|
-
id: 'javascript',
|
|
405
|
-
scopeName: 'source.js',
|
|
406
|
-
path: 'javascript.tmLanguage.json',
|
|
407
|
-
samplePath: 'javascript.sample',
|
|
408
|
-
aliases: ['js']
|
|
409
|
-
},
|
|
410
|
-
{
|
|
411
|
-
id: 'jinja-html',
|
|
412
|
-
scopeName: 'text.html.jinja',
|
|
413
|
-
path: 'jinja-html.tmLanguage.json',
|
|
414
|
-
embeddedLangs: ['html']
|
|
415
|
-
},
|
|
416
|
-
{
|
|
417
|
-
id: 'json',
|
|
418
|
-
scopeName: 'source.json',
|
|
419
|
-
path: 'json.tmLanguage.json'
|
|
420
|
-
},
|
|
421
|
-
{
|
|
422
|
-
id: 'jsonc',
|
|
423
|
-
scopeName: 'source.json.comments',
|
|
424
|
-
path: 'jsonc.tmLanguage.json'
|
|
425
|
-
},
|
|
426
|
-
{
|
|
427
|
-
id: 'jsonnet',
|
|
428
|
-
scopeName: 'source.jsonnet',
|
|
429
|
-
path: 'jsonnet.tmLanguage.json'
|
|
430
|
-
},
|
|
431
|
-
{
|
|
432
|
-
id: 'jssm',
|
|
433
|
-
scopeName: 'source.jssm',
|
|
434
|
-
path: 'jssm.tmLanguage.json',
|
|
435
|
-
samplePath: 'jssm.sample',
|
|
436
|
-
aliases: ['fsl']
|
|
437
|
-
},
|
|
438
|
-
{
|
|
439
|
-
id: 'jsx',
|
|
440
|
-
scopeName: 'source.js.jsx',
|
|
441
|
-
path: 'jsx.tmLanguage.json'
|
|
442
|
-
},
|
|
443
|
-
{
|
|
444
|
-
id: 'julia',
|
|
445
|
-
scopeName: 'source.julia',
|
|
446
|
-
path: 'julia.tmLanguage.json',
|
|
447
|
-
embeddedLangs: ['cpp', 'python', 'javascript', 'r', 'sql']
|
|
448
|
-
},
|
|
449
|
-
{
|
|
450
|
-
id: 'jupyter',
|
|
451
|
-
scopeName: 'source.jupyter',
|
|
452
|
-
path: 'jupyter.tmLanguage.json',
|
|
453
|
-
embeddedLangs: ['json']
|
|
454
|
-
},
|
|
455
|
-
{
|
|
456
|
-
id: 'kotlin',
|
|
457
|
-
scopeName: 'source.kotlin',
|
|
458
|
-
path: 'kotlin.tmLanguage.json'
|
|
459
|
-
},
|
|
460
|
-
{
|
|
461
|
-
id: 'latex',
|
|
462
|
-
scopeName: 'text.tex.latex',
|
|
463
|
-
path: 'latex.tmLanguage.json',
|
|
464
|
-
embeddedLangs: ['tex', 'css', 'html', 'java', 'javascript', 'typescript', 'lua', 'python', 'julia', 'ruby', 'xml', 'yaml', 'cpp', 'haskell', 'scala', 'gnuplot']
|
|
465
|
-
},
|
|
466
|
-
{
|
|
467
|
-
id: 'less',
|
|
468
|
-
scopeName: 'source.css.less',
|
|
469
|
-
path: 'less.tmLanguage.json',
|
|
470
|
-
embeddedLangs: ['css']
|
|
471
|
-
},
|
|
472
|
-
{
|
|
473
|
-
id: 'lisp',
|
|
474
|
-
scopeName: 'source.lisp',
|
|
475
|
-
path: 'lisp.tmLanguage.json'
|
|
476
|
-
},
|
|
477
|
-
{
|
|
478
|
-
id: 'logo',
|
|
479
|
-
scopeName: 'source.logo',
|
|
480
|
-
path: 'logo.tmLanguage.json'
|
|
481
|
-
},
|
|
482
|
-
{
|
|
483
|
-
id: 'lua',
|
|
484
|
-
scopeName: 'source.lua',
|
|
485
|
-
path: 'lua.tmLanguage.json',
|
|
486
|
-
embeddedLangs: ['c']
|
|
487
|
-
},
|
|
488
|
-
{
|
|
489
|
-
id: 'make',
|
|
490
|
-
scopeName: 'source.makefile',
|
|
491
|
-
path: 'make.tmLanguage.json',
|
|
492
|
-
aliases: ['makefile']
|
|
493
|
-
},
|
|
494
|
-
{
|
|
495
|
-
id: 'markdown',
|
|
496
|
-
scopeName: 'text.html.markdown',
|
|
497
|
-
path: 'markdown.tmLanguage.json',
|
|
498
|
-
aliases: ['md'],
|
|
499
|
-
embeddedLangs: ['css', 'html', 'ini', 'java', 'lua', 'make', 'perl', 'r', 'ruby', 'php', 'sql', 'vb', 'xml', 'xsl', 'yaml', 'bat', 'clojure', 'coffee', 'c', 'cpp', 'diff', 'docker', 'git-commit', 'git-rebase', 'go', 'groovy', 'pug', 'javascript', 'json', 'jsonc', 'less', 'objective-c', 'swift', 'scss', 'raku', 'powershell', 'python', 'rust', 'scala', 'shellscript', 'typescript', 'tsx', 'csharp', 'fsharp', 'dart', 'handlebars', 'erlang', 'elixir', 'latex', 'bibtex']
|
|
500
|
-
},
|
|
501
|
-
{
|
|
502
|
-
id: 'marko',
|
|
503
|
-
scopeName: 'text.marko',
|
|
504
|
-
path: 'marko.tmLanguage.json',
|
|
505
|
-
samplePath: 'marko.sample',
|
|
506
|
-
embeddedLangs: ['css', 'less', 'scss', 'javascript']
|
|
507
|
-
},
|
|
508
|
-
{
|
|
509
|
-
id: 'matlab',
|
|
510
|
-
scopeName: 'source.matlab',
|
|
511
|
-
path: 'matlab.tmLanguage.json'
|
|
512
|
-
},
|
|
513
|
-
{
|
|
514
|
-
id: 'mdx',
|
|
515
|
-
scopeName: 'text.html.markdown.jsx',
|
|
516
|
-
path: 'mdx.tmLanguage.json',
|
|
517
|
-
embeddedLangs: ['jsx', 'markdown']
|
|
518
|
-
},
|
|
519
|
-
{
|
|
520
|
-
id: 'nginx',
|
|
521
|
-
scopeName: 'source.nginx',
|
|
522
|
-
path: 'nginx.tmLanguage.json',
|
|
523
|
-
embeddedLangs: ['lua']
|
|
524
|
-
},
|
|
525
|
-
{
|
|
526
|
-
id: 'nim',
|
|
527
|
-
scopeName: 'source.nim',
|
|
528
|
-
path: 'nim.tmLanguage.json',
|
|
529
|
-
embeddedLangs: ['c', 'html', 'xml', 'javascript', 'css', 'markdown']
|
|
530
|
-
},
|
|
531
|
-
{
|
|
532
|
-
id: 'nix',
|
|
533
|
-
scopeName: 'source.nix',
|
|
534
|
-
path: 'nix.tmLanguage.json'
|
|
535
|
-
},
|
|
536
|
-
{
|
|
537
|
-
id: 'objective-c',
|
|
538
|
-
scopeName: 'source.objc',
|
|
539
|
-
path: 'objective-c.tmLanguage.json',
|
|
540
|
-
aliases: ['objc']
|
|
541
|
-
},
|
|
542
|
-
{
|
|
543
|
-
id: 'objective-cpp',
|
|
544
|
-
scopeName: 'source.objcpp',
|
|
545
|
-
path: 'objective-cpp.tmLanguage.json'
|
|
546
|
-
},
|
|
547
|
-
{
|
|
548
|
-
id: 'ocaml',
|
|
549
|
-
scopeName: 'source.ocaml',
|
|
550
|
-
path: 'ocaml.tmLanguage.json'
|
|
551
|
-
},
|
|
552
|
-
{
|
|
553
|
-
id: 'pascal',
|
|
554
|
-
scopeName: 'source.pascal',
|
|
555
|
-
path: 'pascal.tmLanguage.json'
|
|
556
|
-
},
|
|
557
|
-
{
|
|
558
|
-
id: 'perl',
|
|
559
|
-
scopeName: 'source.perl',
|
|
560
|
-
path: 'perl.tmLanguage.json',
|
|
561
|
-
embeddedLangs: ['html', 'xml', 'css', 'javascript', 'sql']
|
|
562
|
-
},
|
|
563
|
-
{
|
|
564
|
-
id: 'php',
|
|
565
|
-
scopeName: 'source.php',
|
|
566
|
-
path: 'php.tmLanguage.json',
|
|
567
|
-
embeddedLangs: ['html', 'xml', 'sql', 'javascript', 'json', 'css']
|
|
568
|
-
},
|
|
569
|
-
{
|
|
570
|
-
id: 'plsql',
|
|
571
|
-
scopeName: 'source.plsql.oracle',
|
|
572
|
-
path: 'plsql.tmLanguage.json'
|
|
573
|
-
},
|
|
574
|
-
{
|
|
575
|
-
id: 'postcss',
|
|
576
|
-
scopeName: 'source.css.postcss',
|
|
577
|
-
path: 'postcss.tmLanguage.json'
|
|
578
|
-
},
|
|
579
|
-
{
|
|
580
|
-
id: 'powershell',
|
|
581
|
-
scopeName: 'source.powershell',
|
|
582
|
-
path: 'powershell.tmLanguage.json',
|
|
583
|
-
aliases: ['ps', 'ps1']
|
|
584
|
-
},
|
|
585
|
-
{
|
|
586
|
-
id: 'prisma',
|
|
587
|
-
scopeName: 'source.prisma',
|
|
588
|
-
path: 'prisma.tmLanguage.json',
|
|
589
|
-
samplePath: 'prisma.sample'
|
|
590
|
-
},
|
|
591
|
-
{
|
|
592
|
-
id: 'prolog',
|
|
593
|
-
scopeName: 'source.prolog',
|
|
594
|
-
path: 'prolog.tmLanguage.json'
|
|
595
|
-
},
|
|
596
|
-
{
|
|
597
|
-
id: 'pug',
|
|
598
|
-
scopeName: 'text.pug',
|
|
599
|
-
path: 'pug.tmLanguage.json',
|
|
600
|
-
aliases: ['jade'],
|
|
601
|
-
embeddedLangs: ['javascript', 'css', 'sass', 'stylus', 'coffee', 'html']
|
|
602
|
-
},
|
|
603
|
-
{
|
|
604
|
-
id: 'puppet',
|
|
605
|
-
scopeName: 'source.puppet',
|
|
606
|
-
path: 'puppet.tmLanguage.json'
|
|
607
|
-
},
|
|
608
|
-
{
|
|
609
|
-
id: 'purescript',
|
|
610
|
-
scopeName: 'source.purescript',
|
|
611
|
-
path: 'purescript.tmLanguage.json'
|
|
612
|
-
},
|
|
613
|
-
{
|
|
614
|
-
id: 'python',
|
|
615
|
-
scopeName: 'source.python',
|
|
616
|
-
path: 'python.tmLanguage.json',
|
|
617
|
-
samplePath: 'python.sample',
|
|
618
|
-
aliases: ['py']
|
|
619
|
-
},
|
|
620
|
-
{
|
|
621
|
-
id: 'r',
|
|
622
|
-
scopeName: 'source.r',
|
|
623
|
-
path: 'r.tmLanguage.json'
|
|
624
|
-
},
|
|
625
|
-
{
|
|
626
|
-
id: 'raku',
|
|
627
|
-
scopeName: 'source.perl.6',
|
|
628
|
-
path: 'raku.tmLanguage.json',
|
|
629
|
-
aliases: ['perl6']
|
|
630
|
-
},
|
|
631
|
-
{
|
|
632
|
-
id: 'razor',
|
|
633
|
-
scopeName: 'text.aspnetcorerazor',
|
|
634
|
-
path: 'razor.tmLanguage.json',
|
|
635
|
-
embeddedLangs: ['html', 'csharp']
|
|
636
|
-
},
|
|
637
|
-
{
|
|
638
|
-
id: 'rel',
|
|
639
|
-
scopeName: 'source.rel',
|
|
640
|
-
path: 'rel.tmLanguage.json',
|
|
641
|
-
samplePath: 'rel.sample'
|
|
642
|
-
},
|
|
643
|
-
{
|
|
644
|
-
id: 'riscv',
|
|
645
|
-
scopeName: 'source.riscv',
|
|
646
|
-
path: 'riscv.tmLanguage.json'
|
|
647
|
-
},
|
|
648
|
-
{
|
|
649
|
-
id: 'ruby',
|
|
650
|
-
scopeName: 'source.ruby',
|
|
651
|
-
path: 'ruby.tmLanguage.json',
|
|
652
|
-
samplePath: 'ruby.sample',
|
|
653
|
-
aliases: ['rb'],
|
|
654
|
-
embeddedLangs: ['html', 'xml', 'sql', 'css', 'c', 'javascript', 'shellscript', 'lua']
|
|
655
|
-
},
|
|
656
|
-
{
|
|
657
|
-
id: 'rust',
|
|
658
|
-
scopeName: 'source.rust',
|
|
659
|
-
path: 'rust.tmLanguage.json',
|
|
660
|
-
aliases: ['rs']
|
|
661
|
-
},
|
|
662
|
-
{
|
|
663
|
-
id: 'sas',
|
|
664
|
-
scopeName: 'source.sas',
|
|
665
|
-
path: 'sas.tmLanguage.json',
|
|
666
|
-
embeddedLangs: ['sql']
|
|
667
|
-
},
|
|
668
|
-
{
|
|
669
|
-
id: 'sass',
|
|
670
|
-
scopeName: 'source.sass',
|
|
671
|
-
path: 'sass.tmLanguage.json'
|
|
672
|
-
},
|
|
673
|
-
{
|
|
674
|
-
id: 'scala',
|
|
675
|
-
scopeName: 'source.scala',
|
|
676
|
-
path: 'scala.tmLanguage.json'
|
|
677
|
-
},
|
|
678
|
-
{
|
|
679
|
-
id: 'scheme',
|
|
680
|
-
scopeName: 'source.scheme',
|
|
681
|
-
path: 'scheme.tmLanguage.json'
|
|
682
|
-
},
|
|
683
|
-
{
|
|
684
|
-
id: 'scss',
|
|
685
|
-
scopeName: 'source.css.scss',
|
|
686
|
-
path: 'scss.tmLanguage.json',
|
|
687
|
-
embeddedLangs: ['css']
|
|
688
|
-
},
|
|
689
|
-
{
|
|
690
|
-
id: 'shaderlab',
|
|
691
|
-
scopeName: 'source.shaderlab',
|
|
692
|
-
path: 'shaderlab.tmLanguage.json',
|
|
693
|
-
aliases: ['shader'],
|
|
694
|
-
embeddedLangs: ['hlsl']
|
|
695
|
-
},
|
|
696
|
-
{
|
|
697
|
-
id: 'shellscript',
|
|
698
|
-
scopeName: 'source.shell',
|
|
699
|
-
path: 'shellscript.tmLanguage.json',
|
|
700
|
-
aliases: ['shell', 'bash', 'sh', 'zsh'],
|
|
701
|
-
embeddedLangs: ['ruby', 'python', 'applescript', 'html', 'markdown']
|
|
702
|
-
},
|
|
703
|
-
{
|
|
704
|
-
id: 'smalltalk',
|
|
705
|
-
scopeName: 'source.smalltalk',
|
|
706
|
-
path: 'smalltalk.tmLanguage.json'
|
|
707
|
-
},
|
|
708
|
-
{
|
|
709
|
-
id: 'solidity',
|
|
710
|
-
scopeName: 'source.solidity',
|
|
711
|
-
path: 'solidity.tmLanguage.json'
|
|
712
|
-
},
|
|
713
|
-
{
|
|
714
|
-
id: 'sparql',
|
|
715
|
-
scopeName: 'source.sparql',
|
|
716
|
-
path: 'sparql.tmLanguage.json',
|
|
717
|
-
samplePath: 'sparql.sample',
|
|
718
|
-
embeddedLangs: ['turtle']
|
|
719
|
-
},
|
|
720
|
-
{
|
|
721
|
-
id: 'sql',
|
|
722
|
-
scopeName: 'source.sql',
|
|
723
|
-
path: 'sql.tmLanguage.json'
|
|
724
|
-
},
|
|
725
|
-
{
|
|
726
|
-
id: 'ssh-config',
|
|
727
|
-
scopeName: 'source.ssh-config',
|
|
728
|
-
path: 'ssh-config.tmLanguage.json'
|
|
729
|
-
},
|
|
730
|
-
{
|
|
731
|
-
id: 'stata',
|
|
732
|
-
scopeName: 'source.stata',
|
|
733
|
-
path: 'stata.tmLanguage.json',
|
|
734
|
-
samplePath: 'stata.sample',
|
|
735
|
-
embeddedLangs: ['sql']
|
|
736
|
-
},
|
|
737
|
-
{
|
|
738
|
-
id: 'stylus',
|
|
739
|
-
scopeName: 'source.stylus',
|
|
740
|
-
path: 'stylus.tmLanguage.json',
|
|
741
|
-
aliases: ['styl']
|
|
742
|
-
},
|
|
743
|
-
{
|
|
744
|
-
id: 'svelte',
|
|
745
|
-
scopeName: 'source.svelte',
|
|
746
|
-
path: 'svelte.tmLanguage.json',
|
|
747
|
-
embeddedLangs: ['javascript', 'typescript', 'coffee', 'stylus', 'sass', 'css', 'scss', 'less', 'postcss', 'pug', 'markdown']
|
|
748
|
-
},
|
|
749
|
-
{
|
|
750
|
-
id: 'swift',
|
|
751
|
-
scopeName: 'source.swift',
|
|
752
|
-
path: 'swift.tmLanguage.json'
|
|
753
|
-
},
|
|
754
|
-
{
|
|
755
|
-
id: 'system-verilog',
|
|
756
|
-
scopeName: 'source.systemverilog',
|
|
757
|
-
path: 'system-verilog.tmLanguage.json'
|
|
758
|
-
},
|
|
759
|
-
{
|
|
760
|
-
id: 'tasl',
|
|
761
|
-
scopeName: 'source.tasl',
|
|
762
|
-
path: 'tasl.tmLanguage.json',
|
|
763
|
-
samplePath: 'tasl.sample'
|
|
764
|
-
},
|
|
765
|
-
{
|
|
766
|
-
id: 'tcl',
|
|
767
|
-
scopeName: 'source.tcl',
|
|
768
|
-
path: 'tcl.tmLanguage.json'
|
|
769
|
-
},
|
|
770
|
-
{
|
|
771
|
-
id: 'tex',
|
|
772
|
-
scopeName: 'text.tex',
|
|
773
|
-
path: 'tex.tmLanguage.json',
|
|
774
|
-
embeddedLangs: ['r']
|
|
775
|
-
},
|
|
776
|
-
{
|
|
777
|
-
id: 'toml',
|
|
778
|
-
scopeName: 'source.toml',
|
|
779
|
-
path: 'toml.tmLanguage.json'
|
|
780
|
-
},
|
|
781
|
-
{
|
|
782
|
-
id: 'tsx',
|
|
783
|
-
scopeName: 'source.tsx',
|
|
784
|
-
path: 'tsx.tmLanguage.json',
|
|
785
|
-
samplePath: 'tsx.sample'
|
|
786
|
-
},
|
|
787
|
-
{
|
|
788
|
-
id: 'turtle',
|
|
789
|
-
scopeName: 'source.turtle',
|
|
790
|
-
path: 'turtle.tmLanguage.json',
|
|
791
|
-
samplePath: 'turtle.sample'
|
|
792
|
-
},
|
|
793
|
-
{
|
|
794
|
-
id: 'twig',
|
|
795
|
-
scopeName: 'text.html.twig',
|
|
796
|
-
path: 'twig.tmLanguage.json',
|
|
797
|
-
embeddedLangs: ['css', 'javascript', 'php', 'python', 'ruby']
|
|
798
|
-
},
|
|
799
|
-
{
|
|
800
|
-
id: 'typescript',
|
|
801
|
-
scopeName: 'source.ts',
|
|
802
|
-
path: 'typescript.tmLanguage.json',
|
|
803
|
-
aliases: ['ts']
|
|
804
|
-
},
|
|
805
|
-
{
|
|
806
|
-
id: 'vb',
|
|
807
|
-
scopeName: 'source.asp.vb.net',
|
|
808
|
-
path: 'vb.tmLanguage.json',
|
|
809
|
-
aliases: ['cmd']
|
|
810
|
-
},
|
|
811
|
-
{
|
|
812
|
-
id: 'verilog',
|
|
813
|
-
scopeName: 'source.verilog',
|
|
814
|
-
path: 'verilog.tmLanguage.json'
|
|
815
|
-
},
|
|
816
|
-
{
|
|
817
|
-
id: 'vhdl',
|
|
818
|
-
scopeName: 'source.vhdl',
|
|
819
|
-
path: 'vhdl.tmLanguage.json'
|
|
820
|
-
},
|
|
821
|
-
{
|
|
822
|
-
id: 'viml',
|
|
823
|
-
scopeName: 'source.viml',
|
|
824
|
-
path: 'viml.tmLanguage.json',
|
|
825
|
-
aliases: ['vim', 'vimscript']
|
|
826
|
-
},
|
|
827
|
-
{
|
|
828
|
-
id: 'vue-html',
|
|
829
|
-
scopeName: 'text.html.vue-html',
|
|
830
|
-
path: 'vue-html.tmLanguage.json',
|
|
831
|
-
embeddedLangs: ['vue', 'javascript']
|
|
832
|
-
},
|
|
833
|
-
{
|
|
834
|
-
id: 'vue',
|
|
835
|
-
scopeName: 'source.vue',
|
|
836
|
-
path: 'vue.tmLanguage.json',
|
|
837
|
-
embeddedLangs: ['json', 'markdown', 'pug', 'haml', 'vue-html', 'sass', 'scss', 'less', 'stylus', 'postcss', 'css', 'typescript', 'coffee', 'javascript']
|
|
838
|
-
},
|
|
839
|
-
{
|
|
840
|
-
id: 'wasm',
|
|
841
|
-
scopeName: 'source.wat',
|
|
842
|
-
path: 'wasm.tmLanguage.json'
|
|
843
|
-
},
|
|
844
|
-
{
|
|
845
|
-
id: 'wenyan',
|
|
846
|
-
scopeName: 'source.wenyan',
|
|
847
|
-
path: 'wenyan.tmLanguage.json',
|
|
848
|
-
aliases: ['文言']
|
|
849
|
-
},
|
|
850
|
-
{
|
|
851
|
-
id: 'xml',
|
|
852
|
-
scopeName: 'text.xml',
|
|
853
|
-
path: 'xml.tmLanguage.json',
|
|
854
|
-
embeddedLangs: ['java']
|
|
855
|
-
},
|
|
856
|
-
{
|
|
857
|
-
id: 'xsl',
|
|
858
|
-
scopeName: 'text.xml.xsl',
|
|
859
|
-
path: 'xsl.tmLanguage.json',
|
|
860
|
-
embeddedLangs: ['xml']
|
|
861
|
-
},
|
|
862
|
-
{
|
|
863
|
-
id: 'yaml',
|
|
864
|
-
scopeName: 'source.yaml',
|
|
865
|
-
path: 'yaml.tmLanguage.json'
|
|
866
|
-
},
|
|
867
|
-
{
|
|
868
|
-
id: 'zenscript',
|
|
869
|
-
scopeName: 'source.zenscript',
|
|
870
|
-
path: 'zenscript.tmLanguage.json',
|
|
871
|
-
samplePath: 'zenscript.sample'
|
|
872
|
-
}
|
|
873
|
-
];
|
|
874
|
-
|
|
875
|
-
var FontStyle;
|
|
876
|
-
(function (FontStyle) {
|
|
877
|
-
FontStyle[FontStyle["NotSet"] = -1] = "NotSet";
|
|
878
|
-
FontStyle[FontStyle["None"] = 0] = "None";
|
|
879
|
-
FontStyle[FontStyle["Italic"] = 1] = "Italic";
|
|
880
|
-
FontStyle[FontStyle["Bold"] = 2] = "Bold";
|
|
881
|
-
FontStyle[FontStyle["Underline"] = 4] = "Underline";
|
|
882
|
-
})(FontStyle || (FontStyle = {}));
|
|
883
|
-
class StackElementMetadata {
|
|
884
|
-
static toBinaryStr(metadata) {
|
|
885
|
-
let r = metadata.toString(2);
|
|
886
|
-
while (r.length < 32) {
|
|
887
|
-
r = '0' + r;
|
|
888
|
-
}
|
|
889
|
-
return r;
|
|
890
|
-
}
|
|
891
|
-
static printMetadata(metadata) {
|
|
892
|
-
let languageId = StackElementMetadata.getLanguageId(metadata);
|
|
893
|
-
let tokenType = StackElementMetadata.getTokenType(metadata);
|
|
894
|
-
let fontStyle = StackElementMetadata.getFontStyle(metadata);
|
|
895
|
-
let foreground = StackElementMetadata.getForeground(metadata);
|
|
896
|
-
let background = StackElementMetadata.getBackground(metadata);
|
|
897
|
-
console.log({
|
|
898
|
-
languageId: languageId,
|
|
899
|
-
tokenType: tokenType,
|
|
900
|
-
fontStyle: fontStyle,
|
|
901
|
-
foreground: foreground,
|
|
902
|
-
background: background
|
|
903
|
-
});
|
|
904
|
-
}
|
|
905
|
-
static getLanguageId(metadata) {
|
|
906
|
-
return (metadata & 255 /* LANGUAGEID_MASK */) >>> 0 /* LANGUAGEID_OFFSET */;
|
|
907
|
-
}
|
|
908
|
-
static getTokenType(metadata) {
|
|
909
|
-
return (metadata & 1792 /* TOKEN_TYPE_MASK */) >>> 8 /* TOKEN_TYPE_OFFSET */;
|
|
910
|
-
}
|
|
911
|
-
static getFontStyle(metadata) {
|
|
912
|
-
return (metadata & 14336 /* FONT_STYLE_MASK */) >>> 11 /* FONT_STYLE_OFFSET */;
|
|
913
|
-
}
|
|
914
|
-
static getForeground(metadata) {
|
|
915
|
-
return (metadata & 8372224 /* FOREGROUND_MASK */) >>> 14 /* FOREGROUND_OFFSET */;
|
|
916
|
-
}
|
|
917
|
-
static getBackground(metadata) {
|
|
918
|
-
return (metadata & 4286578688 /* BACKGROUND_MASK */) >>> 23 /* BACKGROUND_OFFSET */;
|
|
919
|
-
}
|
|
920
|
-
static set(metadata, languageId, tokenType, fontStyle, foreground, background) {
|
|
921
|
-
let _languageId = StackElementMetadata.getLanguageId(metadata);
|
|
922
|
-
let _tokenType = StackElementMetadata.getTokenType(metadata);
|
|
923
|
-
let _fontStyle = StackElementMetadata.getFontStyle(metadata);
|
|
924
|
-
let _foreground = StackElementMetadata.getForeground(metadata);
|
|
925
|
-
let _background = StackElementMetadata.getBackground(metadata);
|
|
926
|
-
if (languageId !== 0) {
|
|
927
|
-
_languageId = languageId;
|
|
928
|
-
}
|
|
929
|
-
if (tokenType !== 0 /* Other */) {
|
|
930
|
-
_tokenType =
|
|
931
|
-
tokenType === 8 /* MetaEmbedded */ ? 0 /* Other */ : tokenType;
|
|
932
|
-
}
|
|
933
|
-
if (fontStyle !== FontStyle.NotSet) {
|
|
934
|
-
_fontStyle = fontStyle;
|
|
935
|
-
}
|
|
936
|
-
if (foreground !== 0) {
|
|
937
|
-
_foreground = foreground;
|
|
938
|
-
}
|
|
939
|
-
if (background !== 0) {
|
|
940
|
-
_background = background;
|
|
941
|
-
}
|
|
942
|
-
return (((_languageId << 0 /* LANGUAGEID_OFFSET */) |
|
|
943
|
-
(_tokenType << 8 /* TOKEN_TYPE_OFFSET */) |
|
|
944
|
-
(_fontStyle << 11 /* FONT_STYLE_OFFSET */) |
|
|
945
|
-
(_foreground << 14 /* FOREGROUND_OFFSET */) |
|
|
946
|
-
(_background << 23 /* BACKGROUND_OFFSET */)) >>>
|
|
947
|
-
0);
|
|
948
|
-
}
|
|
949
|
-
}
|
|
950
|
-
|
|
951
|
-
function trimEndSlash(str) {
|
|
952
|
-
if (str.endsWith('/') || str.endsWith('\\'))
|
|
953
|
-
return str.slice(0, -1);
|
|
954
|
-
return str;
|
|
955
|
-
}
|
|
956
|
-
function trimStartDot(str) {
|
|
957
|
-
if (str.startsWith('./'))
|
|
958
|
-
return str.slice(2);
|
|
959
|
-
return str;
|
|
960
|
-
}
|
|
961
|
-
function dirname(str) {
|
|
962
|
-
const parts = str.split(/[\/\\]/g);
|
|
963
|
-
return parts[parts.length - 2];
|
|
964
|
-
}
|
|
965
|
-
function join(...parts) {
|
|
966
|
-
return parts.map(trimEndSlash).map(trimStartDot).join('/');
|
|
967
|
-
}
|
|
968
|
-
function groupBy(elements, keyGetter) {
|
|
969
|
-
const map = new Map();
|
|
970
|
-
for (const element of elements) {
|
|
971
|
-
const key = keyGetter(element);
|
|
972
|
-
if (map.has(key)) {
|
|
973
|
-
const group = map.get(key);
|
|
974
|
-
group.push(element);
|
|
975
|
-
}
|
|
976
|
-
else {
|
|
977
|
-
map.set(key, [element]);
|
|
978
|
-
}
|
|
979
|
-
}
|
|
980
|
-
return map;
|
|
981
|
-
}
|
|
982
|
-
|
|
983
|
-
/*---------------------------------------------------------------------------------------------
|
|
984
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
985
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
986
|
-
*--------------------------------------------------------------------------------------------*/
|
|
987
|
-
/**
|
|
988
|
-
* Creates a JSON scanner on the given text.
|
|
989
|
-
* If ignoreTrivia is set, whitespaces or comments are ignored.
|
|
990
|
-
*/
|
|
991
|
-
function createScanner(text, ignoreTrivia) {
|
|
992
|
-
if (ignoreTrivia === void 0) { ignoreTrivia = false; }
|
|
993
|
-
var len = text.length;
|
|
994
|
-
var pos = 0, value = '', tokenOffset = 0, token = 16 /* Unknown */, lineNumber = 0, lineStartOffset = 0, tokenLineStartOffset = 0, prevTokenLineStartOffset = 0, scanError = 0 /* None */;
|
|
995
|
-
function scanHexDigits(count, exact) {
|
|
996
|
-
var digits = 0;
|
|
997
|
-
var value = 0;
|
|
998
|
-
while (digits < count || !exact) {
|
|
999
|
-
var ch = text.charCodeAt(pos);
|
|
1000
|
-
if (ch >= 48 /* _0 */ && ch <= 57 /* _9 */) {
|
|
1001
|
-
value = value * 16 + ch - 48 /* _0 */;
|
|
1002
|
-
}
|
|
1003
|
-
else if (ch >= 65 /* A */ && ch <= 70 /* F */) {
|
|
1004
|
-
value = value * 16 + ch - 65 /* A */ + 10;
|
|
1005
|
-
}
|
|
1006
|
-
else if (ch >= 97 /* a */ && ch <= 102 /* f */) {
|
|
1007
|
-
value = value * 16 + ch - 97 /* a */ + 10;
|
|
1008
|
-
}
|
|
1009
|
-
else {
|
|
1010
|
-
break;
|
|
1011
|
-
}
|
|
1012
|
-
pos++;
|
|
1013
|
-
digits++;
|
|
1014
|
-
}
|
|
1015
|
-
if (digits < count) {
|
|
1016
|
-
value = -1;
|
|
1017
|
-
}
|
|
1018
|
-
return value;
|
|
1019
|
-
}
|
|
1020
|
-
function setPosition(newPosition) {
|
|
1021
|
-
pos = newPosition;
|
|
1022
|
-
value = '';
|
|
1023
|
-
tokenOffset = 0;
|
|
1024
|
-
token = 16 /* Unknown */;
|
|
1025
|
-
scanError = 0 /* None */;
|
|
1026
|
-
}
|
|
1027
|
-
function scanNumber() {
|
|
1028
|
-
var start = pos;
|
|
1029
|
-
if (text.charCodeAt(pos) === 48 /* _0 */) {
|
|
1030
|
-
pos++;
|
|
1031
|
-
}
|
|
1032
|
-
else {
|
|
1033
|
-
pos++;
|
|
1034
|
-
while (pos < text.length && isDigit(text.charCodeAt(pos))) {
|
|
1035
|
-
pos++;
|
|
1036
|
-
}
|
|
1037
|
-
}
|
|
1038
|
-
if (pos < text.length && text.charCodeAt(pos) === 46 /* dot */) {
|
|
1039
|
-
pos++;
|
|
1040
|
-
if (pos < text.length && isDigit(text.charCodeAt(pos))) {
|
|
1041
|
-
pos++;
|
|
1042
|
-
while (pos < text.length && isDigit(text.charCodeAt(pos))) {
|
|
1043
|
-
pos++;
|
|
1044
|
-
}
|
|
1045
|
-
}
|
|
1046
|
-
else {
|
|
1047
|
-
scanError = 3 /* UnexpectedEndOfNumber */;
|
|
1048
|
-
return text.substring(start, pos);
|
|
1049
|
-
}
|
|
1050
|
-
}
|
|
1051
|
-
var end = pos;
|
|
1052
|
-
if (pos < text.length && (text.charCodeAt(pos) === 69 /* E */ || text.charCodeAt(pos) === 101 /* e */)) {
|
|
1053
|
-
pos++;
|
|
1054
|
-
if (pos < text.length && text.charCodeAt(pos) === 43 /* plus */ || text.charCodeAt(pos) === 45 /* minus */) {
|
|
1055
|
-
pos++;
|
|
1056
|
-
}
|
|
1057
|
-
if (pos < text.length && isDigit(text.charCodeAt(pos))) {
|
|
1058
|
-
pos++;
|
|
1059
|
-
while (pos < text.length && isDigit(text.charCodeAt(pos))) {
|
|
1060
|
-
pos++;
|
|
1061
|
-
}
|
|
1062
|
-
end = pos;
|
|
1063
|
-
}
|
|
1064
|
-
else {
|
|
1065
|
-
scanError = 3 /* UnexpectedEndOfNumber */;
|
|
1066
|
-
}
|
|
1067
|
-
}
|
|
1068
|
-
return text.substring(start, end);
|
|
1069
|
-
}
|
|
1070
|
-
function scanString() {
|
|
1071
|
-
var result = '', start = pos;
|
|
1072
|
-
while (true) {
|
|
1073
|
-
if (pos >= len) {
|
|
1074
|
-
result += text.substring(start, pos);
|
|
1075
|
-
scanError = 2 /* UnexpectedEndOfString */;
|
|
1076
|
-
break;
|
|
1077
|
-
}
|
|
1078
|
-
var ch = text.charCodeAt(pos);
|
|
1079
|
-
if (ch === 34 /* doubleQuote */) {
|
|
1080
|
-
result += text.substring(start, pos);
|
|
1081
|
-
pos++;
|
|
1082
|
-
break;
|
|
1083
|
-
}
|
|
1084
|
-
if (ch === 92 /* backslash */) {
|
|
1085
|
-
result += text.substring(start, pos);
|
|
1086
|
-
pos++;
|
|
1087
|
-
if (pos >= len) {
|
|
1088
|
-
scanError = 2 /* UnexpectedEndOfString */;
|
|
1089
|
-
break;
|
|
1090
|
-
}
|
|
1091
|
-
var ch2 = text.charCodeAt(pos++);
|
|
1092
|
-
switch (ch2) {
|
|
1093
|
-
case 34 /* doubleQuote */:
|
|
1094
|
-
result += '\"';
|
|
1095
|
-
break;
|
|
1096
|
-
case 92 /* backslash */:
|
|
1097
|
-
result += '\\';
|
|
1098
|
-
break;
|
|
1099
|
-
case 47 /* slash */:
|
|
1100
|
-
result += '/';
|
|
1101
|
-
break;
|
|
1102
|
-
case 98 /* b */:
|
|
1103
|
-
result += '\b';
|
|
1104
|
-
break;
|
|
1105
|
-
case 102 /* f */:
|
|
1106
|
-
result += '\f';
|
|
1107
|
-
break;
|
|
1108
|
-
case 110 /* n */:
|
|
1109
|
-
result += '\n';
|
|
1110
|
-
break;
|
|
1111
|
-
case 114 /* r */:
|
|
1112
|
-
result += '\r';
|
|
1113
|
-
break;
|
|
1114
|
-
case 116 /* t */:
|
|
1115
|
-
result += '\t';
|
|
1116
|
-
break;
|
|
1117
|
-
case 117 /* u */:
|
|
1118
|
-
var ch3 = scanHexDigits(4, true);
|
|
1119
|
-
if (ch3 >= 0) {
|
|
1120
|
-
result += String.fromCharCode(ch3);
|
|
1121
|
-
}
|
|
1122
|
-
else {
|
|
1123
|
-
scanError = 4 /* InvalidUnicode */;
|
|
1124
|
-
}
|
|
1125
|
-
break;
|
|
1126
|
-
default:
|
|
1127
|
-
scanError = 5 /* InvalidEscapeCharacter */;
|
|
1128
|
-
}
|
|
1129
|
-
start = pos;
|
|
1130
|
-
continue;
|
|
1131
|
-
}
|
|
1132
|
-
if (ch >= 0 && ch <= 0x1f) {
|
|
1133
|
-
if (isLineBreak(ch)) {
|
|
1134
|
-
result += text.substring(start, pos);
|
|
1135
|
-
scanError = 2 /* UnexpectedEndOfString */;
|
|
1136
|
-
break;
|
|
1137
|
-
}
|
|
1138
|
-
else {
|
|
1139
|
-
scanError = 6 /* InvalidCharacter */;
|
|
1140
|
-
// mark as error but continue with string
|
|
1141
|
-
}
|
|
1142
|
-
}
|
|
1143
|
-
pos++;
|
|
1144
|
-
}
|
|
1145
|
-
return result;
|
|
1146
|
-
}
|
|
1147
|
-
function scanNext() {
|
|
1148
|
-
value = '';
|
|
1149
|
-
scanError = 0 /* None */;
|
|
1150
|
-
tokenOffset = pos;
|
|
1151
|
-
lineStartOffset = lineNumber;
|
|
1152
|
-
prevTokenLineStartOffset = tokenLineStartOffset;
|
|
1153
|
-
if (pos >= len) {
|
|
1154
|
-
// at the end
|
|
1155
|
-
tokenOffset = len;
|
|
1156
|
-
return token = 17 /* EOF */;
|
|
1157
|
-
}
|
|
1158
|
-
var code = text.charCodeAt(pos);
|
|
1159
|
-
// trivia: whitespace
|
|
1160
|
-
if (isWhiteSpace(code)) {
|
|
1161
|
-
do {
|
|
1162
|
-
pos++;
|
|
1163
|
-
value += String.fromCharCode(code);
|
|
1164
|
-
code = text.charCodeAt(pos);
|
|
1165
|
-
} while (isWhiteSpace(code));
|
|
1166
|
-
return token = 15 /* Trivia */;
|
|
1167
|
-
}
|
|
1168
|
-
// trivia: newlines
|
|
1169
|
-
if (isLineBreak(code)) {
|
|
1170
|
-
pos++;
|
|
1171
|
-
value += String.fromCharCode(code);
|
|
1172
|
-
if (code === 13 /* carriageReturn */ && text.charCodeAt(pos) === 10 /* lineFeed */) {
|
|
1173
|
-
pos++;
|
|
1174
|
-
value += '\n';
|
|
1175
|
-
}
|
|
1176
|
-
lineNumber++;
|
|
1177
|
-
tokenLineStartOffset = pos;
|
|
1178
|
-
return token = 14 /* LineBreakTrivia */;
|
|
1179
|
-
}
|
|
1180
|
-
switch (code) {
|
|
1181
|
-
// tokens: []{}:,
|
|
1182
|
-
case 123 /* openBrace */:
|
|
1183
|
-
pos++;
|
|
1184
|
-
return token = 1 /* OpenBraceToken */;
|
|
1185
|
-
case 125 /* closeBrace */:
|
|
1186
|
-
pos++;
|
|
1187
|
-
return token = 2 /* CloseBraceToken */;
|
|
1188
|
-
case 91 /* openBracket */:
|
|
1189
|
-
pos++;
|
|
1190
|
-
return token = 3 /* OpenBracketToken */;
|
|
1191
|
-
case 93 /* closeBracket */:
|
|
1192
|
-
pos++;
|
|
1193
|
-
return token = 4 /* CloseBracketToken */;
|
|
1194
|
-
case 58 /* colon */:
|
|
1195
|
-
pos++;
|
|
1196
|
-
return token = 6 /* ColonToken */;
|
|
1197
|
-
case 44 /* comma */:
|
|
1198
|
-
pos++;
|
|
1199
|
-
return token = 5 /* CommaToken */;
|
|
1200
|
-
// strings
|
|
1201
|
-
case 34 /* doubleQuote */:
|
|
1202
|
-
pos++;
|
|
1203
|
-
value = scanString();
|
|
1204
|
-
return token = 10 /* StringLiteral */;
|
|
1205
|
-
// comments
|
|
1206
|
-
case 47 /* slash */:
|
|
1207
|
-
var start = pos - 1;
|
|
1208
|
-
// Single-line comment
|
|
1209
|
-
if (text.charCodeAt(pos + 1) === 47 /* slash */) {
|
|
1210
|
-
pos += 2;
|
|
1211
|
-
while (pos < len) {
|
|
1212
|
-
if (isLineBreak(text.charCodeAt(pos))) {
|
|
1213
|
-
break;
|
|
1214
|
-
}
|
|
1215
|
-
pos++;
|
|
1216
|
-
}
|
|
1217
|
-
value = text.substring(start, pos);
|
|
1218
|
-
return token = 12 /* LineCommentTrivia */;
|
|
1219
|
-
}
|
|
1220
|
-
// Multi-line comment
|
|
1221
|
-
if (text.charCodeAt(pos + 1) === 42 /* asterisk */) {
|
|
1222
|
-
pos += 2;
|
|
1223
|
-
var safeLength = len - 1; // For lookahead.
|
|
1224
|
-
var commentClosed = false;
|
|
1225
|
-
while (pos < safeLength) {
|
|
1226
|
-
var ch = text.charCodeAt(pos);
|
|
1227
|
-
if (ch === 42 /* asterisk */ && text.charCodeAt(pos + 1) === 47 /* slash */) {
|
|
1228
|
-
pos += 2;
|
|
1229
|
-
commentClosed = true;
|
|
1230
|
-
break;
|
|
1231
|
-
}
|
|
1232
|
-
pos++;
|
|
1233
|
-
if (isLineBreak(ch)) {
|
|
1234
|
-
if (ch === 13 /* carriageReturn */ && text.charCodeAt(pos) === 10 /* lineFeed */) {
|
|
1235
|
-
pos++;
|
|
1236
|
-
}
|
|
1237
|
-
lineNumber++;
|
|
1238
|
-
tokenLineStartOffset = pos;
|
|
1239
|
-
}
|
|
1240
|
-
}
|
|
1241
|
-
if (!commentClosed) {
|
|
1242
|
-
pos++;
|
|
1243
|
-
scanError = 1 /* UnexpectedEndOfComment */;
|
|
1244
|
-
}
|
|
1245
|
-
value = text.substring(start, pos);
|
|
1246
|
-
return token = 13 /* BlockCommentTrivia */;
|
|
1247
|
-
}
|
|
1248
|
-
// just a single slash
|
|
1249
|
-
value += String.fromCharCode(code);
|
|
1250
|
-
pos++;
|
|
1251
|
-
return token = 16 /* Unknown */;
|
|
1252
|
-
// numbers
|
|
1253
|
-
case 45 /* minus */:
|
|
1254
|
-
value += String.fromCharCode(code);
|
|
1255
|
-
pos++;
|
|
1256
|
-
if (pos === len || !isDigit(text.charCodeAt(pos))) {
|
|
1257
|
-
return token = 16 /* Unknown */;
|
|
1258
|
-
}
|
|
1259
|
-
// found a minus, followed by a number so
|
|
1260
|
-
// we fall through to proceed with scanning
|
|
1261
|
-
// numbers
|
|
1262
|
-
case 48 /* _0 */:
|
|
1263
|
-
case 49 /* _1 */:
|
|
1264
|
-
case 50 /* _2 */:
|
|
1265
|
-
case 51 /* _3 */:
|
|
1266
|
-
case 52 /* _4 */:
|
|
1267
|
-
case 53 /* _5 */:
|
|
1268
|
-
case 54 /* _6 */:
|
|
1269
|
-
case 55 /* _7 */:
|
|
1270
|
-
case 56 /* _8 */:
|
|
1271
|
-
case 57 /* _9 */:
|
|
1272
|
-
value += scanNumber();
|
|
1273
|
-
return token = 11 /* NumericLiteral */;
|
|
1274
|
-
// literals and unknown symbols
|
|
1275
|
-
default:
|
|
1276
|
-
// is a literal? Read the full word.
|
|
1277
|
-
while (pos < len && isUnknownContentCharacter(code)) {
|
|
1278
|
-
pos++;
|
|
1279
|
-
code = text.charCodeAt(pos);
|
|
1280
|
-
}
|
|
1281
|
-
if (tokenOffset !== pos) {
|
|
1282
|
-
value = text.substring(tokenOffset, pos);
|
|
1283
|
-
// keywords: true, false, null
|
|
1284
|
-
switch (value) {
|
|
1285
|
-
case 'true': return token = 8 /* TrueKeyword */;
|
|
1286
|
-
case 'false': return token = 9 /* FalseKeyword */;
|
|
1287
|
-
case 'null': return token = 7 /* NullKeyword */;
|
|
1288
|
-
}
|
|
1289
|
-
return token = 16 /* Unknown */;
|
|
1290
|
-
}
|
|
1291
|
-
// some
|
|
1292
|
-
value += String.fromCharCode(code);
|
|
1293
|
-
pos++;
|
|
1294
|
-
return token = 16 /* Unknown */;
|
|
1295
|
-
}
|
|
1296
|
-
}
|
|
1297
|
-
function isUnknownContentCharacter(code) {
|
|
1298
|
-
if (isWhiteSpace(code) || isLineBreak(code)) {
|
|
1299
|
-
return false;
|
|
1300
|
-
}
|
|
1301
|
-
switch (code) {
|
|
1302
|
-
case 125 /* closeBrace */:
|
|
1303
|
-
case 93 /* closeBracket */:
|
|
1304
|
-
case 123 /* openBrace */:
|
|
1305
|
-
case 91 /* openBracket */:
|
|
1306
|
-
case 34 /* doubleQuote */:
|
|
1307
|
-
case 58 /* colon */:
|
|
1308
|
-
case 44 /* comma */:
|
|
1309
|
-
case 47 /* slash */:
|
|
1310
|
-
return false;
|
|
1311
|
-
}
|
|
1312
|
-
return true;
|
|
1313
|
-
}
|
|
1314
|
-
function scanNextNonTrivia() {
|
|
1315
|
-
var result;
|
|
1316
|
-
do {
|
|
1317
|
-
result = scanNext();
|
|
1318
|
-
} while (result >= 12 /* LineCommentTrivia */ && result <= 15 /* Trivia */);
|
|
1319
|
-
return result;
|
|
1320
|
-
}
|
|
1321
|
-
return {
|
|
1322
|
-
setPosition: setPosition,
|
|
1323
|
-
getPosition: function () { return pos; },
|
|
1324
|
-
scan: ignoreTrivia ? scanNextNonTrivia : scanNext,
|
|
1325
|
-
getToken: function () { return token; },
|
|
1326
|
-
getTokenValue: function () { return value; },
|
|
1327
|
-
getTokenOffset: function () { return tokenOffset; },
|
|
1328
|
-
getTokenLength: function () { return pos - tokenOffset; },
|
|
1329
|
-
getTokenStartLine: function () { return lineStartOffset; },
|
|
1330
|
-
getTokenStartCharacter: function () { return tokenOffset - prevTokenLineStartOffset; },
|
|
1331
|
-
getTokenError: function () { return scanError; },
|
|
1332
|
-
};
|
|
1333
|
-
}
|
|
1334
|
-
function isWhiteSpace(ch) {
|
|
1335
|
-
return ch === 32 /* space */ || ch === 9 /* tab */ || ch === 11 /* verticalTab */ || ch === 12 /* formFeed */ ||
|
|
1336
|
-
ch === 160 /* nonBreakingSpace */ || ch === 5760 /* ogham */ || ch >= 8192 /* enQuad */ && ch <= 8203 /* zeroWidthSpace */ ||
|
|
1337
|
-
ch === 8239 /* narrowNoBreakSpace */ || ch === 8287 /* mathematicalSpace */ || ch === 12288 /* ideographicSpace */ || ch === 65279 /* byteOrderMark */;
|
|
1338
|
-
}
|
|
1339
|
-
function isLineBreak(ch) {
|
|
1340
|
-
return ch === 10 /* lineFeed */ || ch === 13 /* carriageReturn */ || ch === 8232 /* lineSeparator */ || ch === 8233 /* paragraphSeparator */;
|
|
1341
|
-
}
|
|
1342
|
-
function isDigit(ch) {
|
|
1343
|
-
return ch >= 48 /* _0 */ && ch <= 57 /* _9 */;
|
|
1344
|
-
}
|
|
1345
|
-
|
|
1346
|
-
/*---------------------------------------------------------------------------------------------
|
|
1347
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1348
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
1349
|
-
*--------------------------------------------------------------------------------------------*/
|
|
1350
|
-
var ParseOptions;
|
|
1351
|
-
(function (ParseOptions) {
|
|
1352
|
-
ParseOptions.DEFAULT = {
|
|
1353
|
-
allowTrailingComma: false
|
|
1354
|
-
};
|
|
1355
|
-
})(ParseOptions || (ParseOptions = {}));
|
|
1356
|
-
/**
|
|
1357
|
-
* Parses the given text and returns the object the JSON content represents. On invalid input, the parser tries to be as fault tolerant as possible, but still return a result.
|
|
1358
|
-
* Therefore always check the errors list to find out if the input was valid.
|
|
1359
|
-
*/
|
|
1360
|
-
function parse$1(text, errors, options) {
|
|
1361
|
-
if (errors === void 0) { errors = []; }
|
|
1362
|
-
if (options === void 0) { options = ParseOptions.DEFAULT; }
|
|
1363
|
-
var currentProperty = null;
|
|
1364
|
-
var currentParent = [];
|
|
1365
|
-
var previousParents = [];
|
|
1366
|
-
function onValue(value) {
|
|
1367
|
-
if (Array.isArray(currentParent)) {
|
|
1368
|
-
currentParent.push(value);
|
|
1369
|
-
}
|
|
1370
|
-
else if (currentProperty !== null) {
|
|
1371
|
-
currentParent[currentProperty] = value;
|
|
1372
|
-
}
|
|
1373
|
-
}
|
|
1374
|
-
var visitor = {
|
|
1375
|
-
onObjectBegin: function () {
|
|
1376
|
-
var object = {};
|
|
1377
|
-
onValue(object);
|
|
1378
|
-
previousParents.push(currentParent);
|
|
1379
|
-
currentParent = object;
|
|
1380
|
-
currentProperty = null;
|
|
1381
|
-
},
|
|
1382
|
-
onObjectProperty: function (name) {
|
|
1383
|
-
currentProperty = name;
|
|
1384
|
-
},
|
|
1385
|
-
onObjectEnd: function () {
|
|
1386
|
-
currentParent = previousParents.pop();
|
|
1387
|
-
},
|
|
1388
|
-
onArrayBegin: function () {
|
|
1389
|
-
var array = [];
|
|
1390
|
-
onValue(array);
|
|
1391
|
-
previousParents.push(currentParent);
|
|
1392
|
-
currentParent = array;
|
|
1393
|
-
currentProperty = null;
|
|
1394
|
-
},
|
|
1395
|
-
onArrayEnd: function () {
|
|
1396
|
-
currentParent = previousParents.pop();
|
|
1397
|
-
},
|
|
1398
|
-
onLiteralValue: onValue,
|
|
1399
|
-
onError: function (error, offset, length) {
|
|
1400
|
-
errors.push({ error: error, offset: offset, length: length });
|
|
1401
|
-
}
|
|
1402
|
-
};
|
|
1403
|
-
visit(text, visitor, options);
|
|
1404
|
-
return currentParent[0];
|
|
1405
|
-
}
|
|
1406
|
-
/**
|
|
1407
|
-
* Parses the given text and invokes the visitor functions for each object, array and literal reached.
|
|
1408
|
-
*/
|
|
1409
|
-
function visit(text, visitor, options) {
|
|
1410
|
-
if (options === void 0) { options = ParseOptions.DEFAULT; }
|
|
1411
|
-
var _scanner = createScanner(text, false);
|
|
1412
|
-
function toNoArgVisit(visitFunction) {
|
|
1413
|
-
return visitFunction ? function () { return visitFunction(_scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter()); } : function () { return true; };
|
|
1414
|
-
}
|
|
1415
|
-
function toOneArgVisit(visitFunction) {
|
|
1416
|
-
return visitFunction ? function (arg) { return visitFunction(arg, _scanner.getTokenOffset(), _scanner.getTokenLength(), _scanner.getTokenStartLine(), _scanner.getTokenStartCharacter()); } : function () { return true; };
|
|
1417
|
-
}
|
|
1418
|
-
var onObjectBegin = toNoArgVisit(visitor.onObjectBegin), onObjectProperty = toOneArgVisit(visitor.onObjectProperty), onObjectEnd = toNoArgVisit(visitor.onObjectEnd), onArrayBegin = toNoArgVisit(visitor.onArrayBegin), onArrayEnd = toNoArgVisit(visitor.onArrayEnd), onLiteralValue = toOneArgVisit(visitor.onLiteralValue), onSeparator = toOneArgVisit(visitor.onSeparator), onComment = toNoArgVisit(visitor.onComment), onError = toOneArgVisit(visitor.onError);
|
|
1419
|
-
var disallowComments = options && options.disallowComments;
|
|
1420
|
-
var allowTrailingComma = options && options.allowTrailingComma;
|
|
1421
|
-
function scanNext() {
|
|
1422
|
-
while (true) {
|
|
1423
|
-
var token = _scanner.scan();
|
|
1424
|
-
switch (_scanner.getTokenError()) {
|
|
1425
|
-
case 4 /* InvalidUnicode */:
|
|
1426
|
-
handleError(14 /* InvalidUnicode */);
|
|
1427
|
-
break;
|
|
1428
|
-
case 5 /* InvalidEscapeCharacter */:
|
|
1429
|
-
handleError(15 /* InvalidEscapeCharacter */);
|
|
1430
|
-
break;
|
|
1431
|
-
case 3 /* UnexpectedEndOfNumber */:
|
|
1432
|
-
handleError(13 /* UnexpectedEndOfNumber */);
|
|
1433
|
-
break;
|
|
1434
|
-
case 1 /* UnexpectedEndOfComment */:
|
|
1435
|
-
if (!disallowComments) {
|
|
1436
|
-
handleError(11 /* UnexpectedEndOfComment */);
|
|
1437
|
-
}
|
|
1438
|
-
break;
|
|
1439
|
-
case 2 /* UnexpectedEndOfString */:
|
|
1440
|
-
handleError(12 /* UnexpectedEndOfString */);
|
|
1441
|
-
break;
|
|
1442
|
-
case 6 /* InvalidCharacter */:
|
|
1443
|
-
handleError(16 /* InvalidCharacter */);
|
|
1444
|
-
break;
|
|
1445
|
-
}
|
|
1446
|
-
switch (token) {
|
|
1447
|
-
case 12 /* LineCommentTrivia */:
|
|
1448
|
-
case 13 /* BlockCommentTrivia */:
|
|
1449
|
-
if (disallowComments) {
|
|
1450
|
-
handleError(10 /* InvalidCommentToken */);
|
|
1451
|
-
}
|
|
1452
|
-
else {
|
|
1453
|
-
onComment();
|
|
1454
|
-
}
|
|
1455
|
-
break;
|
|
1456
|
-
case 16 /* Unknown */:
|
|
1457
|
-
handleError(1 /* InvalidSymbol */);
|
|
1458
|
-
break;
|
|
1459
|
-
case 15 /* Trivia */:
|
|
1460
|
-
case 14 /* LineBreakTrivia */:
|
|
1461
|
-
break;
|
|
1462
|
-
default:
|
|
1463
|
-
return token;
|
|
1464
|
-
}
|
|
1465
|
-
}
|
|
1466
|
-
}
|
|
1467
|
-
function handleError(error, skipUntilAfter, skipUntil) {
|
|
1468
|
-
if (skipUntilAfter === void 0) { skipUntilAfter = []; }
|
|
1469
|
-
if (skipUntil === void 0) { skipUntil = []; }
|
|
1470
|
-
onError(error);
|
|
1471
|
-
if (skipUntilAfter.length + skipUntil.length > 0) {
|
|
1472
|
-
var token = _scanner.getToken();
|
|
1473
|
-
while (token !== 17 /* EOF */) {
|
|
1474
|
-
if (skipUntilAfter.indexOf(token) !== -1) {
|
|
1475
|
-
scanNext();
|
|
1476
|
-
break;
|
|
1477
|
-
}
|
|
1478
|
-
else if (skipUntil.indexOf(token) !== -1) {
|
|
1479
|
-
break;
|
|
1480
|
-
}
|
|
1481
|
-
token = scanNext();
|
|
1482
|
-
}
|
|
1483
|
-
}
|
|
1484
|
-
}
|
|
1485
|
-
function parseString(isValue) {
|
|
1486
|
-
var value = _scanner.getTokenValue();
|
|
1487
|
-
if (isValue) {
|
|
1488
|
-
onLiteralValue(value);
|
|
1489
|
-
}
|
|
1490
|
-
else {
|
|
1491
|
-
onObjectProperty(value);
|
|
1492
|
-
}
|
|
1493
|
-
scanNext();
|
|
1494
|
-
return true;
|
|
1495
|
-
}
|
|
1496
|
-
function parseLiteral() {
|
|
1497
|
-
switch (_scanner.getToken()) {
|
|
1498
|
-
case 11 /* NumericLiteral */:
|
|
1499
|
-
var tokenValue = _scanner.getTokenValue();
|
|
1500
|
-
var value = Number(tokenValue);
|
|
1501
|
-
if (isNaN(value)) {
|
|
1502
|
-
handleError(2 /* InvalidNumberFormat */);
|
|
1503
|
-
value = 0;
|
|
1504
|
-
}
|
|
1505
|
-
onLiteralValue(value);
|
|
1506
|
-
break;
|
|
1507
|
-
case 7 /* NullKeyword */:
|
|
1508
|
-
onLiteralValue(null);
|
|
1509
|
-
break;
|
|
1510
|
-
case 8 /* TrueKeyword */:
|
|
1511
|
-
onLiteralValue(true);
|
|
1512
|
-
break;
|
|
1513
|
-
case 9 /* FalseKeyword */:
|
|
1514
|
-
onLiteralValue(false);
|
|
1515
|
-
break;
|
|
1516
|
-
default:
|
|
1517
|
-
return false;
|
|
1518
|
-
}
|
|
1519
|
-
scanNext();
|
|
1520
|
-
return true;
|
|
1521
|
-
}
|
|
1522
|
-
function parseProperty() {
|
|
1523
|
-
if (_scanner.getToken() !== 10 /* StringLiteral */) {
|
|
1524
|
-
handleError(3 /* PropertyNameExpected */, [], [2 /* CloseBraceToken */, 5 /* CommaToken */]);
|
|
1525
|
-
return false;
|
|
1526
|
-
}
|
|
1527
|
-
parseString(false);
|
|
1528
|
-
if (_scanner.getToken() === 6 /* ColonToken */) {
|
|
1529
|
-
onSeparator(':');
|
|
1530
|
-
scanNext(); // consume colon
|
|
1531
|
-
if (!parseValue()) {
|
|
1532
|
-
handleError(4 /* ValueExpected */, [], [2 /* CloseBraceToken */, 5 /* CommaToken */]);
|
|
1533
|
-
}
|
|
1534
|
-
}
|
|
1535
|
-
else {
|
|
1536
|
-
handleError(5 /* ColonExpected */, [], [2 /* CloseBraceToken */, 5 /* CommaToken */]);
|
|
1537
|
-
}
|
|
1538
|
-
return true;
|
|
1539
|
-
}
|
|
1540
|
-
function parseObject() {
|
|
1541
|
-
onObjectBegin();
|
|
1542
|
-
scanNext(); // consume open brace
|
|
1543
|
-
var needsComma = false;
|
|
1544
|
-
while (_scanner.getToken() !== 2 /* CloseBraceToken */ && _scanner.getToken() !== 17 /* EOF */) {
|
|
1545
|
-
if (_scanner.getToken() === 5 /* CommaToken */) {
|
|
1546
|
-
if (!needsComma) {
|
|
1547
|
-
handleError(4 /* ValueExpected */, [], []);
|
|
1548
|
-
}
|
|
1549
|
-
onSeparator(',');
|
|
1550
|
-
scanNext(); // consume comma
|
|
1551
|
-
if (_scanner.getToken() === 2 /* CloseBraceToken */ && allowTrailingComma) {
|
|
1552
|
-
break;
|
|
1553
|
-
}
|
|
1554
|
-
}
|
|
1555
|
-
else if (needsComma) {
|
|
1556
|
-
handleError(6 /* CommaExpected */, [], []);
|
|
1557
|
-
}
|
|
1558
|
-
if (!parseProperty()) {
|
|
1559
|
-
handleError(4 /* ValueExpected */, [], [2 /* CloseBraceToken */, 5 /* CommaToken */]);
|
|
1560
|
-
}
|
|
1561
|
-
needsComma = true;
|
|
1562
|
-
}
|
|
1563
|
-
onObjectEnd();
|
|
1564
|
-
if (_scanner.getToken() !== 2 /* CloseBraceToken */) {
|
|
1565
|
-
handleError(7 /* CloseBraceExpected */, [2 /* CloseBraceToken */], []);
|
|
1566
|
-
}
|
|
1567
|
-
else {
|
|
1568
|
-
scanNext(); // consume close brace
|
|
1569
|
-
}
|
|
1570
|
-
return true;
|
|
1571
|
-
}
|
|
1572
|
-
function parseArray() {
|
|
1573
|
-
onArrayBegin();
|
|
1574
|
-
scanNext(); // consume open bracket
|
|
1575
|
-
var needsComma = false;
|
|
1576
|
-
while (_scanner.getToken() !== 4 /* CloseBracketToken */ && _scanner.getToken() !== 17 /* EOF */) {
|
|
1577
|
-
if (_scanner.getToken() === 5 /* CommaToken */) {
|
|
1578
|
-
if (!needsComma) {
|
|
1579
|
-
handleError(4 /* ValueExpected */, [], []);
|
|
1580
|
-
}
|
|
1581
|
-
onSeparator(',');
|
|
1582
|
-
scanNext(); // consume comma
|
|
1583
|
-
if (_scanner.getToken() === 4 /* CloseBracketToken */ && allowTrailingComma) {
|
|
1584
|
-
break;
|
|
1585
|
-
}
|
|
1586
|
-
}
|
|
1587
|
-
else if (needsComma) {
|
|
1588
|
-
handleError(6 /* CommaExpected */, [], []);
|
|
1589
|
-
}
|
|
1590
|
-
if (!parseValue()) {
|
|
1591
|
-
handleError(4 /* ValueExpected */, [], [4 /* CloseBracketToken */, 5 /* CommaToken */]);
|
|
1592
|
-
}
|
|
1593
|
-
needsComma = true;
|
|
1594
|
-
}
|
|
1595
|
-
onArrayEnd();
|
|
1596
|
-
if (_scanner.getToken() !== 4 /* CloseBracketToken */) {
|
|
1597
|
-
handleError(8 /* CloseBracketExpected */, [4 /* CloseBracketToken */], []);
|
|
1598
|
-
}
|
|
1599
|
-
else {
|
|
1600
|
-
scanNext(); // consume close bracket
|
|
1601
|
-
}
|
|
1602
|
-
return true;
|
|
1603
|
-
}
|
|
1604
|
-
function parseValue() {
|
|
1605
|
-
switch (_scanner.getToken()) {
|
|
1606
|
-
case 3 /* OpenBracketToken */:
|
|
1607
|
-
return parseArray();
|
|
1608
|
-
case 1 /* OpenBraceToken */:
|
|
1609
|
-
return parseObject();
|
|
1610
|
-
case 10 /* StringLiteral */:
|
|
1611
|
-
return parseString(true);
|
|
1612
|
-
default:
|
|
1613
|
-
return parseLiteral();
|
|
1614
|
-
}
|
|
1615
|
-
}
|
|
1616
|
-
scanNext();
|
|
1617
|
-
if (_scanner.getToken() === 17 /* EOF */) {
|
|
1618
|
-
if (options.allowEmptyContent) {
|
|
1619
|
-
return true;
|
|
1620
|
-
}
|
|
1621
|
-
handleError(4 /* ValueExpected */, [], []);
|
|
1622
|
-
return false;
|
|
1623
|
-
}
|
|
1624
|
-
if (!parseValue()) {
|
|
1625
|
-
handleError(4 /* ValueExpected */, [], []);
|
|
1626
|
-
return false;
|
|
1627
|
-
}
|
|
1628
|
-
if (_scanner.getToken() !== 17 /* EOF */) {
|
|
1629
|
-
handleError(9 /* EndOfFileExpected */, [], []);
|
|
1630
|
-
}
|
|
1631
|
-
return true;
|
|
1632
|
-
}
|
|
1633
|
-
|
|
1634
|
-
/*---------------------------------------------------------------------------------------------
|
|
1635
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
1636
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
1637
|
-
*--------------------------------------------------------------------------------------------*/
|
|
1638
|
-
/**
|
|
1639
|
-
* Parses the given text and returns the object the JSON content represents. On invalid input, the parser tries to be as fault tolerant as possible, but still return a result.
|
|
1640
|
-
* Therefore, always check the errors list to find out if the input was valid.
|
|
1641
|
-
*/
|
|
1642
|
-
var parse = parse$1;
|
|
1643
|
-
|
|
1644
|
-
const isWebWorker = typeof self !== 'undefined' && typeof self.WorkerGlobalScope !== 'undefined';
|
|
1645
|
-
const isBrowser = isWebWorker ||
|
|
1646
|
-
(typeof window !== 'undefined' &&
|
|
1647
|
-
typeof window.document !== 'undefined' &&
|
|
1648
|
-
typeof fetch !== 'undefined');
|
|
1649
|
-
// to be replaced by rollup
|
|
1650
|
-
let CDN_ROOT = '';
|
|
1651
|
-
let WASM = '';
|
|
1652
|
-
/**
|
|
1653
|
-
* Set the route for loading the assets
|
|
1654
|
-
* URL should end with `/`
|
|
1655
|
-
*
|
|
1656
|
-
* For example:
|
|
1657
|
-
* ```ts
|
|
1658
|
-
* setCDN('https://unpkg.com/shiki/') // use unpkg
|
|
1659
|
-
* setCDN('/assets/shiki/') // serve by yourself
|
|
1660
|
-
* ```
|
|
1661
|
-
*/
|
|
1662
|
-
function setCDN(root) {
|
|
1663
|
-
CDN_ROOT = root;
|
|
1664
|
-
}
|
|
1665
|
-
/**
|
|
1666
|
-
* Explicitly set the source for loading the oniguruma web assembly module.
|
|
1667
|
-
*
|
|
1668
|
-
* Accepts Url or ArrayBuffer
|
|
1669
|
-
*/
|
|
1670
|
-
function setWasm(path) {
|
|
1671
|
-
WASM = path;
|
|
1672
|
-
}
|
|
1673
|
-
let _onigurumaPromise = null;
|
|
1674
|
-
async function getOniguruma() {
|
|
1675
|
-
if (!_onigurumaPromise) {
|
|
1676
|
-
let loader;
|
|
1677
|
-
if (isBrowser) {
|
|
1678
|
-
if (typeof WASM === 'string') {
|
|
1679
|
-
loader = main$3.exports.loadWASM({
|
|
1680
|
-
data: await fetch(_resolvePath('dist/onig.wasm')).then(r => r.arrayBuffer())
|
|
1681
|
-
});
|
|
1682
|
-
}
|
|
1683
|
-
else {
|
|
1684
|
-
loader = main$3.exports.loadWASM(WASM);
|
|
1685
|
-
}
|
|
1686
|
-
}
|
|
1687
|
-
else {
|
|
1688
|
-
const path = require('path');
|
|
1689
|
-
const wasmPath = path.join(require.resolve('vscode-oniguruma'), '../onig.wasm');
|
|
1690
|
-
const fs = require('fs');
|
|
1691
|
-
const wasmBin = fs.readFileSync(wasmPath).buffer;
|
|
1692
|
-
loader = main$3.exports.loadWASM(wasmBin);
|
|
1693
|
-
}
|
|
1694
|
-
_onigurumaPromise = loader.then(() => {
|
|
1695
|
-
return {
|
|
1696
|
-
createOnigScanner(patterns) {
|
|
1697
|
-
return main$3.exports.createOnigScanner(patterns);
|
|
1698
|
-
},
|
|
1699
|
-
createOnigString(s) {
|
|
1700
|
-
return main$3.exports.createOnigString(s);
|
|
1701
|
-
}
|
|
1702
|
-
};
|
|
1703
|
-
});
|
|
1704
|
-
}
|
|
1705
|
-
return _onigurumaPromise;
|
|
1706
|
-
}
|
|
1707
|
-
function _resolvePath(filepath) {
|
|
1708
|
-
if (isBrowser) {
|
|
1709
|
-
if (!CDN_ROOT) {
|
|
1710
|
-
console.warn('[Shiki] no CDN provider found, use `setCDN()` to specify the CDN for loading the resources before calling `getHighlighter()`');
|
|
1711
|
-
}
|
|
1712
|
-
return `${CDN_ROOT}${filepath}`;
|
|
1713
|
-
}
|
|
1714
|
-
else {
|
|
1715
|
-
const path = require('path');
|
|
1716
|
-
if (path.isAbsolute(filepath)) {
|
|
1717
|
-
return filepath;
|
|
1718
|
-
}
|
|
1719
|
-
else {
|
|
1720
|
-
return path.resolve(__dirname, '..', filepath);
|
|
1721
|
-
}
|
|
1722
|
-
}
|
|
1723
|
-
}
|
|
1724
|
-
/**
|
|
1725
|
-
* @param filepath assert path related to ./packages/shiki
|
|
1726
|
-
*/
|
|
1727
|
-
async function _fetchAssets(filepath) {
|
|
1728
|
-
const path = _resolvePath(filepath);
|
|
1729
|
-
if (isBrowser) {
|
|
1730
|
-
return await fetch(path).then(r => r.text());
|
|
1731
|
-
}
|
|
1732
|
-
else {
|
|
1733
|
-
const fs = require('fs');
|
|
1734
|
-
return await fs.promises.readFile(path, 'utf-8');
|
|
1735
|
-
}
|
|
1736
|
-
}
|
|
1737
|
-
async function _fetchJSONAssets(filepath) {
|
|
1738
|
-
const errors = [];
|
|
1739
|
-
const rawTheme = parse(await _fetchAssets(filepath), errors, {
|
|
1740
|
-
allowTrailingComma: true
|
|
1741
|
-
});
|
|
1742
|
-
if (errors.length) {
|
|
1743
|
-
throw errors[0];
|
|
1744
|
-
}
|
|
1745
|
-
return rawTheme;
|
|
1746
|
-
}
|
|
1747
|
-
/**
|
|
1748
|
-
* @param themePath related path to theme.json
|
|
1749
|
-
*/
|
|
1750
|
-
async function fetchTheme(themePath) {
|
|
1751
|
-
let theme = await _fetchJSONAssets(themePath);
|
|
1752
|
-
const shikiTheme = toShikiTheme(theme);
|
|
1753
|
-
if (shikiTheme.include) {
|
|
1754
|
-
const includedTheme = await fetchTheme(join(dirname(themePath), shikiTheme.include));
|
|
1755
|
-
if (includedTheme.settings) {
|
|
1756
|
-
shikiTheme.settings = includedTheme.settings.concat(shikiTheme.settings);
|
|
1757
|
-
}
|
|
1758
|
-
if (includedTheme.bg && !shikiTheme.bg) {
|
|
1759
|
-
shikiTheme.bg = includedTheme.bg;
|
|
1760
|
-
}
|
|
1761
|
-
if (includedTheme.colors) {
|
|
1762
|
-
shikiTheme.colors = Object.assign(Object.assign({}, includedTheme.colors), shikiTheme.colors);
|
|
1763
|
-
}
|
|
1764
|
-
delete shikiTheme.include;
|
|
1765
|
-
}
|
|
1766
|
-
return shikiTheme;
|
|
1767
|
-
}
|
|
1768
|
-
async function fetchGrammar(filepath) {
|
|
1769
|
-
return await _fetchJSONAssets(filepath);
|
|
1770
|
-
}
|
|
1771
|
-
function repairTheme(theme) {
|
|
1772
|
-
// Has the default no-scope setting with fallback colors
|
|
1773
|
-
if (!theme.settings)
|
|
1774
|
-
theme.settings = [];
|
|
1775
|
-
if (theme.settings[0] && theme.settings[0].settings && !theme.settings[0].scope) {
|
|
1776
|
-
return;
|
|
1777
|
-
}
|
|
1778
|
-
// Push a no-scope setting with fallback colors
|
|
1779
|
-
theme.settings.unshift({
|
|
1780
|
-
settings: {
|
|
1781
|
-
foreground: theme.fg,
|
|
1782
|
-
background: theme.bg
|
|
1783
|
-
}
|
|
1784
|
-
});
|
|
1785
|
-
}
|
|
1786
|
-
function toShikiTheme(rawTheme) {
|
|
1787
|
-
const type = rawTheme.type || 'dark';
|
|
1788
|
-
const shikiTheme = Object.assign(Object.assign({ name: rawTheme.name, type }, rawTheme), getThemeDefaultColors(rawTheme));
|
|
1789
|
-
if (rawTheme.include) {
|
|
1790
|
-
shikiTheme.include = rawTheme.include;
|
|
1791
|
-
}
|
|
1792
|
-
if (rawTheme.tokenColors) {
|
|
1793
|
-
shikiTheme.settings = rawTheme.tokenColors;
|
|
1794
|
-
delete shikiTheme.tokenColors;
|
|
1795
|
-
}
|
|
1796
|
-
repairTheme(shikiTheme);
|
|
1797
|
-
return shikiTheme;
|
|
1798
|
-
}
|
|
1799
|
-
/**
|
|
1800
|
-
* https://github.com/microsoft/vscode/blob/f7f05dee53fb33fe023db2e06e30a89d3094488f/src/vs/platform/theme/common/colorRegistry.ts#L258-L268
|
|
1801
|
-
*/
|
|
1802
|
-
const VSCODE_FALLBACK_EDITOR_FG = { light: '#333333', dark: '#bbbbbb' };
|
|
1803
|
-
const VSCODE_FALLBACK_EDITOR_BG = { light: '#fffffe', dark: '#1e1e1e' };
|
|
1804
|
-
function getThemeDefaultColors(theme) {
|
|
1805
|
-
var _a, _b, _c, _d, _e, _f;
|
|
1806
|
-
let fg, bg;
|
|
1807
|
-
/**
|
|
1808
|
-
* First try:
|
|
1809
|
-
* Theme might contain a global `tokenColor` without `name` or `scope`
|
|
1810
|
-
* Used as default value for foreground/background
|
|
1811
|
-
*/
|
|
1812
|
-
let settings = theme.settings ? theme.settings : theme.tokenColors;
|
|
1813
|
-
const globalSetting = settings
|
|
1814
|
-
? settings.find(s => {
|
|
1815
|
-
return !s.name && !s.scope;
|
|
1816
|
-
})
|
|
1817
|
-
: undefined;
|
|
1818
|
-
if ((_a = globalSetting === null || globalSetting === void 0 ? void 0 : globalSetting.settings) === null || _a === void 0 ? void 0 : _a.foreground) {
|
|
1819
|
-
fg = globalSetting.settings.foreground;
|
|
1820
|
-
}
|
|
1821
|
-
if ((_b = globalSetting === null || globalSetting === void 0 ? void 0 : globalSetting.settings) === null || _b === void 0 ? void 0 : _b.background) {
|
|
1822
|
-
bg = globalSetting.settings.background;
|
|
1823
|
-
}
|
|
1824
|
-
/**
|
|
1825
|
-
* Second try:
|
|
1826
|
-
* If there's no global `tokenColor` without `name` or `scope`
|
|
1827
|
-
* Use `editor.foreground` and `editor.background`
|
|
1828
|
-
*/
|
|
1829
|
-
if (!fg && ((_d = (_c = theme) === null || _c === void 0 ? void 0 : _c.colors) === null || _d === void 0 ? void 0 : _d['editor.foreground'])) {
|
|
1830
|
-
fg = theme.colors['editor.foreground'];
|
|
1831
|
-
}
|
|
1832
|
-
if (!bg && ((_f = (_e = theme) === null || _e === void 0 ? void 0 : _e.colors) === null || _f === void 0 ? void 0 : _f['editor.background'])) {
|
|
1833
|
-
bg = theme.colors['editor.background'];
|
|
1834
|
-
}
|
|
1835
|
-
/**
|
|
1836
|
-
* Last try:
|
|
1837
|
-
* If there's no fg/bg color specified in theme, use default
|
|
1838
|
-
*/
|
|
1839
|
-
if (!fg) {
|
|
1840
|
-
fg = theme.type === 'light' ? VSCODE_FALLBACK_EDITOR_FG.light : VSCODE_FALLBACK_EDITOR_FG.dark;
|
|
1841
|
-
}
|
|
1842
|
-
if (!bg) {
|
|
1843
|
-
bg = theme.type === 'light' ? VSCODE_FALLBACK_EDITOR_BG.light : VSCODE_FALLBACK_EDITOR_BG.dark;
|
|
1844
|
-
}
|
|
1845
|
-
return {
|
|
1846
|
-
fg,
|
|
1847
|
-
bg
|
|
1848
|
-
};
|
|
1849
|
-
}
|
|
1850
|
-
|
|
1851
|
-
/*---------------------------------------------------------
|
|
1852
|
-
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
1853
|
-
*--------------------------------------------------------*/
|
|
1854
|
-
class Resolver {
|
|
1855
|
-
constructor(onigLibPromise, onigLibName) {
|
|
1856
|
-
this.languagesPath = 'languages/';
|
|
1857
|
-
this.languageMap = {};
|
|
1858
|
-
this.scopeToLangMap = {};
|
|
1859
|
-
this._onigLibPromise = onigLibPromise;
|
|
1860
|
-
this._onigLibName = onigLibName;
|
|
1861
|
-
}
|
|
1862
|
-
get onigLib() {
|
|
1863
|
-
return this._onigLibPromise;
|
|
1864
|
-
}
|
|
1865
|
-
getOnigLibName() {
|
|
1866
|
-
return this._onigLibName;
|
|
1867
|
-
}
|
|
1868
|
-
getLangRegistration(langIdOrAlias) {
|
|
1869
|
-
return this.languageMap[langIdOrAlias];
|
|
1870
|
-
}
|
|
1871
|
-
async loadGrammar(scopeName) {
|
|
1872
|
-
const lang = this.scopeToLangMap[scopeName];
|
|
1873
|
-
if (!lang) {
|
|
1874
|
-
return null;
|
|
1875
|
-
}
|
|
1876
|
-
if (lang.grammar) {
|
|
1877
|
-
return lang.grammar;
|
|
1878
|
-
}
|
|
1879
|
-
const g = await fetchGrammar(languages.includes(lang) ? `${this.languagesPath}${lang.path}` : lang.path);
|
|
1880
|
-
lang.grammar = g;
|
|
1881
|
-
return g;
|
|
1882
|
-
}
|
|
1883
|
-
addLanguage(l) {
|
|
1884
|
-
this.languageMap[l.id] = l;
|
|
1885
|
-
if (l.aliases) {
|
|
1886
|
-
l.aliases.forEach(a => {
|
|
1887
|
-
this.languageMap[a] = l;
|
|
1888
|
-
});
|
|
1889
|
-
}
|
|
1890
|
-
this.scopeToLangMap[l.scopeName] = l;
|
|
1891
|
-
}
|
|
1892
|
-
}
|
|
1893
|
-
|
|
1894
|
-
/*---------------------------------------------------------
|
|
1895
|
-
* Copyright (C) Microsoft Corporation. All rights reserved.
|
|
1896
|
-
*--------------------------------------------------------*/
|
|
1897
|
-
function tokenizeWithTheme(theme, colorMap, fileContents, grammar, options) {
|
|
1898
|
-
let lines = fileContents.split(/\r\n|\r|\n/);
|
|
1899
|
-
let ruleStack = main$1.exports.INITIAL;
|
|
1900
|
-
let actual = [];
|
|
1901
|
-
let final = [];
|
|
1902
|
-
for (let i = 0, len = lines.length; i < len; i++) {
|
|
1903
|
-
let line = lines[i];
|
|
1904
|
-
if (line === '') {
|
|
1905
|
-
actual = [];
|
|
1906
|
-
final.push([]);
|
|
1907
|
-
continue;
|
|
1908
|
-
}
|
|
1909
|
-
let resultWithScopes;
|
|
1910
|
-
let tokensWithScopes;
|
|
1911
|
-
let tokensWithScopesIndex;
|
|
1912
|
-
if (options.includeExplanation) {
|
|
1913
|
-
resultWithScopes = grammar.tokenizeLine(line, ruleStack);
|
|
1914
|
-
tokensWithScopes = resultWithScopes.tokens;
|
|
1915
|
-
tokensWithScopesIndex = 0;
|
|
1916
|
-
}
|
|
1917
|
-
let result = grammar.tokenizeLine2(line, ruleStack);
|
|
1918
|
-
let tokensLength = result.tokens.length / 2;
|
|
1919
|
-
for (let j = 0; j < tokensLength; j++) {
|
|
1920
|
-
let startIndex = result.tokens[2 * j];
|
|
1921
|
-
let nextStartIndex = j + 1 < tokensLength ? result.tokens[2 * j + 2] : line.length;
|
|
1922
|
-
if (startIndex === nextStartIndex) {
|
|
1923
|
-
continue;
|
|
1924
|
-
}
|
|
1925
|
-
let metadata = result.tokens[2 * j + 1];
|
|
1926
|
-
let foreground = StackElementMetadata.getForeground(metadata);
|
|
1927
|
-
let foregroundColor = colorMap[foreground];
|
|
1928
|
-
let fontStyle = StackElementMetadata.getFontStyle(metadata);
|
|
1929
|
-
let explanation = [];
|
|
1930
|
-
if (options.includeExplanation) {
|
|
1931
|
-
let offset = 0;
|
|
1932
|
-
while (startIndex + offset < nextStartIndex) {
|
|
1933
|
-
let tokenWithScopes = tokensWithScopes[tokensWithScopesIndex];
|
|
1934
|
-
let tokenWithScopesText = line.substring(tokenWithScopes.startIndex, tokenWithScopes.endIndex);
|
|
1935
|
-
offset += tokenWithScopesText.length;
|
|
1936
|
-
explanation.push({
|
|
1937
|
-
content: tokenWithScopesText,
|
|
1938
|
-
scopes: explainThemeScopes(theme, tokenWithScopes.scopes)
|
|
1939
|
-
});
|
|
1940
|
-
tokensWithScopesIndex++;
|
|
1941
|
-
}
|
|
1942
|
-
}
|
|
1943
|
-
actual.push({
|
|
1944
|
-
content: line.substring(startIndex, nextStartIndex),
|
|
1945
|
-
color: foregroundColor,
|
|
1946
|
-
fontStyle,
|
|
1947
|
-
explanation: explanation
|
|
1948
|
-
});
|
|
1949
|
-
}
|
|
1950
|
-
final.push(actual);
|
|
1951
|
-
actual = [];
|
|
1952
|
-
ruleStack = result.ruleStack;
|
|
1953
|
-
}
|
|
1954
|
-
return final;
|
|
1955
|
-
}
|
|
1956
|
-
function explainThemeScopes(theme, scopes) {
|
|
1957
|
-
let result = [];
|
|
1958
|
-
for (let i = 0, len = scopes.length; i < len; i++) {
|
|
1959
|
-
let parentScopes = scopes.slice(0, i);
|
|
1960
|
-
let scope = scopes[i];
|
|
1961
|
-
result[i] = {
|
|
1962
|
-
scopeName: scope,
|
|
1963
|
-
themeMatches: explainThemeScope(theme, scope, parentScopes)
|
|
1964
|
-
};
|
|
1965
|
-
}
|
|
1966
|
-
return result;
|
|
1967
|
-
}
|
|
1968
|
-
function matchesOne(selector, scope) {
|
|
1969
|
-
let selectorPrefix = selector + '.';
|
|
1970
|
-
if (selector === scope || scope.substring(0, selectorPrefix.length) === selectorPrefix) {
|
|
1971
|
-
return true;
|
|
1972
|
-
}
|
|
1973
|
-
return false;
|
|
1974
|
-
}
|
|
1975
|
-
function matches(selector, selectorParentScopes, scope, parentScopes) {
|
|
1976
|
-
if (!matchesOne(selector, scope)) {
|
|
1977
|
-
return false;
|
|
1978
|
-
}
|
|
1979
|
-
let selectorParentIndex = selectorParentScopes.length - 1;
|
|
1980
|
-
let parentIndex = parentScopes.length - 1;
|
|
1981
|
-
while (selectorParentIndex >= 0 && parentIndex >= 0) {
|
|
1982
|
-
if (matchesOne(selectorParentScopes[selectorParentIndex], parentScopes[parentIndex])) {
|
|
1983
|
-
selectorParentIndex--;
|
|
1984
|
-
}
|
|
1985
|
-
parentIndex--;
|
|
1986
|
-
}
|
|
1987
|
-
if (selectorParentIndex === -1) {
|
|
1988
|
-
return true;
|
|
1989
|
-
}
|
|
1990
|
-
return false;
|
|
1991
|
-
}
|
|
1992
|
-
function explainThemeScope(theme, scope, parentScopes) {
|
|
1993
|
-
let result = [], resultLen = 0;
|
|
1994
|
-
for (let i = 0, len = theme.settings.length; i < len; i++) {
|
|
1995
|
-
let setting = theme.settings[i];
|
|
1996
|
-
let selectors;
|
|
1997
|
-
if (typeof setting.scope === 'string') {
|
|
1998
|
-
selectors = setting.scope.split(/,/).map(scope => scope.trim());
|
|
1999
|
-
}
|
|
2000
|
-
else if (Array.isArray(setting.scope)) {
|
|
2001
|
-
selectors = setting.scope;
|
|
2002
|
-
}
|
|
2003
|
-
else {
|
|
2004
|
-
continue;
|
|
2005
|
-
}
|
|
2006
|
-
for (let j = 0, lenJ = selectors.length; j < lenJ; j++) {
|
|
2007
|
-
let rawSelector = selectors[j];
|
|
2008
|
-
let rawSelectorPieces = rawSelector.split(/ /);
|
|
2009
|
-
let selector = rawSelectorPieces[rawSelectorPieces.length - 1];
|
|
2010
|
-
let selectorParentScopes = rawSelectorPieces.slice(0, rawSelectorPieces.length - 1);
|
|
2011
|
-
if (matches(selector, selectorParentScopes, scope, parentScopes)) {
|
|
2012
|
-
// match!
|
|
2013
|
-
result[resultLen++] = setting;
|
|
2014
|
-
// break the loop
|
|
2015
|
-
j = lenJ;
|
|
2016
|
-
}
|
|
2017
|
-
}
|
|
2018
|
-
}
|
|
2019
|
-
return result;
|
|
2020
|
-
}
|
|
2021
|
-
|
|
2022
|
-
function renderToHtml(lines, options = {}) {
|
|
2023
|
-
var _a;
|
|
2024
|
-
const bg = options.bg || '#fff';
|
|
2025
|
-
const optionsByLineNumber = groupBy((_a = options.lineOptions) !== null && _a !== void 0 ? _a : [], option => option.line);
|
|
2026
|
-
let html = '';
|
|
2027
|
-
html += `<pre class="shiki" style="background-color: ${bg}">`;
|
|
2028
|
-
if (options.langId) {
|
|
2029
|
-
html += `<div class="language-id">${options.langId}</div>`;
|
|
2030
|
-
}
|
|
2031
|
-
html += `<code>`;
|
|
2032
|
-
lines.forEach((l, lineIndex) => {
|
|
2033
|
-
var _a;
|
|
2034
|
-
const lineNumber = lineIndex + 1;
|
|
2035
|
-
const lineOptions = (_a = optionsByLineNumber.get(lineNumber)) !== null && _a !== void 0 ? _a : [];
|
|
2036
|
-
const lineClasses = getLineClasses(lineOptions).join(' ');
|
|
2037
|
-
html += `<span class="${lineClasses}">`;
|
|
2038
|
-
l.forEach(token => {
|
|
2039
|
-
const cssDeclarations = [`color: ${token.color || options.fg}`];
|
|
2040
|
-
if (token.fontStyle & FontStyle.Italic) {
|
|
2041
|
-
cssDeclarations.push('font-style: italic');
|
|
2042
|
-
}
|
|
2043
|
-
if (token.fontStyle & FontStyle.Bold) {
|
|
2044
|
-
cssDeclarations.push('font-weight: bold');
|
|
2045
|
-
}
|
|
2046
|
-
if (token.fontStyle & FontStyle.Underline) {
|
|
2047
|
-
cssDeclarations.push('text-decoration: underline');
|
|
2048
|
-
}
|
|
2049
|
-
html += `<span style="${cssDeclarations.join('; ')}">${escapeHtml(token.content)}</span>`;
|
|
2050
|
-
});
|
|
2051
|
-
html += `</span>\n`;
|
|
2052
|
-
});
|
|
2053
|
-
html = html.replace(/\n*$/, ''); // Get rid of final new lines
|
|
2054
|
-
html += `</code></pre>`;
|
|
2055
|
-
return html;
|
|
2056
|
-
}
|
|
2057
|
-
const htmlEscapes = {
|
|
2058
|
-
'&': '&',
|
|
2059
|
-
'<': '<',
|
|
2060
|
-
'>': '>',
|
|
2061
|
-
'"': '"',
|
|
2062
|
-
"'": '''
|
|
2063
|
-
};
|
|
2064
|
-
function escapeHtml(html) {
|
|
2065
|
-
return html.replace(/[&<>"']/g, chr => htmlEscapes[chr]);
|
|
2066
|
-
}
|
|
2067
|
-
function getLineClasses(lineOptions) {
|
|
2068
|
-
var _a;
|
|
2069
|
-
const lineClasses = new Set(['line']);
|
|
2070
|
-
for (const lineOption of lineOptions) {
|
|
2071
|
-
for (const lineClass of (_a = lineOption.classes) !== null && _a !== void 0 ? _a : []) {
|
|
2072
|
-
lineClasses.add(lineClass);
|
|
2073
|
-
}
|
|
2074
|
-
}
|
|
2075
|
-
return Array.from(lineClasses);
|
|
2076
|
-
}
|
|
2077
|
-
|
|
2078
|
-
class Registry extends main$1.exports.Registry {
|
|
2079
|
-
constructor(_resolver) {
|
|
2080
|
-
super(_resolver);
|
|
2081
|
-
this._resolver = _resolver;
|
|
2082
|
-
this.themesPath = 'themes/';
|
|
2083
|
-
this._resolvedThemes = {};
|
|
2084
|
-
this._resolvedGrammars = {};
|
|
2085
|
-
}
|
|
2086
|
-
getTheme(theme) {
|
|
2087
|
-
if (typeof theme === 'string') {
|
|
2088
|
-
return this._resolvedThemes[theme];
|
|
2089
|
-
}
|
|
2090
|
-
else {
|
|
2091
|
-
return theme;
|
|
2092
|
-
}
|
|
2093
|
-
}
|
|
2094
|
-
async loadTheme(theme) {
|
|
2095
|
-
if (typeof theme === 'string') {
|
|
2096
|
-
if (!this._resolvedThemes[theme]) {
|
|
2097
|
-
this._resolvedThemes[theme] = await fetchTheme(`${this.themesPath}${theme}.json`);
|
|
2098
|
-
}
|
|
2099
|
-
return this._resolvedThemes[theme];
|
|
2100
|
-
}
|
|
2101
|
-
else {
|
|
2102
|
-
theme = toShikiTheme(theme);
|
|
2103
|
-
if (theme.name) {
|
|
2104
|
-
this._resolvedThemes[theme.name] = theme;
|
|
2105
|
-
}
|
|
2106
|
-
return theme;
|
|
2107
|
-
}
|
|
2108
|
-
}
|
|
2109
|
-
async loadThemes(themes) {
|
|
2110
|
-
return await Promise.all(themes.map(theme => this.loadTheme(theme)));
|
|
2111
|
-
}
|
|
2112
|
-
getLoadedThemes() {
|
|
2113
|
-
return Object.keys(this._resolvedThemes);
|
|
2114
|
-
}
|
|
2115
|
-
getGrammar(name) {
|
|
2116
|
-
return this._resolvedGrammars[name];
|
|
2117
|
-
}
|
|
2118
|
-
async loadLanguage(lang) {
|
|
2119
|
-
const g = await this.loadGrammar(lang.scopeName);
|
|
2120
|
-
this._resolvedGrammars[lang.id] = g;
|
|
2121
|
-
if (lang.aliases) {
|
|
2122
|
-
lang.aliases.forEach(la => {
|
|
2123
|
-
this._resolvedGrammars[la] = g;
|
|
2124
|
-
});
|
|
2125
|
-
}
|
|
2126
|
-
}
|
|
2127
|
-
async loadLanguages(langs) {
|
|
2128
|
-
for (const lang of langs) {
|
|
2129
|
-
this._resolver.addLanguage(lang);
|
|
2130
|
-
}
|
|
2131
|
-
for (const lang of langs) {
|
|
2132
|
-
await this.loadLanguage(lang);
|
|
2133
|
-
}
|
|
2134
|
-
}
|
|
2135
|
-
getLoadedLanguages() {
|
|
2136
|
-
return Object.keys(this._resolvedGrammars);
|
|
2137
|
-
}
|
|
2138
|
-
}
|
|
2139
|
-
|
|
2140
|
-
function resolveLang(lang) {
|
|
2141
|
-
return typeof lang === 'string'
|
|
2142
|
-
? languages.find(l => { var _a; return l.id === lang || ((_a = l.aliases) === null || _a === void 0 ? void 0 : _a.includes(lang)); })
|
|
2143
|
-
: lang;
|
|
2144
|
-
}
|
|
2145
|
-
function resolveOptions(options) {
|
|
2146
|
-
var _a;
|
|
2147
|
-
let _languages = languages;
|
|
2148
|
-
let _themes = options.themes || [];
|
|
2149
|
-
if ((_a = options.langs) === null || _a === void 0 ? void 0 : _a.length) {
|
|
2150
|
-
_languages = options.langs.map(resolveLang);
|
|
2151
|
-
}
|
|
2152
|
-
if (options.theme) {
|
|
2153
|
-
_themes.unshift(options.theme);
|
|
2154
|
-
}
|
|
2155
|
-
if (!_themes.length) {
|
|
2156
|
-
_themes = ['nord'];
|
|
2157
|
-
}
|
|
2158
|
-
return { _languages, _themes };
|
|
2159
|
-
}
|
|
2160
|
-
async function getHighlighter(options) {
|
|
2161
|
-
var _a, _b;
|
|
2162
|
-
const { _languages, _themes } = resolveOptions(options);
|
|
2163
|
-
const _resolver = new Resolver(getOniguruma(), 'vscode-oniguruma');
|
|
2164
|
-
const _registry = new Registry(_resolver);
|
|
2165
|
-
if ((_a = options.paths) === null || _a === void 0 ? void 0 : _a.themes) {
|
|
2166
|
-
_registry.themesPath = options.paths.themes;
|
|
2167
|
-
}
|
|
2168
|
-
if ((_b = options.paths) === null || _b === void 0 ? void 0 : _b.languages) {
|
|
2169
|
-
_resolver.languagesPath = options.paths.languages;
|
|
2170
|
-
}
|
|
2171
|
-
const themes = await _registry.loadThemes(_themes);
|
|
2172
|
-
const _defaultTheme = themes[0];
|
|
2173
|
-
let _currentTheme;
|
|
2174
|
-
await _registry.loadLanguages(_languages);
|
|
2175
|
-
/**
|
|
2176
|
-
* Shiki was designed for VS Code, so CSS variables are not currently supported.
|
|
2177
|
-
* See: https://github.com/shikijs/shiki/pull/212#issuecomment-906924986
|
|
2178
|
-
*
|
|
2179
|
-
* Instead, we work around this by using valid hex color codes as lookups in a
|
|
2180
|
-
* final "repair" step which translates those codes to the correct CSS variables.
|
|
2181
|
-
*/
|
|
2182
|
-
const COLOR_REPLACEMENTS = {
|
|
2183
|
-
'#000001': 'var(--shiki-color-text)',
|
|
2184
|
-
'#000002': 'var(--shiki-color-background)',
|
|
2185
|
-
'#000004': 'var(--shiki-token-constant)',
|
|
2186
|
-
'#000005': 'var(--shiki-token-string)',
|
|
2187
|
-
'#000006': 'var(--shiki-token-comment)',
|
|
2188
|
-
'#000007': 'var(--shiki-token-keyword)',
|
|
2189
|
-
'#000008': 'var(--shiki-token-parameter)',
|
|
2190
|
-
'#000009': 'var(--shiki-token-function)',
|
|
2191
|
-
'#000010': 'var(--shiki-token-string-expression)',
|
|
2192
|
-
'#000011': 'var(--shiki-token-punctuation)',
|
|
2193
|
-
'#000012': 'var(--shiki-token-link)'
|
|
2194
|
-
};
|
|
2195
|
-
function fixCssVariablesTheme(theme, colorMap) {
|
|
2196
|
-
theme.bg = COLOR_REPLACEMENTS[theme.bg] || theme.bg;
|
|
2197
|
-
theme.fg = COLOR_REPLACEMENTS[theme.fg] || theme.fg;
|
|
2198
|
-
colorMap.forEach((val, i) => {
|
|
2199
|
-
colorMap[i] = COLOR_REPLACEMENTS[val] || val;
|
|
2200
|
-
});
|
|
2201
|
-
}
|
|
2202
|
-
function getTheme(theme) {
|
|
2203
|
-
const _theme = theme ? _registry.getTheme(theme) : _defaultTheme;
|
|
2204
|
-
if (!_theme) {
|
|
2205
|
-
throw Error(`No theme registration for ${theme}`);
|
|
2206
|
-
}
|
|
2207
|
-
if (!_currentTheme || _currentTheme.name !== _theme.name) {
|
|
2208
|
-
_registry.setTheme(_theme);
|
|
2209
|
-
_currentTheme = _theme;
|
|
2210
|
-
}
|
|
2211
|
-
const _colorMap = _registry.getColorMap();
|
|
2212
|
-
if (_theme.name === 'css-variables') {
|
|
2213
|
-
fixCssVariablesTheme(_theme, _colorMap);
|
|
2214
|
-
}
|
|
2215
|
-
return { _theme, _colorMap };
|
|
2216
|
-
}
|
|
2217
|
-
function getGrammar(lang) {
|
|
2218
|
-
const _grammar = _registry.getGrammar(lang);
|
|
2219
|
-
if (!_grammar) {
|
|
2220
|
-
throw Error(`No language registration for ${lang}`);
|
|
2221
|
-
}
|
|
2222
|
-
return { _grammar };
|
|
2223
|
-
}
|
|
2224
|
-
function codeToThemedTokens(code, lang = 'text', theme, options = { includeExplanation: true }) {
|
|
2225
|
-
if (isPlaintext(lang)) {
|
|
2226
|
-
const lines = code.split(/\r\n|\r|\n/);
|
|
2227
|
-
return [...lines.map(line => [{ content: line }])];
|
|
2228
|
-
}
|
|
2229
|
-
const { _grammar } = getGrammar(lang);
|
|
2230
|
-
const { _theme, _colorMap } = getTheme(theme);
|
|
2231
|
-
return tokenizeWithTheme(_theme, _colorMap, code, _grammar, options);
|
|
2232
|
-
}
|
|
2233
|
-
function codeToHtml(code, arg1 = 'text', arg2) {
|
|
2234
|
-
let options;
|
|
2235
|
-
// codeToHtml(code, options?) overload
|
|
2236
|
-
if (typeof arg1 === 'object') {
|
|
2237
|
-
options = arg1;
|
|
2238
|
-
}
|
|
2239
|
-
// codeToHtml(code, lang?, theme?) overload
|
|
2240
|
-
else {
|
|
2241
|
-
options = {
|
|
2242
|
-
lang: arg1,
|
|
2243
|
-
theme: arg2
|
|
2244
|
-
};
|
|
2245
|
-
}
|
|
2246
|
-
const tokens = codeToThemedTokens(code, options.lang, options.theme, {
|
|
2247
|
-
includeExplanation: false
|
|
2248
|
-
});
|
|
2249
|
-
const { _theme } = getTheme(options.theme);
|
|
2250
|
-
return renderToHtml(tokens, {
|
|
2251
|
-
fg: _theme.fg,
|
|
2252
|
-
bg: _theme.bg,
|
|
2253
|
-
lineOptions: options === null || options === void 0 ? void 0 : options.lineOptions
|
|
2254
|
-
});
|
|
2255
|
-
}
|
|
2256
|
-
async function loadTheme(theme) {
|
|
2257
|
-
await _registry.loadTheme(theme);
|
|
2258
|
-
}
|
|
2259
|
-
async function loadLanguage(lang) {
|
|
2260
|
-
const _lang = resolveLang(lang);
|
|
2261
|
-
_resolver.addLanguage(_lang);
|
|
2262
|
-
await _registry.loadLanguage(_lang);
|
|
2263
|
-
}
|
|
2264
|
-
function getLoadedThemes() {
|
|
2265
|
-
return _registry.getLoadedThemes();
|
|
2266
|
-
}
|
|
2267
|
-
function getLoadedLanguages() {
|
|
2268
|
-
return _registry.getLoadedLanguages();
|
|
2269
|
-
}
|
|
2270
|
-
function getBackgroundColor(theme) {
|
|
2271
|
-
const { _theme } = getTheme(theme);
|
|
2272
|
-
return _theme.bg;
|
|
2273
|
-
}
|
|
2274
|
-
function getForegroundColor(theme) {
|
|
2275
|
-
const { _theme } = getTheme(theme);
|
|
2276
|
-
return _theme.fg;
|
|
2277
|
-
}
|
|
2278
|
-
return {
|
|
2279
|
-
codeToThemedTokens,
|
|
2280
|
-
codeToHtml,
|
|
2281
|
-
getTheme: (theme) => {
|
|
2282
|
-
return getTheme(theme)._theme;
|
|
2283
|
-
},
|
|
2284
|
-
loadTheme,
|
|
2285
|
-
loadLanguage,
|
|
2286
|
-
getBackgroundColor,
|
|
2287
|
-
getForegroundColor,
|
|
2288
|
-
getLoadedThemes,
|
|
2289
|
-
getLoadedLanguages
|
|
2290
|
-
};
|
|
2291
|
-
}
|
|
2292
|
-
function isPlaintext(lang) {
|
|
2293
|
-
return !lang || ['plaintext', 'txt', 'text'].includes(lang);
|
|
2294
|
-
}
|
|
2295
|
-
|
|
2296
|
-
/** @deprecated use setWasm instead, will be removed in a future version */
|
|
2297
|
-
function setOnigasmWASM(path) {
|
|
2298
|
-
setWasm(path);
|
|
2299
|
-
}
|
|
2300
|
-
|
|
2301
|
-
export { languages as BUNDLED_LANGUAGES, themes as BUNDLED_THEMES, FontStyle, getHighlighter, fetchTheme as loadTheme, renderToHtml, setCDN, setOnigasmWASM, setWasm, toShikiTheme };
|