Open pbreuer opened 2 years ago
I had a look at parse.y. It seems to be assignment_pattern, but I may be wrong. That is '{ expression (, expression)* } | '{ }. If it is that, one would add a clause for number '{ expression } I don't know what the attribitute calculation would be. Maybe
{ std::list<PExpr>tmp = new std::list<PExpr*>; tmp->push_back($3); for (int i = 1; i < atoi($1.text); i++) tmp->push_back(new std::
($3)); FILE_NAME(tmp, @1); $$ = tmp; }
Pardon my nonexistent C++. Something like that. But you probably will want to make a new term construct in the abstract data type of syntax trees for "repeated n times". That's more than a one liner.
This evokes syntax error as shown (both iverilog 11.0 and 12.0, with -g1800-2005 and without):
If I replace 4{ foo } by `{ foo,foo,foo,foo } then all is well.
The 1800-2005 standard says the code syntax is correct:
I was hoping to check system verilog (2005) code produced by Clash. That the line is generated is why the example is ugly!
Can you fix this in the parser? If you point me at your parser spec I can likely do that if it helps.
Regards
PTB