/*
All material copyright ESRI, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.24/esri/copyright.txt for details.
*/
define(["exports","./comment-handler","./parser","./tokenizer","./syntax","./token","./nodes"],(function(e,t,r,n,o,a,s){"use strict";function i(e,n,o){let a=null;const s=(e,t)=>{o&&o(e,t),a&&a.visit(e,t)};let i="function"==typeof o?s:void 0,m=!1;if(n){m="boolean"==typeof n.comment&&n.comment;const e="boolean"==typeof n.attachComment&&n.attachComment;(m||e)&&(a=new t.CommentHandler,a.attach=e,n.comment=!0,i=s)}const p=new r.Parser(e,n,i),l=p.parseScript();return m&&a&&(l.comments=a.comments),p.config.tokens&&(l.tokens=p.tokens),p.config.tolerant&&(l.errors=p.errorHandler.errors),l}function m(e,t,r){const o=new n.Tokenizer(e,t),a=[];let s;try{for(;;){let e=o.getNextToken();if(!e)break;r&&(e=r(e)),a.push(e)}}catch(i){o.errorHandler.tolerate(i)}return o.errorHandler.tolerant&&(s=o.errors()),{tokens:a,errors:s}}const p="4.0.0-dev";e.Syntax=o.Syntax,e.TokenName=a.TokenName,Object.defineProperty(e,"TokenType",{enumerable:!0,get:()=>a.TokenType}),e.ArrayExpression=s.ArrayExpression,e.AssignmentExpression=s.AssignmentExpression,e.AssignmentOperators=s.AssignmentOperators,e.BinaryExpression=s.BinaryExpression,e.BinaryOperators=s.BinaryOperators,e.BlockStatement=s.BlockStatement,e.BreakStatement=s.BreakStatement,e.CallExpression=s.CallExpression,e.Comment=s.Comment,e.ComputedMemberExpression=s.ComputedMemberExpression,e.ContinueStatement=s.ContinueStatement,e.EmptyStatement=s.EmptyStatement,e.ExpressionStatement=s.ExpressionStatement,e.ForInStatement=s.ForInStatement,e.ForStatement=s.ForStatement,e.FunctionDeclaration=s.FunctionDeclaration,e.Identifier=s.Identifier,e.IfStatement=s.IfStatement,e.Literal=s.Literal,e.LogicalOperators=s.LogicalOperators,e.ObjectExpression=s.ObjectExpression,e.Program=s.Program,e.Property=s.Property,e.ReturnStatement=s.ReturnStatement,e.StaticMemberExpression=s.StaticMemberExpression,e.TemplateElement=s.TemplateElement,e.TemplateLiteral=s.TemplateLiteral,e.UnaryExpression=s.UnaryExpression,e.UnaryOperators=s.UnaryOperators,e.UpdateExpression=s.UpdateExpression,e.UpdateOperators=s.UpdateOperators,e.VariableDeclaration=s.VariableDeclaration,e.VariableDeclarator=s.VariableDeclarator,e.parse=i,e.tokenize=m,e.version=p,Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
