import{Semicolon as t,AtKeyword as i,Comment as e,WhiteSpace as s}from"../../tokenizer/types.mjs";import"../../tokenizer/char-code-definitions.mjs";import"../../tokenizer/TokenStream.mjs";function n(){return this.Raw(this.consumeUntilSemicolonIncluded,!0)}const o="DeclarationList",r={children:[["Declaration","Atrule","Rule"]]};function a(){const o=this.createList();for(;!this.eof;)switch(this.tokenType){case s:case e:case t:this.next();break;case i:o.push(this.parseWithFallback(this.Atrule.bind(this,!0),n));break;default:this.isDelim(38)?o.push(this.parseWithFallback(this.Rule,n)):o.push(this.parseWithFallback(this.Declaration,n))}return{type:"DeclarationList",loc:this.getLocationFromList(o),children:o}}function c(i){this.children(i,i=>{"Declaration"===i.type&&this.token(t,";")})}export{c as generate,o as name,a as parse,r as structure};