import{Function as t,LeftParenthesis as e,RightParenthesis as n}from"../../tokenizer/types.mjs";import"../../tokenizer/char-code-definitions.mjs";import"../../tokenizer/TokenStream.mjs";const i="GeneralEnclosed",o={kind:String,function:[String,null],children:[[]]};function s(i){const o=this.tokenStart;let s=null;this.tokenType===t?s=this.consumeFunctionName():this.eat(e);const r=this.parseWithFallback(()=>{const t=this.tokenIndex,e=this.readSequence(this.scope.Value);return!1===this.eof&&!1===this.isBalanceEdge(t)&&this.error(),e},()=>this.createSingleNodeList(this.Raw(null,!1)));return this.eof||this.eat(n),{type:"GeneralEnclosed",loc:this.getLocation(o,this.tokenStart),kind:i,function:s,children:r}}function r(i){i.function?this.token(t,i.function+"("):this.token(e,"("),this.children(i),this.token(n,")")}export{r as generate,i as name,s as parse,o as structure};