File tree Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Expand file tree Collapse file tree 1 file changed +20
-2
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ use crate::ast::*;
1717use crate :: data:: * ;
1818use vhdl_lang:: data:: error_codes:: ErrorCode ;
1919use vhdl_lang:: syntax:: parser:: ParsingContext ;
20+ use vhdl_lang:: VHDLStandard :: VHDL2019 ;
2021
2122pub ( crate ) fn parse_optional_mode (
2223 ctx : & mut ParsingContext < ' _ > ,
@@ -304,8 +305,8 @@ fn parse_semicolon_separator(ctx: &mut ParsingContext<'_>) -> ParseResult<()> {
304305 peek_token ! (
305306 ctx. stream, token,
306307 SemiColon => {
307- ctx. stream. skip( ) ;
308- if ctx. stream. next_kind_is( RightPar ) {
308+ ctx. stream. skip( ) ;
309+ if ctx. stream. next_kind_is( RightPar ) && ctx . standard < VHDL2019 {
309310 return Err ( Diagnostic :: syntax_error( & token. pos,
310311 format!( "Last interface element may not end with {}" ,
311312 kinds_str( & [ SemiColon ] ) ) ) ) ;
@@ -777,6 +778,23 @@ bar : natural)",
777778 "Last interface element may not end with ';'"
778779 ) ]
779780 ) ;
781+
782+ let code = Code :: with_standard (
783+ "\
784+ (constant foo : std_logic;
785+ bar : natural;
786+ )" ,
787+ VHDL2019 ,
788+ ) ;
789+ let result = code. parse_ok_no_diagnostics ( parse_generic_interface_list) ;
790+
791+ assert_eq ! (
792+ result,
793+ vec![
794+ code. s1( "constant foo : std_logic" ) . generic( ) ,
795+ code. s1( "bar : natural" ) . generic( )
796+ ]
797+ ) ;
780798 }
781799
782800 #[ test]
You can’t perform that action at this time.
0 commit comments