diff --git a/py/dml/dmlparse.py b/py/dml/dmlparse.py index dc582932..de461896 100644 --- a/py/dml/dmlparse.py +++ b/py/dml/dmlparse.py @@ -545,7 +545,11 @@ def object3(t): | maybe_extension GROUP objident array_list maybe_istemplate object_spec | maybe_extension PORT objident array_list maybe_istemplate object_spec | maybe_extension IMPLEMENT objident array_list maybe_istemplate object_spec''' - t[0] = ast.object_(site(t), t[3], t[2], t[4], t[1], t[5] + t[6]) + array_spec = t[4] + if array_spec and t[2] in {'interface', 'implement'}: + report(ESYNTAX(site(t, 4), '[', f'{t[2]} array not allowed')) + array_spec = [] + t[0] = ast.object_(site(t), t[3], t[2], array_spec, t[1], t[5] + t[6]) @prod_dml14 def object_subdevice(t): diff --git a/test/1.4/errors/T_ESYNTAX.dml b/test/1.4/errors/T_ESYNTAX.dml index 9290b7b7..8d930e03 100644 --- a/test/1.4/errors/T_ESYNTAX.dml +++ b/test/1.4/errors/T_ESYNTAX.dml @@ -86,6 +86,20 @@ if else { } +extern typedef struct { void (*f)(conf_object_t *); } foo_interface_t; + +implement foo +/// ERROR ESYNTAX + [ + i < 3] {} + +connect c { + interface foo + /// ERROR ESYNTAX + [ + i < 3]; +} + method init() { local int a; local int b;