mirror of
https://github.com/steveicarus/iverilog.git
synced 2026-08-22 05:47:31 +02:00
Fix locations of unattributed statements
The `statement` and null-statement rules start with an optional attribute list. When it is empty, the reduced location starts at the previous token instead of the statement. Diagnostics using that location can consequently point to the beginning of the source file. Use the statement or semicolon location when no attributes are present. Signed-off-by: Lars-Peter Clausen <[email protected]>
This commit is contained in:
@@ -2614,6 +2614,7 @@ simple_type_or_string /* IEEE1800-2005: A.2.2.1 */
|
|||||||
statement /* IEEE1800-2005: A.6.4 */
|
statement /* IEEE1800-2005: A.6.4 */
|
||||||
: attribute_list_opt statement_item
|
: attribute_list_opt statement_item
|
||||||
{ pform_bind_attributes($2->attributes, $1);
|
{ pform_bind_attributes($2->attributes, $1);
|
||||||
|
if (!$1) @$ = @2;
|
||||||
$$ = $2;
|
$$ = $2;
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
@@ -2625,7 +2626,9 @@ statement_or_null /* IEEE1800-2005: A.6.4 */
|
|||||||
: statement
|
: statement
|
||||||
{ $$ = $1; }
|
{ $$ = $1; }
|
||||||
| attribute_list_opt ';'
|
| attribute_list_opt ';'
|
||||||
{ $$ = 0; }
|
{ if (!$1) @$ = @2;
|
||||||
|
$$ = 0;
|
||||||
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
stream_expression
|
stream_expression
|
||||||
|
|||||||
Reference in New Issue
Block a user