import{AtKeyword as t,CDC as e,CDO as i,Comment as s,WhiteSpace as n}from"../../tokenizer/types.mjs";import"../../tokenizer/char-code-definitions.mjs";import"../../tokenizer/TokenStream.mjs";function h(){return this.Raw(null,!1)}const r="StyleSheet",o="stylesheet",a={children:[["Comment","CDO","CDC","Atrule","Rule","Raw"]]};function c(){const r=this.tokenStart,o=this.createList();let a;for(;!this.eof;){switch(this.tokenType){case n:this.next();continue;case s:if(33!==this.charCodeAt(this.tokenStart+2)){this.next();continue}a=this.Comment();break;case i:a=this.CDO();break;case e:a=this.CDC();break;case t:a=this.parseWithFallback(this.Atrule,h);break;default:a=this.parseWithFallback(this.Rule,h)}o.push(a)}return{type:"StyleSheet",loc:this.getLocation(r,this.tokenStart),children:o}}function l(t){this.children(t)}export{l as generate,r as name,c as parse,a as structure,o as walkContext};