summaryrefslogtreecommitdiff
path: root/scan.adb
diff options
context:
space:
mode:
authorTristan Gingold2013-12-31 19:01:48 +0100
committerTristan Gingold2013-12-31 19:01:48 +0100
commit5f41fdc72fccd7169dc812c8690e82222ae1aca1 (patch)
tree2e2cddb257b071ec30b79c0672e2320f5421468d /scan.adb
parent2fe0a5359e1bdf6dfdab20bea121db8f4e54ffe9 (diff)
downloadghdl-5f41fdc72fccd7169dc812c8690e82222ae1aca1.tar.gz
ghdl-5f41fdc72fccd7169dc812c8690e82222ae1aca1.tar.bz2
ghdl-5f41fdc72fccd7169dc812c8690e82222ae1aca1.zip
Fix bug21274.
WIP for VHDL08.
Diffstat (limited to 'scan.adb')
-rw-r--r--scan.adb39
1 files changed, 38 insertions, 1 deletions
diff --git a/scan.adb b/scan.adb
index 1e5f198..3490e4e 100644
--- a/scan.adb
+++ b/scan.adb
@@ -1393,7 +1393,44 @@ package body Scan is
Pos := Pos + 1;
Current_Token := Tok_Not;
return;
- when '$' | '?' | '`'
+ when '?' =>
+ if Vhdl_Std < Vhdl_08 then
+ Error_Msg_Scan ("'?' can only be used in strings or comments");
+ Pos := Pos + 1;
+ goto Again;
+ else
+ if Source (Pos + 1) = '<' then
+ if Source (Pos + 2) = '=' then
+ Current_Token := Tok_Match_Less_Equal;
+ Pos := Pos + 3;
+ else
+ Current_Token := Tok_Match_Less;
+ Pos := Pos + 2;
+ end if;
+ elsif Source (Pos + 1) = '>' then
+ if Source (Pos + 2) = '=' then
+ Current_Token := Tok_Match_Greater_Equal;
+ Pos := Pos + 3;
+ else
+ Current_Token := Tok_Match_Greater;
+ Pos := Pos + 2;
+ end if;
+ elsif Source (Pos + 1) = '=' then
+ Current_Token := Tok_Match_Equal;
+ Pos := Pos + 2;
+ elsif Source (Pos + 1) = '/'
+ and then Source (Pos + 2) = '='
+ then
+ Current_Token := Tok_Match_Not_Equal;
+ Pos := Pos + 3;
+ else
+ Error_Msg_Scan ("unknown matching operator");
+ Pos := Pos + 1;
+ goto Again;
+ end if;
+ end if;
+ return;
+ when '$' | '`'
| Inverted_Exclamation .. Inverted_Question
| Multiplication_Sign | Division_Sign =>
Error_Msg_Scan ("character """ & Source (Pos)