import{Function as t,RightParenthesis as e}from"../../tokenizer/types.mjs";import"../../tokenizer/char-code-definitions.mjs";import"../../tokenizer/TokenStream.mjs";const n="FeatureFunction",i={kind:String,feature:String,value:["Declaration","Selector"]};function o(t,e){const n=(this.features[t]||{})[e];return"function"!=typeof n&&this.error(`Unknown feature ${e}()`),n}function r(t="unknown"){const n=this.tokenStart,i=this.consumeFunctionName(),r=o.call(this,t,i.toLowerCase());this.skipSC();const s=this.parseWithFallback(()=>{const t=this.tokenIndex,e=r.call(this);return!1===this.eof&&!1===this.isBalanceEdge(t)&&this.error(),e},()=>this.Raw(null,!1));return this.eof||this.eat(e),{type:"FeatureFunction",loc:this.getLocation(n,this.tokenStart),kind:t,feature:i,value:s}}function s(n){this.token(t,n.feature+"("),this.node(n.value),this.token(e,")")}export{s as generate,n as name,r as parse,i as structure};