Language Change Specification for Optional Commas
LCS Number: | LCS-2016-071b |
Version: | 1 |
Date: | 2-Nov-2016 |
Status: | |
Author: | Rob Gaddi |
Email: | RobGaddi |
Source Doc: | OptionalSemicolon |
Summary: | Allow for extra commas at the end of lists |
Voting Results: Cast your votes here
Yes:
- Rob Gaddi - 2016-11-17
- Kevin Jennings - 2016-11-22
- Morten Zilmer - 2016-12-11
- Martin Thompson - 2016-12-12
- Ryan Hinton - 2016-12-14 - ver 1
- Martin Zabel - 2017-01-09 - ver 1
- Patrick Lehmann - 2017-01-23 - ver 1
- Lieven Lemiengre - 2017-01-27 - ver 1
- Mark Zwolinski - 2017-02-23
No:
- Jim Lewis - 2016-12-17 - ver 1
- Farrell Ostler - 2017-02-12 - ver 1
- Brent Hayhoe - 2017-02-16 Version 1 Comment below
Abstain:
- Thomas Preusser - 2016-11-21
Details of Language Change
Changes are shown in red font.
Section 5.2.2.1 Enumeration types
Middle page 37
enumeration_type_definition ::=
( enumeration_literal { , enumeration_literal } [ , ] )
Section 5.3.2.1 Array types
Bottom page 44
unbounded_array_definition ::=
array ( index_subtype_definition { , index_subtype_definition } [ , ] )
of element_subtype_indication
Top page 45
index_constraint ::= ( discrete_range { , discrete_range } [ , ] )
Section 5.3.3 Record types
Bottom page 51
record_constraint ::=
( record_element_constraint { , record_element_constraint } [ , ] )
Section 6.5.7.1 Association Lists
Top page 81
association_list ::=
association_element { , association_element } [ , ]
Section 6.9 Group template declarations
Middle page 93
entity_class_entry_list ::=
entity_class_entry { , entity_class_entry } [ , ]
Section 8.4 Indexed names
Bottom page 111
indexed_name ::= prefix ( expression { , expression } [ , ] )
Section 9.3.3.1 Aggregates
Bottom page 132
aggregate ::=
( element_association { , element_association } [ , ] )
--
RobGaddi - 2016-16-03
Comments
The proposal is about having optional semicolons. Why is the LCS written to define optional commas?
--
Kevin Jennings - 2016-11-03
Agreed. Split the LCS into
LCS2016_071a for the semicolon and
TopLCS2016_071b for the commas so they can be voted independently.
--
Rob Gaddi - 2016-11-16
This would have been great in the beginning of VHDL. I am afraid, now it will just be another source of incompatibility.
--
Thomas Preusser - 2016-11-21
Patrick just pointed out to me that the optional commas make conditional compilation substantially more useful. Otherwise, if you have to conditionally compile out part of a association list you may have to jump through horrific hoops to make the commas work correctly.
Thomas, I'm not sure what you mean about incompatibility. VHDL2017 code requires VHDL2017 support to run; if your tools only support older language revisions then they won't support newer language features.
-- Rob Gaddi - 2017-01-10
@PL & @RG This is something that is going to make coding 30 seconds faster at the cost of making review significantly more difficult.
The conditional compilation argument is intriguing, but I suspect if one properly structures their conditional compilation, then there will be no compelling reason to allow this. Can someone provide an example of the claim about optional commas making conditional compilation more useful - a good place to add it is to the proposal.
-- Jim Lewis - 2017-01-28
@RG I think Thomas' point is that since tools do not support this now, and it is not a feature everyone is going to be asking for, how long do you think it will take for the feature to be relevant in simulation? Synthesis?
-- Jim Lewis - 2017-01-28
@JL Why does it make reviews more difficult?
Allowing optional trailing comas looks like this and does not decrease readability.
inst : entity work.foo
port map (
X => A,
Y => B,
);
Instance with conditional compilation and two optional ports. The conditional compilation must take care of comma insertion.
inst : entity work.foo
port map (
`if port1 /= "" then
X => A
`end if
`if port1 /= "" and port2 /= "" then
,
`end if
`if port2 /= "" then
Y => B
`end if
);
The same example with trailing commas allowed:
inst : entity work.foo
port map (
`if port1 /= "" then
X => A,
`end if
`if port2 /= "" then
Y => B
`end if
);
JL: [...] optional commas making conditional compilation more useful.
PL: No it's the other ways around. If we get conditional compilation, we'll need optional commas and semicolons, unless we want to blow up our code with too much conditional code directives to handle corner cases like the last item in a list has no comma or semicolon.
-- Patrick Lehmann - 2017-01-28
I agree with the comments about conditional compilation.
-- Mark Zwolinski - 2017-02-23
My basic objection is that this LCS screws with the grammar of the language.
Brent Hayhoe - 2017-03-09