Commit 68a495f1 authored by Craig Peterson's avatar Craig Peterson

actually return error on redeclaration

parent dd4b3efa
...@@ -100,10 +100,9 @@ func (p *parser) begin() error { ...@@ -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 {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment