diff options
author | Tristan Gingold <tgingold@free.fr> | 2021-05-23 08:08:03 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2021-05-23 08:08:03 +0200 |
commit | c195530b5d37caed3536ca767c4fc3e75b3eadc0 (patch) | |
tree | dc9a9fae482d1143ba085dffff7b958a7dd74180 | |
parent | 7c28c0c7ca48edcda4ff7c390c864cb1396eb1d8 (diff) | |
download | ghdl-c195530b5d37caed3536ca767c4fc3e75b3eadc0.tar.gz ghdl-c195530b5d37caed3536ca767c4fc3e75b3eadc0.tar.bz2 ghdl-c195530b5d37caed3536ca767c4fc3e75b3eadc0.zip |
vhdl-scanner: improve column for scanner messages
-rw-r--r-- | src/vhdl/vhdl-scanner.adb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/vhdl/vhdl-scanner.adb b/src/vhdl/vhdl-scanner.adb index 177f04bad..40176e9d1 100644 --- a/src/vhdl/vhdl-scanner.adb +++ b/src/vhdl/vhdl-scanner.adb @@ -1046,6 +1046,8 @@ package body Vhdl.Scanner is null; when '_' => if Source (P + 1) = '_' then + -- Need to set the current position for the error message. + Pos := P + 1; Error_Msg_Scan ("two underscores can't be consecutive"); end if; when ' ' | ')' | '.' | ';' | ':' => @@ -1094,6 +1096,7 @@ package body Vhdl.Scanner is C := '_'; else -- Eat the trailing underscore. + Pos := P - 1; Error_Msg_Scan ("an identifier cannot finish with '_'"); end if; end if; @@ -1873,7 +1876,7 @@ package body Vhdl.Scanner is Warning_Msg_Scan (Warnid_Pragma, "incomplete pragma directive ignored"); when Name_Translate => - Scan_Comment_Identifier (Id, True); + Scan_Comment_Identifier (Id, False); case Id is when Name_On => Scan_Translate_On; |