Vl-parse-property-actual-arg
Match a single sequence_actual_arg.
- Signature
(vl-parse-property-actual-arg name &key (tokstream 'tokstream)
(config 'config))
→
(mv errmsg? value new-tokstream)
- Arguments
- name — Guard (stringp name).
- config — Guard (vl-loadconfig-p config).
This is used in the special case where we know that we want to
match exactly one (perhaps optional) property_actual_arg followed by a
right paren, e.g., we are matching bar in .foo(bar) or similar.
The basic grammar rule here is:
property_actual_arg ::= property_expr
| sequence_actual_arg
sequence_actual_arg ::= event_expression
| sequence_expr
We don't really distinguish between property_expr and
sequence_expr. But even without the vast ambiguity between them, this is
also ambiguous in a couple of ways.
First, any ordinary expression is simultaneously an event_expression
and also a sequence_expr, e.g., via expression_or_dist. So if we
just see an identifier like foo or some other expression, it may be an
event expression or a sequence expression, and it isn't clear what we should
prefer. Furthermore, the keyword or makes it so that an event expression
such as a or b might instead be interpreted as a sequence expression.
In the special case where we know that we're expecting a single
property_actual_arg followed by a right-paren, e.g., .foo(bar), it
seems fairly reasonable to just use backtracking to try both possibilities and
see which (if any) leads us to the right place. If both succeed, e.g., perhaps
bar is an ordinary expression, we arbitrarily choose to prefer a
property_expr over an event_expression.