aboutsummaryrefslogtreecommitdiffstats
path: root/src/xtools/pnodes.py
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2018-05-06 15:23:32 +0200
committerTristan Gingold <tgingold@free.fr>2018-05-23 20:34:33 +0200
commitd88ed36e42b1a744d71b5707f3521bca232eefb8 (patch)
tree91e8827130398ceff5fefa5c691924947211cbdd /src/xtools/pnodes.py
parentd313f7858bb4dd61e96ea8c29239231e61b04ee5 (diff)
downloadghdl-d88ed36e42b1a744d71b5707f3521bca232eefb8.tar.gz
ghdl-d88ed36e42b1a744d71b5707f3521bca232eefb8.tar.bz2
ghdl-d88ed36e42b1a744d71b5707f3521bca232eefb8.zip
pnodes: do not allow redeclaration.
Diffstat (limited to 'src/xtools/pnodes.py')
-rwxr-xr-xsrc/xtools/pnodes.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/xtools/pnodes.py b/src/xtools/pnodes.py
index be43ea9bf..bc31114ea 100755
--- a/src/xtools/pnodes.py
+++ b/src/xtools/pnodes.py
@@ -403,6 +403,9 @@ def read_nodes(filename, kinds, kinds_ranges, fields, funcs):
raise ParseError(lr, 'unknown node')
fmt = m.group(2)
names.append((name, fmt))
+ if name in nodes:
+ raise ParseError(
+ lr, 'node {} already described'.format(name));
# There might be several nodes described at once.
l = lr.get()
m = pat_decl.match(l)