You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
50 KiB
1 line
50 KiB
|
7 years ago
|
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports["lua-in-js"]=t():e["lua-in-js"]=t()}(global,function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var a=t[n]={i:n,l:!1,exports:{}};return e[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var a in e)r.d(n,a,function(t){return e[t]}.bind(null,a));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=5)}([function(e,t,r){(function(e){var r,n,a;!function(o,i,s){"use strict";var u={function:!0,object:!0},c=u[typeof t]&&t&&!t.nodeType&&t,l=u[typeof e]&&e&&!e.nodeType&&e,f=c&&l&&"object"==typeof global&&global,p=l&&l.exports===c&&c;!f||f.global!==f&&f.window!==f&&f.self,n=[t],void 0===(a="function"==typeof(r=s)?r.apply(t,n):r)||(e.exports=a),c&&p&&s(l.exports)}(0,0,function(e){"use strict";var t,r,n;e.version="0.2.1";var a=e.defaultOptions={wait:!1,comments:!0,scope:!1,locations:!1,ranges:!1,onCreateNode:null,onCreateScope:null,onDestroyScope:null},o=1,i=2,s=4,u=8,c=16,l=32,f=64,p=128,h=256;e.tokenTypes={EOF:o,StringLiteral:i,Keyword:s,Identifier:u,NumericLiteral:c,Punctuator:l,BooleanLiteral:f,NilLiteral:p,VarargLiteral:h};var d=e.errors={unexpected:"unexpected %1 '%2' near '%3'",expected:"'%1' expected near '%2'",expectedToken:"%1 expected near '%2'",unfinishedString:"unfinished string near '%1'",malformedNumber:"malformed number near '%1'",invalidVar:"invalid left-hand side of assignment near '%1'"},g=e.ast={labelStatement:function(e){return{type:"LabelStatement",label:e}},breakStatement:function(){return{type:"BreakStatement"}},gotoStatement:function(e){return{type:"GotoStatement",label:e}},returnStatement:function(e){return{type:"ReturnStatement",arguments:e}},ifStatement:function(e){return{type:"IfStatement",clauses:e}},ifClause:function(e,t){return{type:"IfClause",condition:e,body:t}},elseifClause:function(e,t){return{type:"ElseifClause",condition:e,body:t}},elseClause:function(e){return{type:"ElseClause",body:e}},whileStatement:function(e,t){return{type:"WhileStatement",condition:e,body:t}},doStatement:function(e){return{type:"DoStatement",body:e}},repeatStatement:function(e,t){return{type:"RepeatStatement",condition:e,body:t}},localStatement:function(e,t){return{type:"LocalStatement",variables:e,init:t}},assignmentStatement:function(e,t){return{type:"AssignmentStatement",variables:e,init:t}},callStatement:function(e){return{type:"CallStatement",expression:e}},functionStatement:function(e,t,r,n){return{type:"FunctionDeclaration",identifier:e,isLocal:r,parameters:t,body:n}},forNumericStatement:function(e,t,r,n,a){return{type:"ForNumericStatement",variable:e,start:t,end:r,step:n,body:a}},forGenericStatement:function(e,t,r){return{type:"ForGenericStatement",variables:e,iterators:t,body:r}},chunk:function(e){return{type:"Chunk",body:e}},identifier:function(e){return{type:"Identifier",name:e}},literal:function(e,t,r){return{type:e=e===i?"StringLiteral":e===c?"NumericLiteral":e===f?"BooleanLiteral":e===p?"NilLiteral":"VarargLiteral",value:t,raw:r}},tableKey:function(e,t){return{type:"TableKey",key:e,value:t}},tableKeyString:function(e,t){return{type:"TableKeyString",key:e,value:t}},tableValue:function(e){return{type:"TableValue",value:e}},tableConstructorExpression:function(e){return{type:"TableConstructorExpression",fields:e}},binaryExpression:function(e,t,r){return{type:"and"===e||"or"===e?"Logi
|