veryl icon indicating copy to clipboard operation
veryl copied to clipboard

Refactor `Expression` and `TypeExpression`

Open dalance opened this issue 5 months ago • 11 comments

Now type parameter overriding by built-in types is syntax error.

module ModuleA {
    inst u: ModuleB #(
        p: logic,
    );
}

This is because InstParameterItem can take Expression only.

InstParameterItem: Identifier [ Colon Expression ]; 

If we simply add TypeExpression to it, syntax ambiguous occurs because both Expression and TypeExpression can reach ScopedIdentifier.

InstParameterItem: Identifier [ Colon ( Expression | TypeExpression ) ]; 

So I think this case requires to refactor whole Expression and TypeExpression.

Refer: #958

dalance avatar Sep 12 '24 00:09 dalance