import{LeftParenthesis as t,RightParenthesis as i,Ident as s}from"../../tokenizer/types.mjs";import"../../tokenizer/char-code-definitions.mjs";import"../../tokenizer/TokenStream.mjs";const o="Scope",e={root:["SelectorList","Raw",null],limit:["SelectorList","Raw",null]};function h(){let o=null,e=null;this.skipSC();const h=this.tokenStart;return this.tokenType===t&&(this.next(),this.skipSC(),o=this.parseWithFallback(this.SelectorList,()=>this.Raw(!1,!0)),this.skipSC(),this.eat(i)),this.lookupNonWSType(0)===s&&(this.skipSC(),this.eatIdent("to"),this.skipSC(),this.eat(t),this.skipSC(),e=this.parseWithFallback(this.SelectorList,()=>this.Raw(!1,!0)),this.skipSC(),this.eat(i)),{type:"Scope",loc:this.getLocation(h,this.tokenStart),root:o,limit:e}}function n(o){o.root&&(this.token(t,"("),this.node(o.root),this.token(i,")")),o.limit&&(this.token(s,"to"),this.token(t,"("),this.node(o.limit),this.token(i,")"))}export{n as generate,o as name,h as parse,e as structure};