Don't allow tables to be redefined

This commit is contained in:
Thomas Pelletier
2013-12-10 16:10:26 +01:00
parent 72f17747a0
commit 8081f3cc09
3 changed files with 22 additions and 0 deletions
+3
View File
@@ -87,6 +87,9 @@ func parseGroup(p *parser) parserStateFn {
if key.typ != tokenKeyGroup {
panic(fmt.Sprintf("unexpected token %s, was expecting a key group", key))
}
if p.tree.Has(key.val) {
panic("duplicated tables")
}
p.tree.createSubTree(key.val)
p.assume(tokenRightBracket)
p.currentGroup = key.val