feat: 修改 nginx util 增加空行处理

This commit is contained in:
zhengkunwang223
2022-11-30 17:33:30 +08:00
committed by zhengkunwang223
parent cd9bd9940c
commit 5b63dc42a2
12 changed files with 294 additions and 210 deletions

View File

@@ -88,6 +88,7 @@ func (p *Parser) parseBlock() *components.Block {
context := &components.Block{
Comment: "",
Directives: make([]components.IDirective, 0),
Line: p.currentToken.Line,
}
parsingloop:
@@ -100,6 +101,7 @@ parsingloop:
case p.curTokenIs(flag.Comment):
context.Directives = append(context.Directives, &components.Comment{
Detail: p.currentToken.Literal,
Line: p.currentToken.Line,
})
}
p.nextToken()
@@ -111,6 +113,7 @@ parsingloop:
func (p *Parser) parseStatement() components.IDirective {
d := &components.Directive{
Name: p.currentToken.Literal,
Line: p.currentToken.Line,
}
for p.nextToken(); p.currentToken.IsParameterEligible(); p.nextToken() {