From f694f54d851747c4cd9a5ba5e35bfa21c6fb9921 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Wed, 1 Jul 2020 22:08:51 +0200 Subject: vhdl-scanner: be case-insensitive for pragma in comments. --- src/vhdl/vhdl-scanner.adb | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) (limited to 'src') 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; -- cgit v1.2.3