|
|
@ -61,7 +61,7 @@ func NewParserFromLexer(lexer *lexer) *Parser { |
|
|
|
|
|
|
|
|
|
|
|
parser.directiveWrappers = map[string]func(*components.Directive) components.IDirective{ |
|
|
|
parser.directiveWrappers = map[string]func(*components.Directive) components.IDirective{ |
|
|
|
"server": func(directive *components.Directive) components.IDirective { |
|
|
|
"server": func(directive *components.Directive) components.IDirective { |
|
|
|
return parser.parseUpstreamServer(directive) |
|
|
|
return parser.wrapServer(directive) |
|
|
|
}, |
|
|
|
}, |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -113,7 +113,7 @@ parsingloop: |
|
|
|
case p.curTokenIs(flag.LuaCode): |
|
|
|
case p.curTokenIs(flag.LuaCode): |
|
|
|
context.IsLuaBlock = true |
|
|
|
context.IsLuaBlock = true |
|
|
|
context.LiteralCode = p.currentToken.Literal |
|
|
|
context.LiteralCode = p.currentToken.Literal |
|
|
|
case p.curTokenIs(flag.Keyword): |
|
|
|
case p.curTokenIs(flag.Keyword) || p.curTokenIs(flag.QuotedString): |
|
|
|
s, err := p.parseStatement() |
|
|
|
s, err := p.parseStatement() |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
return nil, err |
|
|
|
return nil, err |
|
|
|