tree-sitter-toml/docs/web-tree-sitter-0.15.9/tree-sitter.js

2 lines
55 KiB
JavaScript
Raw Normal View History

2019-08-31 12:33:31 -04:00
var Module=void 0!==Module?Module:{};!function(e,t){"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?module.exports=t():window.TreeSitter=t()}(0,function(){var e,t={};for(e in Module)Module.hasOwnProperty(e)&&(t[e]=Module[e]);Module.arguments=[],Module.thisProgram="./this.program",Module.quit=function(e,t){throw t},Module.preRun=[],Module.postRun=[];var n,r=!1,a=!1,i=!1;r="object"==typeof window,a="function"==typeof importScripts,i="object"==typeof process&&"function"==typeof require&&!r&&!a,n=!r&&!i&&!a;var o,l,u="";i?(u=__dirname+"/",Module.read=function shell_read(e,t){var n;return o||(o=require("fs")),l||(l=require("path")),e=l.normalize(e),n=o.readFileSync(e),t?n:n.toString()},Module.readBinary=function readBinary(e){var t=Module.read(e,!0);return t.buffer||(t=new Uint8Array(t)),assert(t.buffer),t},process.argv.length>1&&(Module.thisProgram=process.argv[1].replace(/\\/g,"/")),Module.arguments=process.argv.slice(2),"undefined"!=typeof module&&(module.exports=Module),process.on("uncaughtException",function(e){if(!(e instanceof ExitStatus))throw e}),process.on("unhandledRejection",abort),Module.quit=function(e){process.exit(e)},Module.inspect=function(){return"[Emscripten Module object]"}):n?("undefined"!=typeof read&&(Module.read=function shell_read(e){return read(e)}),Module.readBinary=function readBinary(e){var t;return"function"==typeof readbuffer?new Uint8Array(readbuffer(e)):(assert("object"==typeof(t=read(e,"binary"))),t)},"undefined"!=typeof scriptArgs?Module.arguments=scriptArgs:void 0!==arguments&&(Module.arguments=arguments),"function"==typeof quit&&(Module.quit=function(e){quit(e)})):(r||a)&&(a?u=self.location.href:document.currentScript&&(u=document.currentScript.src),u=0!==u.indexOf("blob:")?u.substr(0,u.lastIndexOf("/")+1):"",Module.read=function shell_read(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.send(null),t.responseText},a&&(Module.readBinary=function readBinary(e){var t=new XMLHttpRequest;return t.open("GET",e,!1),t.responseType="arraybuffer",t.send(null),new Uint8Array(t.response)}),Module.readAsync=function readAsync(e,t,n){var r=new XMLHttpRequest;r.open("GET",e,!0),r.responseType="arraybuffer",r.onload=function xhr_onload(){200==r.status||0==r.status&&r.response?t(r.response):n()},r.onerror=n,r.send(null)},Module.setWindowTitle=function(e){document.title=e});var s=Module.print||("undefined"!=typeof console?console.log.bind(console):"undefined"!=typeof print?print:null),_=Module.printErr||("undefined"!=typeof printErr?printErr:"undefined"!=typeof console&&console.warn.bind(console)||s);for(e in t)t.hasOwnProperty(e)&&(Module[e]=t[e]);t=void 0;var d=16;function dynamicAlloc(e){var t=S[T>>2],n=t+e+15&-16;if(n<=_emscripten_get_heap_size())S[T>>2]=n;else if(!_emscripten_resize_heap(n))return 0;return t}function alignMemory(e,t){return t||(t=d),Math.ceil(e/t)*t}function getNativeTypeSize(e){switch(e){case"i1":case"i8":return 1;case"i16":return 2;case"i32":return 4;case"i64":return 8;case"float":return 4;case"double":return 8;default:if("*"===e[e.length-1])return 4;if("i"===e[0]){var t=parseInt(e.substr(1));return assert(t%8==0,"getNativeTypeSize invalid bits "+t+", type "+e),t/8}return 0}}var c={"f64-rem":function(e,t){return e%t},debugger:function(){}},m={nextHandle:1,loadedLibs:{"-1":{refcount:1/0,name:"__self__",module:Module,global:!0}},loadedLibNames:{__self__:-1}};function loadDynamicLibrary(e,t){t=t||{global:!0,nodelete:!0};var n,r=m.loadedLibNames[e];if(r)return n=m.loadedLibs[r],t.global&&!n.global&&(n.global=!0,"loading"!==n.module&&mergeLibSymbols(n.module)),t.nodelete&&n.refcount!==1/0&&(n.refcount=1/0),n.refcount++,t.loadAsync?Promise.resolve(r):r;function loadLibData(){if(t.fs){var n=t.fs.readFile(e,{encoding:"binary"});return n instanceof Uint8Array||(n=new Uint8Array(lib_data)),t.loadAsync?Promise.resolve(n):n}return t.loadAsync?function fetchBinary(e){return fetch(e,{credentials:"same-origin"}).then(function(t){if(!t.ok)throw"failed to load binary file at '"+e+"'";return t.arrayBuffer()}).then(function(e){return new Uint8Array(e)})}(e):Module.