diff options
author | Tristan Gingold | 2014-01-04 01:46:59 +0100 |
---|---|---|
committer | Tristan Gingold | 2014-01-04 01:46:59 +0100 |
commit | 98067eb30f0097955b086b3bf3ad5da51e558546 (patch) | |
tree | 565ecbe6bfbd38294cf2d52ffdd03f895682648d | |
parent | 2360dc88ddf29244ec57cb1a474a94c595a6849f (diff) | |
download | ghdl-98067eb30f0097955b086b3bf3ad5da51e558546.tar.gz ghdl-98067eb30f0097955b086b3bf3ad5da51e558546.tar.bz2 ghdl-98067eb30f0097955b086b3bf3ad5da51e558546.zip |
Improve error recovery for invalid bit string.
-rw-r--r-- | scan.adb | 16 |
1 files changed, 13 insertions, 3 deletions
@@ -495,10 +495,20 @@ package body Scan is ("underscore not allowed at the end of a bit string"); end if; goto Again; - when others => + when '"' => + pragma Assert (Mark = '%'); Error_Msg_Scan - ("character '" & C & "' not allowed in a bit string"); - goto Again; + ("'""' cannot close a bit string opened by '%'"); + exit; + when '%' => + pragma Assert (Mark = '%'); + Error_Msg_Scan + ("'%' cannot close a bit string opened by '""'"); + exit; + when others => + Error_Msg_Scan ("bit string not terminated"); + Pos := Pos - 1; + exit; end case; case Base_Len is |