summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTristan Gingold2014-01-04 01:46:59 +0100
committerTristan Gingold2014-01-04 01:46:59 +0100
commit98067eb30f0097955b086b3bf3ad5da51e558546 (patch)
tree565ecbe6bfbd38294cf2d52ffdd03f895682648d
parent2360dc88ddf29244ec57cb1a474a94c595a6849f (diff)
downloadghdl-98067eb30f0097955b086b3bf3ad5da51e558546.tar.gz
ghdl-98067eb30f0097955b086b3bf3ad5da51e558546.tar.bz2
ghdl-98067eb30f0097955b086b3bf3ad5da51e558546.zip
Improve error recovery for invalid bit string.
-rw-r--r--scan.adb16
1 files changed, 13 insertions, 3 deletions
diff --git a/scan.adb b/scan.adb
index 3490e4e..a8ac7d1 100644
--- a/scan.adb
+++ b/scan.adb
@@ -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