Skip to content

Instantly share code, notes, and snippets.

@kumavis
Created July 6, 2013 05:09
Show Gist options
  • Save kumavis/5938724 to your computer and use it in GitHub Desktop.
Save kumavis/5938724 to your computer and use it in GitHub Desktop.
made with requirebin.com
<style type='text/css'> html, body { margin: 0; padding: 0; border: 0; } </style>
var treeify = require('treeify')
var esprima = require('esprima')
var src = "var z=0,x = (function(){z++})()"
alert( treeify.asTree(esprima.parse(src),true) )
require=function(e,t,r){function n(r,i){if(!t[r]){if(!e[r]){var o="function"==typeof require&&require;if(!i&&o)return o(r,!0);if(a)return a(r,!0);throw Error("Cannot find module '"+r+"'")}var s=t[r]={exports:{}};e[r][0].call(s.exports,function(t){var a=e[r][1][t];return n(a?a:t)},s,s.exports)}return t[r].exports}for(var a="function"==typeof require&&require,i=0;r.length>i;i++)n(r[i]);return n}({treeify:[function(e,t){t.exports=e("3Ailgz")},{}],"3Ailgz":[function(e,t,r){(function(e,n){"object"==typeof r?t.exports=n():"function"==typeof define&&define.amd?define(n):e.treeify=n()})(this,function(){function e(e,t){var r=t?"└":"├";return r+=e?"─ ":"──┐"}function t(e,t){var r=[];for(var n in e)e.hasOwnProperty(n)&&(t&&"function"==typeof e[n]||r.push(n));return r}function r(n,a,i,o,s,l,u){var c,p,f="",d=0,m=o.slice(0);if(m.push([a,i])&&o.length>0&&(o.forEach(function(e,t){t>0&&(f+=(e[1]?" ":"│")+" "),p||e[0]!==a||(p=!0)}),f+=e(n,i)+n,s&&"object"!=typeof a&&(f+=": "+a),p&&(f+=" (circular ref.)"),u(f)),!p&&"object"==typeof a){var y=t(a,l);y.forEach(function(e){c=++d===y.length,r(e,a[e],c,m,s,l,u)})}}var n={};return n.asLines=function(e,t,n,a){var i="function"!=typeof n?n:!1;r(".",e,!1,[],t,i,a||n)},n.asTree=function(e,t,n){var a="";return r(".",e,!1,[],t,n,function(e){a+=e+"\n"}),a},n})},{}]},{},[]),require=function(e,t,r){function n(r,i){if(!t[r]){if(!e[r]){var o="function"==typeof require&&require;if(!i&&o)return o(r,!0);if(a)return a(r,!0);throw Error("Cannot find module '"+r+"'")}var s=t[r]={exports:{}};e[r][0].call(s.exports,function(t){var a=e[r][1][t];return n(a?a:t)},s,s.exports)}return t[r].exports}for(var a="function"==typeof require&&require,i=0;r.length>i;i++)n(r[i]);return n}({esprima:[function(e,t){t.exports=e("iDXHID")},{}],iDXHID:[function(e,t,r){(function(){(function(e,t){"use strict";"function"==typeof define&&define.amd?define(["exports"],t):r!==void 0?t(r):t(e.esprima={})})(this,function(e){"use strict";function t(e,t){if(!e)throw Error("ASSERT: "+t)}function r(e,t){return fr.slice(e,t)}function n(e){return"0123456789".indexOf(e)>=0}function a(e){return"0123456789abcdefABCDEF".indexOf(e)>=0}function i(e){return"01234567".indexOf(e)>=0}function o(e){return" "===e||" "===e||" "===e||"\f"===e||" "===e||e.charCodeAt(0)>=5760&&" ᠎              ".indexOf(e)>=0}function s(e){return"\n"===e||"\r"===e||"\u2028"===e||"\u2029"===e}function l(e){return"$"===e||"_"===e||"\\"===e||e>="a"&&"z">=e||e>="A"&&"Z">=e||e.charCodeAt(0)>=128&&pr.NonAsciiIdentifierStart.test(e)}function u(e){return"$"===e||"_"===e||"\\"===e||e>="a"&&"z">=e||e>="A"&&"Z">=e||e>="0"&&"9">=e||e.charCodeAt(0)>=128&&pr.NonAsciiIdentifierPart.test(e)}function c(e){switch(e){case"class":case"enum":case"export":case"extends":case"import":case"super":return!0}return!1}function p(e){switch(e){case"implements":case"interface":case"package":case"private":case"protected":case"public":case"static":case"yield":case"let":return!0}return!1}function f(e){return"eval"===e||"arguments"===e}function d(e){var t=!1;switch(e.length){case 2:t="if"===e||"in"===e||"do"===e;break;case 3:t="var"===e||"for"===e||"new"===e||"try"===e;break;case 4:t="this"===e||"else"===e||"case"===e||"void"===e||"with"===e;break;case 5:t="while"===e||"break"===e||"catch"===e||"throw"===e;break;case 6:t="return"===e||"typeof"===e||"delete"===e||"switch"===e;break;case 7:t="default"===e||"finally"===e;break;case 8:t="function"===e||"continue"===e||"debugger"===e;break;case 10:t="instanceof"===e}if(t)return!0;switch(e){case"const":return!0;case"yield":case"let":return!0}return dr&&p(e)?!0:c(e)}function m(){var e,t,r;for(t=!1,r=!1;gr>mr;)if(e=fr[mr],r)e=fr[mr++],s(e)&&(r=!1,"\r"===e&&"\n"===fr[mr]&&++mr,++yr,vr=mr);else if(t)s(e)?("\r"===e&&"\n"===fr[mr+1]&&++mr,++yr,++mr,vr=mr,mr>=gr&&k({},cr.UnexpectedToken,"ILLEGAL")):(e=fr[mr++],mr>=gr&&k({},cr.UnexpectedToken,"ILLEGAL"),"*"===e&&(e=fr[mr],"/"===e&&(++mr,t=!1)));else if("/"===e)if(e=fr[mr+1],"/"===e)mr+=2,r=!0;else{if("*"!==e)break;mr+=2,t=!0,mr>=gr&&k({},cr.UnexpectedToken,"ILLEGAL")}else if(o(e))++mr;else{if(!s(e))break;++mr,"\r"===e&&"\n"===fr[mr]&&++mr,++yr,vr=mr}}function y(e){var t,r,n,i=0;for(r="u"===e?4:2,t=0;r>t;++t){if(!(gr>mr&&a(fr[mr])))return"";n=fr[mr++],i=16*i+"0123456789abcdef".indexOf(n.toLowerCase())}return String.fromCharCode(i)}function v(){var e,t,r,n;if(e=fr[mr],l(e)){if(t=mr,"\\"===e){if(++mr,"u"!==fr[mr])return;if(++mr,n=mr,e=y("u")){if("\\"===e||!l(e))return;r=e}else mr=n,r="u"}else r=fr[mr++];for(;gr>mr&&(e=fr[mr],u(e));)if("\\"===e){if(++mr,"u"!==fr[mr])return;if(++mr,n=mr,e=y("u")){if("\\"===e||!u(e))return;r+=e}else mr=n,r+="u"}else r+=fr[mr++];return 1===r.length?{type:or.Identifier,value:r,lineNumber:yr,lineStart:vr,range:[t,mr]}:d(r)?{type:or.Keyword,value:r,lineNumber:yr,lineStart:vr,range:[t,mr]}:"null"===r?{type:or.NullLiteral,value:r,lineNumber:yr,lineStart:vr,range:[t,mr]}:"true"===r||"false"===r?{type:or.BooleanLiteral,value:r,lineNumber:yr,lineStart:vr,range:[t,mr]}:{type:or.Identifier,value:r,lineNumber:yr,lineStart:vr,range:[t,mr]}}}function g(){var e,t,r,a=mr,i=fr[mr];return";"===i||"{"===i||"}"===i?(++mr,{type:or.Punctuator,value:i,lineNumber:yr,lineStart:vr,range:[a,mr]}):","===i||"("===i||")"===i?(++mr,{type:or.Punctuator,value:i,lineNumber:yr,lineStart:vr,range:[a,mr]}):(e=fr[mr+1],"."!==i||n(e)?(t=fr[mr+2],r=fr[mr+3],">"===i&&">"===e&&">"===t&&"="===r?(mr+=4,{type:or.Punctuator,value:">>>=",lineNumber:yr,lineStart:vr,range:[a,mr]}):"="===i&&"="===e&&"="===t?(mr+=3,{type:or.Punctuator,value:"===",lineNumber:yr,lineStart:vr,range:[a,mr]}):"!"===i&&"="===e&&"="===t?(mr+=3,{type:or.Punctuator,value:"!==",lineNumber:yr,lineStart:vr,range:[a,mr]}):">"===i&&">"===e&&">"===t?(mr+=3,{type:or.Punctuator,value:">>>",lineNumber:yr,lineStart:vr,range:[a,mr]}):"<"===i&&"<"===e&&"="===t?(mr+=3,{type:or.Punctuator,value:"<<=",lineNumber:yr,lineStart:vr,range:[a,mr]}):">"===i&&">"===e&&"="===t?(mr+=3,{type:or.Punctuator,value:">>=",lineNumber:yr,lineStart:vr,range:[a,mr]}):"="===e&&"<>=!+-*%&|^/".indexOf(i)>=0?(mr+=2,{type:or.Punctuator,value:i+e,lineNumber:yr,lineStart:vr,range:[a,mr]}):i===e&&"+-<>&|".indexOf(i)>=0&&"+-<>&|".indexOf(e)>=0?(mr+=2,{type:or.Punctuator,value:i+e,lineNumber:yr,lineStart:vr,range:[a,mr]}):"[]<>+-*%&|^!~?:=/".indexOf(i)>=0?{type:or.Punctuator,value:fr[mr++],lineNumber:yr,lineStart:vr,range:[a,mr]}:void 0):{type:or.Punctuator,value:fr[mr++],lineNumber:yr,lineStart:vr,range:[a,mr]})}function x(){var e,r,o;if(o=fr[mr],t(n(o)||"."===o,"Numeric literal must start with a decimal digit or a decimal point"),r=mr,e="","."!==o){if(e=fr[mr++],o=fr[mr],"0"===e){if("x"===o||"X"===o){for(e+=fr[mr++];gr>mr&&(o=fr[mr],a(o));)e+=fr[mr++];return 2>=e.length&&k({},cr.UnexpectedToken,"ILLEGAL"),gr>mr&&(o=fr[mr],l(o)&&k({},cr.UnexpectedToken,"ILLEGAL")),{type:or.NumericLiteral,value:parseInt(e,16),lineNumber:yr,lineStart:vr,range:[r,mr]}}if(i(o)){for(e+=fr[mr++];gr>mr&&(o=fr[mr],i(o));)e+=fr[mr++];return gr>mr&&(o=fr[mr],(l(o)||n(o))&&k({},cr.UnexpectedToken,"ILLEGAL")),{type:or.NumericLiteral,value:parseInt(e,8),octal:!0,lineNumber:yr,lineStart:vr,range:[r,mr]}}n(o)&&k({},cr.UnexpectedToken,"ILLEGAL")}for(;gr>mr&&(o=fr[mr],n(o));)e+=fr[mr++]}if("."===o)for(e+=fr[mr++];gr>mr&&(o=fr[mr],n(o));)e+=fr[mr++];if("e"===o||"E"===o)if(e+=fr[mr++],o=fr[mr],("+"===o||"-"===o)&&(e+=fr[mr++]),o=fr[mr],n(o))for(e+=fr[mr++];gr>mr&&(o=fr[mr],n(o));)e+=fr[mr++];else o="character "+o,mr>=gr&&(o="<end>"),k({},cr.UnexpectedToken,"ILLEGAL");return gr>mr&&(o=fr[mr],l(o)&&k({},cr.UnexpectedToken,"ILLEGAL")),{type:or.NumericLiteral,value:parseFloat(e),lineNumber:yr,lineStart:vr,range:[r,mr]}}function h(){var e,r,n,a,o,l,u="",c=!1;for(e=fr[mr],t("'"===e||'"'===e,"String literal must starts with a quote"),r=mr,++mr;gr>mr;){if(n=fr[mr++],n===e){e="";break}if("\\"===n)if(n=fr[mr++],s(n))++yr,"\r"===n&&"\n"===fr[mr]&&++mr;else switch(n){case"n":u+="\n";break;case"r":u+="\r";break;case"t":u+=" ";break;case"u":case"x":l=mr,o=y(n),o?u+=o:(mr=l,u+=n);break;case"b":u+="\b";break;case"f":u+="\f";break;case"v":u+=" ";break;default:i(n)?(a="01234567".indexOf(n),0!==a&&(c=!0),gr>mr&&i(fr[mr])&&(c=!0,a=8*a+"01234567".indexOf(fr[mr++]),"0123".indexOf(n)>=0&&gr>mr&&i(fr[mr])&&(a=8*a+"01234567".indexOf(fr[mr++]))),u+=String.fromCharCode(a)):u+=n}else{if(s(n))break;u+=n}}return""!==e&&k({},cr.UnexpectedToken,"ILLEGAL"),{type:or.StringLiteral,value:u,octal:c,lineNumber:yr,lineStart:vr,range:[r,mr]}}function S(){var e,r,n,a,i,o,l,c=!1,p=!1;for(xr=null,m(),n=mr,r=fr[mr],t("/"===r,"Regular expression literal must start with a slash"),e=fr[mr++];gr>mr;)if(r=fr[mr++],e+=r,c)"]"===r&&(c=!1);else if("\\"===r)r=fr[mr++],s(r)&&k({},cr.UnterminatedRegExp),e+=r;else{if("/"===r){p=!0;break}"["===r?c=!0:s(r)&&k({},cr.UnterminatedRegExp)}for(p||k({},cr.UnterminatedRegExp),a=e.substr(1,e.length-2),i="";gr>mr&&(r=fr[mr],u(r));)if(++mr,"\\"===r&&gr>mr)if(r=fr[mr],"u"===r)if(++mr,l=mr,r=y("u"))for(i+=r,e+="\\u";mr>l;++l)e+=fr[l];else mr=l,i+="u",e+="\\u";else e+="\\";else i+=r,e+=r;try{o=RegExp(a,i)}catch(f){k({},cr.InvalidRegExp)}return{literal:e,value:o,range:[n,mr]}}function b(e){return e.type===or.Identifier||e.type===or.Keyword||e.type===or.BooleanLiteral||e.type===or.NullLiteral}function E(){var e,t;return m(),mr>=gr?{type:or.EOF,lineNumber:yr,lineStart:vr,range:[mr,mr]}:(t=g(),t!==void 0?t:(e=fr[mr],"'"===e||'"'===e?h():"."===e||n(e)?x():(t=v(),t!==void 0?t:(k({},cr.UnexpectedToken,"ILLEGAL"),void 0))))}function w(){var e;return xr?(mr=xr.range[1],yr=xr.lineNumber,vr=xr.lineStart,e=xr,xr=null,e):(xr=null,E())}function L(){var e,t,r;return null!==xr?xr:(e=mr,t=yr,r=vr,xr=E(),mr=e,yr=t,vr=r,xr)}function I(){var e,t,r,n;return e=mr,t=yr,r=vr,m(),n=yr!==t,mr=e,yr=t,vr=r,n}function k(e,t){var r,n=Array.prototype.slice.call(arguments,2),a=t.replace(/%(\d)/g,function(e,t){return n[t]||""});throw"number"==typeof e.lineNumber?(r=Error("Line "+e.lineNumber+": "+a),r.index=e.range[0],r.lineNumber=e.lineNumber,r.column=e.range[0]-vr+1):(r=Error("Line "+yr+": "+a),r.index=mr,r.lineNumber=yr,r.column=mr-vr+1),r}function P(){try{k.apply(null,arguments)}catch(e){if(!Sr.errors)throw e;Sr.errors.push(e)}}function N(e){if(e.type===or.EOF&&k(e,cr.UnexpectedEOS),e.type===or.NumericLiteral&&k(e,cr.UnexpectedNumber),e.type===or.StringLiteral&&k(e,cr.UnexpectedString),e.type===or.Identifier&&k(e,cr.UnexpectedIdentifier),e.type===or.Keyword){if(c(e.value))k(e,cr.UnexpectedReserved);else if(dr&&p(e.value))return P(e,cr.StrictReservedWord),void 0;k(e,cr.UnexpectedToken,e.value)}k(e,cr.UnexpectedToken,e.value)}function O(e){var t=w();(t.type!==or.Punctuator||t.value!==e)&&N(t)}function C(e){var t=w();(t.type!==or.Keyword||t.value!==e)&&N(t)}function A(e){var t=L();return t.type===or.Punctuator&&t.value===e}function D(e){var t=L();return t.type===or.Keyword&&t.value===e}function F(){var e=L(),t=e.value;return e.type!==or.Punctuator?!1:"="===t||"*="===t||"/="===t||"%="===t||"+="===t||"-="===t||"<<="===t||">>="===t||">>>="===t||"&="===t||"^="===t||"|="===t}function R(){var e,t;if(";"===fr[mr])return w(),void 0;if(t=yr,m(),yr===t){if(A(";"))return w(),void 0;e=L(),e.type===or.EOF||A("}")||N(e)}}function U(e){return e.type===lr.Identifier||e.type===lr.MemberExpression}function B(){var e=[];for(O("[");!A("]");)A(",")?(w(),e.push(null)):(e.push(ut()),A("]")||O(","));return O("]"),{type:lr.ArrayExpression,elements:e}}function j(e,t){var r,n;return r=dr,n=Bt(),t&&dr&&f(e[0].name)&&P(t,cr.StrictParamName),dr=r,{type:lr.FunctionExpression,id:null,params:e,defaults:[],body:n,rest:null,generator:!1,expression:!1}}function T(){var e=w();return e.type===or.StringLiteral||e.type===or.NumericLiteral?(dr&&e.octal&&P(e,cr.StrictOctalLiteral),Zt(e)):{type:lr.Identifier,name:e.value}}function q(){var e,t,r,n;return e=L(),e.type===or.Identifier?(r=T(),"get"!==e.value||A(":")?"set"!==e.value||A(":")?(O(":"),{type:lr.Property,key:r,value:ut(),kind:"init"}):(t=T(),O("("),e=L(),e.type!==or.Identifier?(O(")"),P(e,cr.UnexpectedToken,e.value),{type:lr.Property,key:t,value:j([]),kind:"set"}):(n=[dt()],O(")"),{type:lr.Property,key:t,value:j(n,e),kind:"set"})):(t=T(),O("("),O(")"),{type:lr.Property,key:t,value:j([]),kind:"get"})):e.type!==or.EOF&&e.type!==or.Punctuator?(t=T(),O(":"),{type:lr.Property,key:t,value:ut(),kind:"init"}):(N(e),void 0)}function M(){var e,t,r,n=[],a={},i=String;for(O("{");!A("}");)e=q(),t=e.key.type===lr.Identifier?e.key.name:i(e.key.value),r="init"===e.kind?ur.Data:"get"===e.kind?ur.Get:ur.Set,Object.prototype.hasOwnProperty.call(a,t)?(a[t]===ur.Data?dr&&r===ur.Data?P({},cr.StrictDuplicateProperty):r!==ur.Data&&P({},cr.AccessorDataProperty):r===ur.Data?P({},cr.AccessorDataProperty):a[t]&r&&P({},cr.AccessorGetSet),a[t]|=r):a[t]=r,n.push(e),A("}")||O(",");return O("}"),{type:lr.ObjectExpression,properties:n}}function G(){var e;return O("("),e=ct(),O(")"),e}function V(){var e=L(),t=e.type;if(t===or.Identifier)return{type:lr.Identifier,name:w().value};if(t===or.StringLiteral||t===or.NumericLiteral)return dr&&e.octal&&P(e,cr.StrictOctalLiteral),Zt(w());if(t===or.Keyword){if(D("this"))return w(),{type:lr.ThisExpression};if(D("function"))return Tt()}return t===or.BooleanLiteral?(w(),e.value="true"===e.value,Zt(e)):t===or.NullLiteral?(w(),e.value=null,Zt(e)):A("[")?B():A("{")?M():A("(")?G():A("/")||A("/=")?Zt(S()):N(w())}function H(){var e=[];if(O("("),!A(")"))for(;gr>mr&&(e.push(ut()),!A(")"));)O(",");return O(")"),e}function W(){var e=w();return b(e)||N(e),{type:lr.Identifier,name:e.value}}function K(){return O("."),W()}function z(){var e;return O("["),e=ct(),O("]"),e}function X(){var e;return C("new"),e={type:lr.NewExpression,callee:$(),arguments:[]},A("(")&&(e.arguments=H()),e}function Z(){var e;for(e=D("new")?X():V();A(".")||A("[")||A("(");)e=A("(")?{type:lr.CallExpression,callee:e,arguments:H()}:A("[")?{type:lr.MemberExpression,computed:!0,object:e,property:z()}:{type:lr.MemberExpression,computed:!1,object:e,property:K()};return e}function $(){var e;for(e=D("new")?X():V();A(".")||A("[");)e=A("[")?{type:lr.MemberExpression,computed:!0,object:e,property:z()}:{type:lr.MemberExpression,computed:!1,object:e,property:K()};return e}function _(){var e,t=Z();return e=L(),e.type!==or.Punctuator?t:(!A("++")&&!A("--")||I()||(dr&&t.type===lr.Identifier&&f(t.name)&&P({},cr.StrictLHSPostfix),U(t)||k({},cr.InvalidLHSInAssignment),t={type:lr.UpdateExpression,operator:w().value,argument:t,prefix:!1}),t)}function J(){var e,t;return e=L(),e.type!==or.Punctuator&&e.type!==or.Keyword?_():A("++")||A("--")?(e=w(),t=J(),dr&&t.type===lr.Identifier&&f(t.name)&&P({},cr.StrictLHSPrefix),U(t)||k({},cr.InvalidLHSInAssignment),t={type:lr.UpdateExpression,operator:e.value,argument:t,prefix:!0}):A("+")||A("-")||A("~")||A("!")?t={type:lr.UnaryExpression,operator:w().value,argument:J(),prefix:!0}:D("delete")||D("void")||D("typeof")?(t={type:lr.UnaryExpression,operator:w().value,argument:J(),prefix:!0},dr&&"delete"===t.operator&&t.argument.type===lr.Identifier&&P({},cr.StrictDelete),t):_()}function Q(){for(var e=J();A("*")||A("/")||A("%");)e={type:lr.BinaryExpression,operator:w().value,left:e,right:J()};return e}function Y(){for(var e=Q();A("+")||A("-");)e={type:lr.BinaryExpression,operator:w().value,left:e,right:Q()};return e}function et(){for(var e=Y();A("<<")||A(">>")||A(">>>");)e={type:lr.BinaryExpression,operator:w().value,left:e,right:Y()};return e}function tt(){var e,t;for(t=hr.allowIn,hr.allowIn=!0,e=et();A("<")||A(">")||A("<=")||A(">=")||t&&D("in")||D("instanceof");)e={type:lr.BinaryExpression,operator:w().value,left:e,right:et()};return hr.allowIn=t,e}function rt(){for(var e=tt();A("==")||A("!=")||A("===")||A("!==");)e={type:lr.BinaryExpression,operator:w().value,left:e,right:tt()};return e}function nt(){for(var e=rt();A("&");)w(),e={type:lr.BinaryExpression,operator:"&",left:e,right:rt()};return e}function at(){for(var e=nt();A("^");)w(),e={type:lr.BinaryExpression,operator:"^",left:e,right:nt()};return e}function it(){for(var e=at();A("|");)w(),e={type:lr.BinaryExpression,operator:"|",left:e,right:at()};return e}function ot(){for(var e=it();A("&&");)w(),e={type:lr.LogicalExpression,operator:"&&",left:e,right:it()};return e}function st(){for(var e=ot();A("||");)w(),e={type:lr.LogicalExpression,operator:"||",left:e,right:ot()};return e}function lt(){var e,t,r;return e=st(),A("?")&&(w(),t=hr.allowIn,hr.allowIn=!0,r=ut(),hr.allowIn=t,O(":"),e={type:lr.ConditionalExpression,test:e,consequent:r,alternate:ut()}),e}function ut(){var e,t;return e=L(),t=lt(),F()&&(U(t)||k({},cr.InvalidLHSInAssignment),dr&&t.type===lr.Identifier&&f(t.name)&&P(e,cr.StrictLHSAssignment),t={type:lr.AssignmentExpression,operator:w().value,left:t,right:ut()}),t}function ct(){var e=ut();if(A(","))for(e={type:lr.SequenceExpression,expressions:[e]};gr>mr&&A(",");)w(),e.expressions.push(ut());return e}function pt(){for(var e,t=[];gr>mr&&!A("}")&&(e=qt(),void 0!==e);)t.push(e);return t}function ft(){var e;return O("{"),e=pt(),O("}"),{type:lr.BlockStatement,body:e}}function dt(){var e=w();return e.type!==or.Identifier&&N(e),{type:lr.Identifier,name:e.value}}function mt(e){var t=dt(),r=null;return dr&&f(t.name)&&P({},cr.StrictVarName),"const"===e?(O("="),r=ut()):A("=")&&(w(),r=ut()),{type:lr.VariableDeclarator,id:t,init:r}}function yt(e){var t=[];do{if(t.push(mt(e)),!A(","))break;w()}while(gr>mr);return t}function vt(){var e;return C("var"),e=yt(),R(),{type:lr.VariableDeclaration,declarations:e,kind:"var"}}function gt(e){var t;return C(e),t=yt(e),R(),{type:lr.VariableDeclaration,declarations:t,kind:e}}function xt(){return O(";"),{type:lr.EmptyStatement}}function ht(){var e=ct();return R(),{type:lr.ExpressionStatement,expression:e}}function St(){var e,t,r;return C("if"),O("("),e=ct(),O(")"),t=Ut(),D("else")?(w(),r=Ut()):r=null,{type:lr.IfStatement,test:e,consequent:t,alternate:r}}function bt(){var e,t,r;return C("do"),r=hr.inIteration,hr.inIteration=!0,e=Ut(),hr.inIteration=r,C("while"),O("("),t=ct(),O(")"),A(";")&&w(),{type:lr.DoWhileStatement,body:e,test:t}}function Et(){var e,t,r;return C("while"),O("("),e=ct(),O(")"),r=hr.inIteration,hr.inIteration=!0,t=Ut(),hr.inIteration=r,{type:lr.WhileStatement,test:e,body:t}}function wt(){var e=w();return{type:lr.VariableDeclaration,declarations:yt(),kind:e.value}}function Lt(){var e,t,r,n,a,i,o;return e=t=r=null,C("for"),O("("),A(";")?w():(D("var")||D("let")?(hr.allowIn=!1,e=wt(),hr.allowIn=!0,1===e.declarations.length&&D("in")&&(w(),n=e,a=ct(),e=null)):(hr.allowIn=!1,e=ct(),hr.allowIn=!0,D("in")&&(U(e)||k({},cr.InvalidLHSInForIn),w(),n=e,a=ct(),e=null)),n===void 0&&O(";")),n===void 0&&(A(";")||(t=ct()),O(";"),A(")")||(r=ct())),O(")"),o=hr.inIteration,hr.inIteration=!0,i=Ut(),hr.inIteration=o,n===void 0?{type:lr.ForStatement,init:e,test:t,update:r,body:i}:{type:lr.ForInStatement,left:n,right:a,body:i,each:!1}}function It(){var e,t=null;return C("continue"),";"===fr[mr]?(w(),hr.inIteration||k({},cr.IllegalContinue),{type:lr.ContinueStatement,label:null}):I()?(hr.inIteration||k({},cr.IllegalContinue),{type:lr.ContinueStatement,label:null}):(e=L(),e.type===or.Identifier&&(t=dt(),Object.prototype.hasOwnProperty.call(hr.labelSet,t.name)||k({},cr.UnknownLabel,t.name)),R(),null!==t||hr.inIteration||k({},cr.IllegalContinue),{type:lr.ContinueStatement,label:t})}function kt(){var e,t=null;return C("break"),";"===fr[mr]?(w(),hr.inIteration||hr.inSwitch||k({},cr.IllegalBreak),{type:lr.BreakStatement,label:null}):I()?(hr.inIteration||hr.inSwitch||k({},cr.IllegalBreak),{type:lr.BreakStatement,label:null}):(e=L(),e.type===or.Identifier&&(t=dt(),Object.prototype.hasOwnProperty.call(hr.labelSet,t.name)||k({},cr.UnknownLabel,t.name)),R(),null!==t||hr.inIteration||hr.inSwitch||k({},cr.IllegalBreak),{type:lr.BreakStatement,label:t})}function Pt(){var e,t=null;return C("return"),hr.inFunctionBody||P({},cr.IllegalReturn)," "===fr[mr]&&l(fr[mr+1])?(t=ct(),R(),{type:lr.ReturnStatement,argument:t}):I()?{type:lr.ReturnStatement,argument:null}:(A(";")||(e=L(),A("}")||e.type===or.EOF||(t=ct())),R(),{type:lr.ReturnStatement,argument:t})}function Nt(){var e,t;return dr&&P({},cr.StrictModeWith),C("with"),O("("),e=ct(),O(")"),t=Ut(),{type:lr.WithStatement,object:e,body:t}}function Ot(){var e,t,r=[];for(D("default")?(w(),e=null):(C("case"),e=ct()),O(":");gr>mr&&!(A("}")||D("default")||D("case"))&&(t=Ut(),void 0!==t);)r.push(t);return{type:lr.SwitchCase,test:e,consequent:r}}function Ct(){var e,t,r,n,a;if(C("switch"),O("("),e=ct(),O(")"),O("{"),A("}"))return w(),{type:lr.SwitchStatement,discriminant:e};for(t=[],n=hr.inSwitch,hr.inSwitch=!0,a=!1;gr>mr&&!A("}");)r=Ot(),null===r.test&&(a&&k({},cr.MultipleDefaultsInSwitch),a=!0),t.push(r);return hr.inSwitch=n,O("}"),{type:lr.SwitchStatement,discriminant:e,cases:t}}function At(){var e;return C("throw"),I()&&k({},cr.NewlineAfterThrow),e=ct(),R(),{type:lr.ThrowStatement,argument:e}}function Dt(){var e;return C("catch"),O("("),A(")")&&N(L()),e=dt(),dr&&f(e.name)&&P({},cr.StrictCatchVariable),O(")"),{type:lr.CatchClause,param:e,body:ft()}}function Ft(){var e,t=[],r=null;return C("try"),e=ft(),D("catch")&&t.push(Dt()),D("finally")&&(w(),r=ft()),0!==t.length||r||k({},cr.NoCatchOrFinally),{type:lr.TryStatement,block:e,guardedHandlers:[],handlers:t,finalizer:r}}function Rt(){return C("debugger"),R(),{type:lr.DebuggerStatement}}function Ut(){var e,t,r=L();if(r.type===or.EOF&&N(r),r.type===or.Punctuator)switch(r.value){case";":return xt();case"{":return ft();case"(":return ht();default:}if(r.type===or.Keyword)switch(r.value){case"break":return kt();case"continue":return It();case"debugger":return Rt();case"do":return bt();case"for":return Lt();case"function":return jt();case"if":return St();case"return":return Pt();case"switch":return Ct();case"throw":return At();case"try":return Ft();case"var":return vt();case"while":return Et();case"with":return Nt();default:}return e=ct(),e.type===lr.Identifier&&A(":")?(w(),Object.prototype.hasOwnProperty.call(hr.labelSet,e.name)&&k({},cr.Redeclaration,"Label",e.name),hr.labelSet[e.name]=!0,t=Ut(),delete hr.labelSet[e.name],{type:lr.LabeledStatement,label:e,body:t}):(R(),{type:lr.ExpressionStatement,expression:e})}function Bt(){var e,t,n,a,i,o,s,l,u=[];for(O("{");gr>mr&&(t=L(),t.type===or.StringLiteral)&&(e=qt(),u.push(e),e.expression.type===lr.Literal);)n=r(t.range[0]+1,t.range[1]-1),"use strict"===n?(dr=!0,a&&P(a,cr.StrictOctalLiteral)):!a&&t.octal&&(a=t);for(i=hr.labelSet,o=hr.inIteration,s=hr.inSwitch,l=hr.inFunctionBody,hr.labelSet={},hr.inIteration=!1,hr.inSwitch=!1,hr.inFunctionBody=!0;gr>mr&&!A("}")&&(e=qt(),void 0!==e);)u.push(e);return O("}"),hr.labelSet=i,hr.inIteration=o,hr.inSwitch=s,hr.inFunctionBody=l,{type:lr.BlockStatement,body:u}}function jt(){var e,t,r,n,a,i,o,s,l,u=[];if(C("function"),n=L(),e=dt(),dr?f(n.value)&&P(n,cr.StrictFunctionName):f(n.value)?(i=n,o=cr.StrictFunctionName):p(n.value)&&(i=n,o=cr.StrictReservedWord),O("("),!A(")"))for(l={};gr>mr&&(n=L(),t=dt(),dr?(f(n.value)&&(a=n,o=cr.StrictParamName),Object.prototype.hasOwnProperty.call(l,n.value)&&(a=n,o=cr.StrictParamDupe)):i||(f(n.value)?(i=n,o=cr.StrictParamName):p(n.value)?(i=n,o=cr.StrictReservedWord):Object.prototype.hasOwnProperty.call(l,n.value)&&(i=n,o=cr.StrictParamDupe)),u.push(t),l[t.name]=!0,!A(")"));)O(",");return O(")"),s=dr,r=Bt(),dr&&i&&k(i,o),dr&&a&&P(a,o),dr=s,{type:lr.FunctionDeclaration,id:e,params:u,defaults:[],body:r,rest:null,generator:!1,expression:!1}}function Tt(){var e,t,r,n,a,i,o,s,l=null,u=[];if(C("function"),A("(")||(e=L(),l=dt(),dr?f(e.value)&&P(e,cr.StrictFunctionName):f(e.value)?(r=e,n=cr.StrictFunctionName):p(e.value)&&(r=e,n=cr.StrictReservedWord)),O("("),!A(")"))for(s={};gr>mr&&(e=L(),a=dt(),dr?(f(e.value)&&(t=e,n=cr.StrictParamName),Object.prototype.hasOwnProperty.call(s,e.value)&&(t=e,n=cr.StrictParamDupe)):r||(f(e.value)?(r=e,n=cr.StrictParamName):p(e.value)?(r=e,n=cr.StrictReservedWord):Object.prototype.hasOwnProperty.call(s,e.value)&&(r=e,n=cr.StrictParamDupe)),u.push(a),s[a.name]=!0,!A(")"));)O(",");return O(")"),o=dr,i=Bt(),dr&&r&&k(r,n),dr&&t&&P(t,n),dr=o,{type:lr.FunctionExpression,id:l,params:u,defaults:[],body:i,rest:null,generator:!1,expression:!1}}function qt(){var e=L();if(e.type===or.Keyword)switch(e.value){case"const":case"let":return gt(e.value);case"function":return jt();default:return Ut()}return e.type!==or.EOF?Ut():void 0}function Mt(){for(var e,t,n,a,i=[];gr>mr&&(t=L(),t.type===or.StringLiteral)&&(e=qt(),i.push(e),e.expression.type===lr.Literal);)n=r(t.range[0]+1,t.range[1]-1),"use strict"===n?(dr=!0,a&&P(a,cr.StrictOctalLiteral)):!a&&t.octal&&(a=t);for(;gr>mr&&(e=qt(),void 0!==e);)i.push(e);return i}function Gt(){var e;return dr=!1,e={type:lr.Program,body:Mt()}}function Vt(e,r,n,a,i){t("number"==typeof n,"Comment must have valid position"),Sr.comments.length>0&&Sr.comments[Sr.comments.length-1].range[1]>n||Sr.comments.push({type:e,value:r,range:[n,a],loc:i})}function Ht(){var e,t,r,n,a,i;for(e="",a=!1,i=!1;gr>mr;)if(t=fr[mr],i)t=fr[mr++],s(t)?(r.end={line:yr,column:mr-vr-1},i=!1,Vt("Line",e,n,mr-1,r),"\r"===t&&"\n"===fr[mr]&&++mr,++yr,vr=mr,e=""):mr>=gr?(i=!1,e+=t,r.end={line:yr,column:gr-vr},Vt("Line",e,n,gr,r)):e+=t;else if(a)s(t)?("\r"===t&&"\n"===fr[mr+1]?(++mr,e+="\r\n"):e+=t,++yr,++mr,vr=mr,mr>=gr&&k({},cr.UnexpectedToken,"ILLEGAL")):(t=fr[mr++],mr>=gr&&k({},cr.UnexpectedToken,"ILLEGAL"),e+=t,"*"===t&&(t=fr[mr],"/"===t&&(e=e.substr(0,e.length-1),a=!1,++mr,r.end={line:yr,column:mr-vr},Vt("Block",e,n,mr,r),e="")));else if("/"===t)if(t=fr[mr+1],"/"===t)r={start:{line:yr,column:mr-vr}},n=mr,mr+=2,i=!0,mr>=gr&&(r.end={line:yr,column:mr-vr},i=!1,Vt("Line",e,n,mr,r));else{if("*"!==t)break;n=mr,mr+=2,a=!0,r={start:{line:yr,column:mr-vr-2}},mr>=gr&&k({},cr.UnexpectedToken,"ILLEGAL")}else if(o(t))++mr;else{if(!s(t))break;++mr,"\r"===t&&"\n"===fr[mr]&&++mr,++yr,vr=mr}}function Wt(){var e,t,r,n=[];for(e=0;Sr.comments.length>e;++e)t=Sr.comments[e],r={type:t.type,value:t.value},Sr.range&&(r.range=t.range),Sr.loc&&(r.loc=t.loc),n.push(r);Sr.comments=n}function Kt(){var e,t,n,a,i;return m(),e=mr,t={start:{line:yr,column:mr-vr}},n=Sr.advance(),t.end={line:yr,column:mr-vr},n.type!==or.EOF&&(a=[n.range[0],n.range[1]],i=r(n.range[0],n.range[1]),Sr.tokens.push({type:sr[n.type],value:i,range:a,loc:t})),n}function zt(){var e,t,r,n;return m(),e=mr,t={start:{line:yr,column:mr-vr}},r=Sr.scanRegExp(),t.end={line:yr,column:mr-vr},Sr.tokens.length>0&&(n=Sr.tokens[Sr.tokens.length-1],n.range[0]===e&&"Punctuator"===n.type&&("/"===n.value||"/="===n.value)&&Sr.tokens.pop()),Sr.tokens.push({type:"RegularExpression",value:r.literal,range:[e,mr],loc:t}),r}function Xt(){var e,t,r,n=[];for(e=0;Sr.tokens.length>e;++e)t=Sr.tokens[e],r={type:t.type,value:t.value},Sr.range&&(r.range=t.range),Sr.loc&&(r.loc=t.loc),n.push(r);Sr.tokens=n}function Zt(e){return{type:lr.Literal,value:e.value}}function $t(e){return{type:lr.Literal,value:e.value,raw:r(e.range[0],e.range[1])}}function _t(){var e={};return e.range=[mr,mr],e.loc={start:{line:yr,column:mr-vr},end:{line:yr,column:mr-vr}},e.end=function(){this.range[1]=mr,this.loc.end.line=yr,this.loc.end.column=mr-vr},e.applyGroup=function(e){Sr.range&&(e.groupRange=[this.range[0],this.range[1]]),Sr.loc&&(e.groupLoc={start:{line:this.loc.start.line,column:this.loc.start.column},end:{line:this.loc.end.line,column:this.loc.end.column}})},e.apply=function(e){Sr.range&&(e.range=[this.range[0],this.range[1]]),Sr.loc&&(e.loc={start:{line:this.loc.start.line,column:this.loc.start.column},end:{line:this.loc.end.line,column:this.loc.end.column}})},e}function Jt(){var e,t;return m(),e=_t(),O("("),t=ct(),O(")"),e.end(),e.applyGroup(t),t}function Qt(){var e,t;for(m(),e=_t(),t=D("new")?X():V();A(".")||A("[");)A("[")?(t={type:lr.MemberExpression,computed:!0,object:t,property:z()},e.end(),e.apply(t)):(t={type:lr.MemberExpression,computed:!1,object:t,property:K()},e.end(),e.apply(t));return t}function Yt(){var e,t;for(m(),e=_t(),t=D("new")?X():V();A(".")||A("[")||A("(");)A("(")?(t={type:lr.CallExpression,callee:t,arguments:H()},e.end(),e.apply(t)):A("[")?(t={type:lr.MemberExpression,computed:!0,object:t,property:z()},e.end(),e.apply(t)):(t={type:lr.MemberExpression,computed:!1,object:t,property:K()},e.end(),e.apply(t));return t}function er(e){var t,r,n;t="[object Array]"===Object.prototype.toString.apply(e)?[]:{};for(r in e)e.hasOwnProperty(r)&&"groupRange"!==r&&"groupLoc"!==r&&(n=e[r],t[r]=null===n||"object"!=typeof n||n instanceof RegExp?n:er(n));return t}function tr(e,t){return function(r){function n(e){return e.type===lr.LogicalExpression||e.type===lr.BinaryExpression}function a(r){var i,o;n(r.left)&&a(r.left),n(r.right)&&a(r.right),e&&(r.left.groupRange||r.right.groupRange?(i=r.left.groupRange?r.left.groupRange[0]:r.left.range[0],o=r.right.groupRange?r.right.groupRange[1]:r.right.range[1],r.range=[i,o]):r.range===void 0&&(i=r.left.range[0],o=r.right.range[1],r.range=[i,o])),t&&(r.left.groupLoc||r.right.groupLoc?(i=r.left.groupLoc?r.left.groupLoc.start:r.left.loc.start,o=r.right.groupLoc?r.right.groupLoc.end:r.right.loc.end,r.loc={start:i,end:o}):r.loc===void 0&&(r.loc={start:r.left.loc.start,end:r.right.loc.end}))}return function(){var i,o;return m(),i=_t(),o=r.apply(null,arguments),i.end(),e&&o.range===void 0&&i.apply(o),t&&o.loc===void 0&&i.apply(o),n(o)&&a(o),o}}}function rr(){var e;Sr.comments&&(Sr.skipComment=m,m=Ht),Sr.raw&&(Sr.createLiteral=Zt,Zt=$t),(Sr.range||Sr.loc)&&(Sr.parseGroupExpression=G,Sr.parseLeftHandSideExpression=$,Sr.parseLeftHandSideExpressionAllowCall=Z,G=Jt,$=Qt,Z=Yt,e=tr(Sr.range,Sr.loc),Sr.parseAdditiveExpression=Y,Sr.parseAssignmentExpression=ut,Sr.parseBitwiseANDExpression=nt,Sr.parseBitwiseORExpression=it,Sr.parseBitwiseXORExpression=at,Sr.parseBlock=ft,Sr.parseFunctionSourceElements=Bt,Sr.parseCatchClause=Dt,Sr.parseComputedMember=z,Sr.parseConditionalExpression=lt,Sr.parseConstLetDeclaration=gt,Sr.parseEqualityExpression=rt,Sr.parseExpression=ct,Sr.parseForVariableDeclaration=wt,Sr.parseFunctionDeclaration=jt,Sr.parseFunctionExpression=Tt,Sr.parseLogicalANDExpression=ot,Sr.parseLogicalORExpression=st,Sr.parseMultiplicativeExpression=Q,Sr.parseNewExpression=X,Sr.parseNonComputedProperty=W,Sr.parseObjectProperty=q,Sr.parseObjectPropertyKey=T,Sr.parsePostfixExpression=_,Sr.parsePrimaryExpression=V,Sr.parseProgram=Gt,Sr.parsePropertyFunction=j,Sr.parseRelationalExpression=tt,Sr.parseStatement=Ut,Sr.parseShiftExpression=et,Sr.parseSwitchCase=Ot,Sr.parseUnaryExpression=J,Sr.parseVariableDeclaration=mt,Sr.parseVariableIdentifier=dt,Y=e(Sr.parseAdditiveExpression),ut=e(Sr.parseAssignmentExpression),nt=e(Sr.parseBitwiseANDExpression),it=e(Sr.parseBitwiseORExpression),at=e(Sr.parseBitwiseXORExpression),ft=e(Sr.parseBlock),Bt=e(Sr.parseFunctionSourceElements),Dt=e(Sr.parseCatchClause),z=e(Sr.parseComputedMember),lt=e(Sr.parseConditionalExpression),gt=e(Sr.parseConstLetDeclaration),rt=e(Sr.parseEqualityExpression),ct=e(Sr.parseExpression),wt=e(Sr.parseForVariableDeclaration),jt=e(Sr.parseFunctionDeclaration),Tt=e(Sr.parseFunctionExpression),$=e($),ot=e(Sr.parseLogicalANDExpression),st=e(Sr.parseLogicalORExpression),Q=e(Sr.parseMultiplicativeExpression),X=e(Sr.parseNewExpression),W=e(Sr.parseNonComputedProperty),q=e(Sr.parseObjectProperty),T=e(Sr.parseObjectPropertyKey),_=e(Sr.parsePostfixExpression),V=e(Sr.parsePrimaryExpression),Gt=e(Sr.parseProgram),j=e(Sr.parsePropertyFunction),tt=e(Sr.parseRelationalExpression),Ut=e(Sr.parseStatement),et=e(Sr.parseShiftExpression),Ot=e(Sr.parseSwitchCase),J=e(Sr.parseUnaryExpression),mt=e(Sr.parseVariableDeclaration),dt=e(Sr.parseVariableIdentifier)),Sr.tokens!==void 0&&(Sr.advance=E,Sr.scanRegExp=S,E=Kt,S=zt)}function nr(){"function"==typeof Sr.skipComment&&(m=Sr.skipComment),Sr.raw&&(Zt=Sr.createLiteral),(Sr.range||Sr.loc)&&(Y=Sr.parseAdditiveExpression,ut=Sr.parseAssignmentExpression,nt=Sr.parseBitwiseANDExpression,it=Sr.parseBitwiseORExpression,at=Sr.parseBitwiseXORExpression,ft=Sr.parseBlock,Bt=Sr.parseFunctionSourceElements,Dt=Sr.parseCatchClause,z=Sr.parseComputedMember,lt=Sr.parseConditionalExpression,gt=Sr.parseConstLetDeclaration,rt=Sr.parseEqualityExpression,ct=Sr.parseExpression,wt=Sr.parseForVariableDeclaration,jt=Sr.parseFunctionDeclaration,Tt=Sr.parseFunctionExpression,G=Sr.parseGroupExpression,$=Sr.parseLeftHandSideExpression,Z=Sr.parseLeftHandSideExpressionAllowCall,ot=Sr.parseLogicalANDExpression,st=Sr.parseLogicalORExpression,Q=Sr.parseMultiplicativeExpression,X=Sr.parseNewExpression,W=Sr.parseNonComputedProperty,q=Sr.parseObjectProperty,T=Sr.parseObjectPropertyKey,V=Sr.parsePrimaryExpression,_=Sr.parsePostfixExpression,Gt=Sr.parseProgram,j=Sr.parsePropertyFunction,tt=Sr.parseRelationalExpression,Ut=Sr.parseStatement,et=Sr.parseShiftExpression,Ot=Sr.parseSwitchCase,J=Sr.parseUnaryExpression,mt=Sr.parseVariableDeclaration,dt=Sr.parseVariableIdentifier),"function"==typeof Sr.scanRegExp&&(E=Sr.advance,S=Sr.scanRegExp)
}function ar(e){var t,r=e.length,n=[];for(t=0;r>t;++t)n[t]=e.charAt(t);return n}function ir(e,t){var r,n;n=String,"string"==typeof e||e instanceof String||(e=n(e)),fr=e,mr=0,yr=fr.length>0?1:0,vr=0,gr=fr.length,xr=null,hr={allowIn:!0,labelSet:{},inFunctionBody:!1,inIteration:!1,inSwitch:!1},Sr={},t!==void 0&&(Sr.range="boolean"==typeof t.range&&t.range,Sr.loc="boolean"==typeof t.loc&&t.loc,Sr.raw="boolean"==typeof t.raw&&t.raw,"boolean"==typeof t.tokens&&t.tokens&&(Sr.tokens=[]),"boolean"==typeof t.comment&&t.comment&&(Sr.comments=[]),"boolean"==typeof t.tolerant&&t.tolerant&&(Sr.errors=[])),gr>0&&fr[0]===void 0&&(e instanceof String&&(fr=e.valueOf()),fr[0]===void 0&&(fr=ar(e))),rr();try{r=Gt(),Sr.comments!==void 0&&(Wt(),r.comments=Sr.comments),Sr.tokens!==void 0&&(Xt(),r.tokens=Sr.tokens),Sr.errors!==void 0&&(r.errors=Sr.errors),(Sr.range||Sr.loc)&&(r.body=er(r.body))}catch(a){throw a}finally{nr(),Sr={}}return r}var or,sr,lr,ur,cr,pr,fr,dr,mr,yr,vr,gr,xr,hr,Sr;or={BooleanLiteral:1,EOF:2,Identifier:3,Keyword:4,NullLiteral:5,NumericLiteral:6,Punctuator:7,StringLiteral:8},sr={},sr[or.BooleanLiteral]="Boolean",sr[or.EOF]="<end>",sr[or.Identifier]="Identifier",sr[or.Keyword]="Keyword",sr[or.NullLiteral]="Null",sr[or.NumericLiteral]="Numeric",sr[or.Punctuator]="Punctuator",sr[or.StringLiteral]="String",lr={AssignmentExpression:"AssignmentExpression",ArrayExpression:"ArrayExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DoWhileStatement:"DoWhileStatement",DebuggerStatement:"DebuggerStatement",EmptyStatement:"EmptyStatement",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",Identifier:"Identifier",IfStatement:"IfStatement",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",Program:"Program",Property:"Property",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement"},ur={Data:1,Get:2,Set:4},cr={UnexpectedToken:"Unexpected token %0",UnexpectedNumber:"Unexpected number",UnexpectedString:"Unexpected string",UnexpectedIdentifier:"Unexpected identifier",UnexpectedReserved:"Unexpected reserved word",UnexpectedEOS:"Unexpected end of input",NewlineAfterThrow:"Illegal newline after throw",InvalidRegExp:"Invalid regular expression",UnterminatedRegExp:"Invalid regular expression: missing /",InvalidLHSInAssignment:"Invalid left-hand side in assignment",InvalidLHSInForIn:"Invalid left-hand side in for-in",MultipleDefaultsInSwitch:"More than one default clause in switch statement",NoCatchOrFinally:"Missing catch or finally after try",UnknownLabel:"Undefined label '%0'",Redeclaration:"%0 '%1' has already been declared",IllegalContinue:"Illegal continue statement",IllegalBreak:"Illegal break statement",IllegalReturn:"Illegal return statement",StrictModeWith:"Strict mode code may not include a with statement",StrictCatchVariable:"Catch variable may not be eval or arguments in strict mode",StrictVarName:"Variable name may not be eval or arguments in strict mode",StrictParamName:"Parameter name eval or arguments is not allowed in strict mode",StrictParamDupe:"Strict mode function may not have duplicate parameter names",StrictFunctionName:"Function name may not be eval or arguments in strict mode",StrictOctalLiteral:"Octal literals are not allowed in strict mode.",StrictDelete:"Delete of an unqualified identifier in strict mode.",StrictDuplicateProperty:"Duplicate data property in object literal not allowed in strict mode",AccessorDataProperty:"Object literal may not have data and accessor property with the same name",AccessorGetSet:"Object literal may not have multiple get/set accessors with the same name",StrictLHSAssignment:"Assignment to eval or arguments is not allowed in strict mode",StrictLHSPostfix:"Postfix increment/decrement may not have eval or arguments operand in strict mode",StrictLHSPrefix:"Prefix increment/decrement may not have eval or arguments operand in strict mode",StrictReservedWord:"Use of future reserved word in strict mode"},pr={NonAsciiIdentifierStart:RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԧԱ-Ֆՙա-ևא-תװ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࢠࢢ-ࢬऄ-हऽॐक़-ॡॱ-ॷॹ-ॿঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-ళవ-హఽౘౙౠౡಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೞೠೡೱೲഅ-ഌഎ-ഐഒ-ഺഽൎൠൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-ᜑᜠ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡷᢀ-ᢨᢪᢰ-ᣵᤀ-ᤜᥐ-ᥭᥰ-ᥴᦀ-ᦫᧁ-ᧇᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭋᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᳩ-ᳬᳮ-ᳱᳵᳶᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⸯ々-〇〡-〩〱-〵〸-〼ぁ-ゖゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚗꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꪀ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]"),NonAsciiIdentifierPart:RegExp("[ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮ̀-ʹͶͷͺ-ͽΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁ҃-҇Ҋ-ԧԱ-Ֆՙա-և֑-ׇֽֿׁׂׅׄא-תװ-ײؐ-ؚؠ-٩ٮ-ۓە-ۜ۟-۪ۨ-ۼۿܐ-݊ݍ-ޱ߀-ߵߺࠀ-࠭ࡀ-࡛ࢠࢢ-ࢬࣤ-ࣾऀ-ॣ०-९ॱ-ॷॹ-ॿঁ-ঃঅ-ঌএঐও-নপ-রলশ-হ়-ৄেৈো-ৎৗড়ঢ়য়-ৣ০-ৱਁ-ਃਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹ਼ਾ-ੂੇੈੋ-੍ੑਖ਼-ੜਫ਼੦-ੵઁ-ઃઅ-ઍએ-ઑઓ-નપ-રલળવ-હ઼-ૅે-ૉો-્ૐૠ-ૣ૦-૯ଁ-ଃଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହ଼-ୄେୈୋ-୍ୖୗଡ଼ଢ଼ୟ-ୣ୦-୯ୱஂஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹா-ூெ-ைொ-்ௐௗ௦-௯ఁ-ఃఅ-ఌఎ-ఐఒ-నప-ళవ-హఽ-ౄె-ైొ-్ౕౖౘౙౠ-ౣ౦-౯ಂಃಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹ಼-ೄೆ-ೈೊ-್ೕೖೞೠ-ೣ೦-೯ೱೲംഃഅ-ഌഎ-ഐഒ-ഺഽ-ൄെ-ൈൊ-ൎൗൠ-ൣ൦-൯ൺ-ൿංඃඅ-ඖක-නඳ-රලව-ෆ්ා-ුූෘ-ෟෲෳก-ฺเ-๎๐-๙ກຂຄງຈຊຍດ-ທນ-ຟມ-ຣລວສຫອ-ູົ-ຽເ-ໄໆ່-ໍ໐-໙ໜ-ໟༀ༘༙༠-༩༹༵༷༾-ཇཉ-ཬཱ-྄྆-ྗྙ-ྼ࿆က-၉ၐ-ႝႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚ፝-፟ᎀ-ᎏᎠ-Ᏼᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛰᜀ-ᜌᜎ-᜔ᜠ-᜴ᝀ-ᝓᝠ-ᝬᝮ-ᝰᝲᝳក-៓ៗៜ៝០-៩᠋-᠍᠐-᠙ᠠ-ᡷᢀ-ᢪᢰ-ᣵᤀ-ᤜᤠ-ᤫᤰ-᤻᥆-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉ᧐-᧙ᨀ-ᨛᨠ-ᩞ᩠-᩿᩼-᪉᪐-᪙ᪧᬀ-ᭋ᭐-᭙᭫-᭳ᮀ-᯳ᰀ-᰷᱀-᱉ᱍ-ᱽ᳐-᳔᳒-ᳶᴀ-ᷦ᷼-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼ‌‍‿⁀⁔ⁱⁿₐ-ₜ⃐-⃥⃜⃡-⃰ℂℇℊ-ℓℕℙ-ℝℤΩℨK-ℭℯ-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-Ⱞⰰ-ⱞⱠ-ⳤⳫ-ⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯ⵿-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞⷠ-ⷿⸯ々-〇〡-〯〱-〵〸-〼ぁ-ゖ゙゚ゝ-ゟァ-ヺー-ヿㄅ-ㄭㄱ-ㆎㆠ-ㆺㇰ-ㇿ㐀-䶵一-鿌ꀀ-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘫꙀ-꙯ꙴ-꙽ꙿ-ꚗꚟ-꛱ꜗ-ꜟꜢ-ꞈꞋ-ꞎꞐ-ꞓꞠ-Ɦꟸ-ꠧꡀ-ꡳꢀ-꣄꣐-꣙꣠-ꣷꣻ꤀-꤭ꤰ-꥓ꥠ-ꥼꦀ-꧀ꧏ-꧙ꨀ-ꨶꩀ-ꩍ꩐-꩙ꩠ-ꩶꩺꩻꪀ-ꫂꫛ-ꫝꫠ-ꫯꫲ-꫶ꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꯀ-ꯪ꯬꯭꯰-꯹가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻ︀-️︠-︦︳︴﹍-﹏ﹰ-ﹴﹶ-ﻼ0-9A-Z_a-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ]")},"esprima"[0]===void 0&&(r=function(e,t){return fr.slice(e,t).join("")}),e.version="1.0.3",e.parse=ir,e.Syntax=function(){var e,t={};"function"==typeof Object.create&&(t=Object.create(null));for(e in lr)lr.hasOwnProperty(e)&&(t[e]=lr[e]);return"function"==typeof Object.freeze&&Object.freeze(t),t}()})})()},{}]},{},[]);var treeify=require("treeify"),esprima=require("esprima"),src="var z=0,x = (function(){z++})()";alert(treeify.asTree(esprima.parse(src),!0));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment