This DATA statement was getting a parsing error:
data x /a(i)%b/
The parser was expecting the ending '/' where the '%' was. The problem
was parsing a(i) as a structure constructor. Instead, move the
constant subobject case before structure constructor, but match it only
if not followed by '('. That is because in data x /a(1)(2)/, a(1) is
a valid structure constructor.
Also, remove the NamedConstant alternative from DataStmtRepeat. A named
constant is always parsed as a ConstantSubobject so it can never occur.
This DATA statement was getting a parsing error:
data x /a(i)%b/
The parser was expecting the ending '/' where the '%' was. The problem was parsing
a(i)
as a structure constructor. Instead, move the constant subobject case before structure constructor, but match it only if not followed by '('. That is because indata x /a(1)(2)/
,a(1)
is a valid structure constructor.Also, remove the NamedConstant alternative from DataStmtRepeat. A named constant is always parsed as a ConstantSubobject so it can never occur.