diff options
author | Tristan Gingold <tgingold@free.fr> | 2020-07-01 22:08:51 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2020-07-01 22:08:51 +0200 |
commit | f694f54d851747c4cd9a5ba5e35bfa21c6fb9921 (patch) | |
tree | 1bf7c8c18b64137fec463eeecea08c3fb330fbb1 /src | |
parent | 6bc221560e88b7e5b6977ab0811f48f192db064a (diff) | |
download | ghdl-f694f54d851747c4cd9a5ba5e35bfa21c6fb9921.tar.gz ghdl-f694f54d851747c4cd9a5ba5e35bfa21c6fb9921.tar.bz2 ghdl-f694f54d851747c4cd9a5ba5e35bfa21c6fb9921.zip |
vhdl-scanner: be case-insensitive for pragma in comments.
Diffstat (limited to 'src')
-rw-r--r-- | src/vhdl/vhdl-scanner.adb | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/src/vhdl/vhdl-scanner.adb b/src/vhdl/vhdl-scanner.adb index fba0dab54..bef26417f 100644 --- a/src/vhdl/vhdl-scanner.adb +++ b/src/vhdl/vhdl-scanner.adb @@ -1702,16 +1702,29 @@ package body Vhdl.Scanner is Id := Null_Identifier; Skip_Spaces; - -- The identifier shall start with a lower case letter. - if Source (Pos) not in 'a' .. 'z' then - return; - end if; + -- The identifier shall start with a letter. + case Source (Pos) is + when 'a' .. 'z' + | 'A' .. 'Z' => + null; + when others => + return; + end case; - -- Scan the identifier (in lower cases). + -- Scan the identifier. Len := 0; loop C := Source (Pos); - exit when C not in 'a' .. 'z' and C /= '_'; + case C is + when 'a' .. 'z' => + null; + when 'A' .. 'Z' => + C := Character'Val (Character'Pos (C) + 32); + when '_' => + null; + when others => + exit; + end case; Len := Len + 1; Buffer (Len) := C; Pos := Pos + 1; |