mirror of
https://github.com/caddyserver/caddy.git
synced 2024-12-23 22:27:38 -05:00
actually return error on redeclaration
This commit is contained in:
parent
dd4b3efa47
commit
68a495f144
1 changed files with 2 additions and 3 deletions
|
@ -100,10 +100,9 @@ func (p *parser) begin() error {
|
||||||
if p.definedMacros == nil {
|
if p.definedMacros == nil {
|
||||||
p.definedMacros = map[string][]Token{}
|
p.definedMacros = map[string][]Token{}
|
||||||
}
|
}
|
||||||
if p.definedMacros[name] != nil {
|
if _, found := p.definedMacros[name]; found {
|
||||||
p.Errf("redeclaration of previously declared macro %s", name)
|
return p.Errf("redeclaration of previously declared macro %s", name)
|
||||||
}
|
}
|
||||||
|
|
||||||
// consume all tokens til matched close brace
|
// consume all tokens til matched close brace
|
||||||
tokens, err := p.macroTokens()
|
tokens, err := p.macroTokens()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue