import{Colon as t,Ident as e,Function as i,RightParenthesis as n}from"../../tokenizer/types.mjs";import"../../tokenizer/char-code-definitions.mjs";import"../../tokenizer/TokenStream.mjs";const s="PseudoElementSelector",o="function",h={name:String,children:[["Raw"],null]};function r(){const s=this.tokenStart;let o,h,r=null;return this.eat(t),this.eat(t),this.tokenType===i?(o=this.consumeFunctionName(),h=o.toLowerCase(),this.lookupNonWSType(0)==n?r=this.createList():hasOwnProperty.call(this.pseudo,h)?(this.skipSC(),r=this.pseudo[h].call(this),this.skipSC()):(r=this.createList(),r.push(this.Raw(null,!1))),this.eat(n)):o=this.consume(e),{type:"PseudoElementSelector",loc:this.getLocation(s,this.tokenStart),name:o,children:r}}function l(s){this.token(t,":"),this.token(t,":"),null===s.children?this.token(e,s.name):(this.token(i,s.name+"("),this.children(s),this.token(n,")"))}export{l as generate,s as name,r as parse,h as structure,o as walkContext};