From 6396cb1f5ec1958a07362d96dbae9040df56e14d Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Thu, 23 May 2019 18:31:36 +0200 Subject: ghdlprint: exit in case of error. --- src/ghdldrv/ghdlprint.adb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/ghdldrv/ghdlprint.adb b/src/ghdldrv/ghdlprint.adb index 522fd8b1d..91168c023 100644 --- a/src/ghdldrv/ghdlprint.adb +++ b/src/ghdldrv/ghdlprint.adb @@ -1017,7 +1017,9 @@ package body Ghdlprint is for I in Args'Range loop Id := Name_Table.Get_Identifier (Args (I).all); Design_File := Load_File_Name (Id); - if Design_File = Null_Iir then + if Design_File = Null_Iir + or else Errorout.Nbr_Errors > 0 + then raise Errorout.Compilation_Error; end if; @@ -1117,7 +1119,7 @@ package body Ghdlprint is loop Scan; if Ref_Tokens.Table (Tok_Idx) /= Current_Token then - Report_Msg (Msgid_Error, Errorout.Parse, No_Source_Coord, + Report_Msg (Msgid_Error, Errorout.Parse, Get_Token_Coord, "token mismatch"); exit; end if; -- cgit v1.2.3