phantasmal-world/b50d8f9f130bab30fd09.worker.js

1 line
96 KiB
JavaScript
Raw Normal View History

2020-01-03 01:36:18 +08:00
!function(i){var e={};function o(d){if(e[d])return e[d].exports;var v=e[d]={i:d,l:!1,exports:{}};return i[d].call(v.exports,v,v.exports,o),v.l=!0,v.exports}o.m=i,o.c=e,o.d=function(i,e,d){o.o(i,e)||Object.defineProperty(i,e,{enumerable:!0,get:d})},o.r=function(i){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(i,"__esModule",{value:!0})},o.t=function(i,e){if(1&e&&(i=o(i)),8&e)return i;if(4&e&&"object"==typeof i&&i&&i.__esModule)return i;var d=Object.create(null);if(o.r(d),Object.defineProperty(d,"default",{enumerable:!0,value:i}),2&e&&"string"!=typeof i)for(var v in i)o.d(d,v,function(e){return i[e]}.bind(null,v));return d},o.n=function(i){var e=i&&i.__esModule?function(){return i.default}:function(){return i};return o.d(e,"a",e),e},o.o=function(i,e){return Object.prototype.hasOwnProperty.call(i,e)},o.p="",o(o.s="yL6M")}({yL6M:function(i,e,o){"use strict";var d,v;o.r(e),function(i){i[i.NewAssembly=0]="NewAssembly",i[i.AssemblyChange=1]="AssemblyChange",i[i.SignatureHelp=2]="SignatureHelp",i[i.Definition=3]="Definition",i[i.SettingsChange=4]="SettingsChange"}(d||(d={})),function(i){i[i.NewObjectCode=0]="NewObjectCode",i[i.SignatureHelp=1]="SignatureHelp",i[i.Definition=2]="Definition"}(v||(v={}));const t=new DataView(new ArrayBuffer(4));var n,s;!function(i){i[i.Int=0]="Int",i[i.Float=1]="Float",i[i.InvalidNumber=2]="InvalidNumber",i[i.Register=3]="Register",i[i.Label=4]="Label",i[i.CodeSection=5]="CodeSection",i[i.DataSection=6]="DataSection",i[i.StringSection=7]="StringSection",i[i.InvalidSection=8]="InvalidSection",i[i.String=9]="String",i[i.UnterminatedString=10]="UnterminatedString",i[i.Ident=11]="Ident",i[i.InvalidIdent=12]="InvalidIdent",i[i.ArgSeparator=13]="ArgSeparator"}(n||(n={}));class r{constructor(){this.index=0,this._mark=0}get col(){return this.index+1}tokenize_line(i){this.line=i,this.index=0,this._mark=0;const e=[];for(;this.has_next();){const i=this.peek();let o;if("/"===i){if(this.skip(),"/"===this.peek())break;this.back()}/\s/.test(i)?this.skip():(/[-\d]/.test(i)?o=this.tokenize_number_or_label():","===i?(o={type:n.ArgSeparator,col:this.col,len:1},this.skip()):o="."===i?this.tokenize_section():'"'===i?this.tokenize_string():"r"===i?this.tokenize_register_or_ident():this.tokenize_ident(),e.push(o))}return e}has_next(){return this.index<this.line.length}next(){return this.line.charAt(this.index++)}peek(){return this.line.charAt(this.index)}skip(){this.index++}back(){this.index--}mark(){this._mark=this.index}marked_len(){return this.index-this._mark}slice(){return this.line.slice(this._mark,this.index)}eat_rest_of_token(){for(;this.has_next();){const i=this.next();if(/[\s,]/.test(i)){this.back();break}}}tokenize_number_or_label(){this.mark();const i=this.col;this.skip();let e=!1;for(;this.has_next();){const o=this.peek();if("."===o||"e"===o)return this.tokenize_float(i);if("x"===o)return this.tokenize_hex_number(i);if(":"===o){e=!0,this.skip();break}if(/[\s,]/.test(o))break;this.skip()}const o=parseInt(this.slice(),10);return{type:Number.isInteger(o)?e?n.Label:n.Int:n.InvalidNumber,col:i,len:this.marked_len(),value:o}}tokenize_hex_number(i){this.eat_rest_of_token();const e=this.slice();if(/^0x[\da-fA-F]+$/.test(e)){const o=parseInt(e,16);if(Number.isInteger(o))return{type:n.Int,col:i,len:this.marked_len(),value:o}}return{type:n.InvalidNumber,col:i,len:this.marked_len()}}tokenize_float(i){this.eat_rest_of_token();const e=this.slice();if(/^-?\d+(\.\d+)?(e-?\d+)?$/.test(e)){const o=parseFloat(e);if(Number.isFinite(o))return{type:n.Float,col:i,len:this.marked_len(),value:o}}return{type:n.InvalidNumber,col:i,len:this.marked_len()}}tokenize_register_or_ident(){const i=this.col;this.skip(),this.mark();let e=!1;for(;this.has_next();){const i=this.peek();if(!/\d/.test(i))break;e=!0,this.skip()}if(e){const e=parseInt(this.slice(),10);return{type:n.Register,col:i,len:this.marked_len()+1,value:e}}return this.back(),this.tokenize_ident()}tokenize_section(){const i=this.col;for(this.mark();this.has_next()&&!/\s/.test(this.peek());)this.