diff options
-rw-r--r-- | dist/mcode/windows/ghdlfilter.adb | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/dist/mcode/windows/ghdlfilter.adb b/dist/mcode/windows/ghdlfilter.adb index d37c2db..681d404 100644 --- a/dist/mcode/windows/ghdlfilter.adb +++ b/dist/mcode/windows/ghdlfilter.adb @@ -2,7 +2,7 @@ with Ada.Command_Line; use Ada.Command_Line; with Ada.Text_IO; use Ada.Text_IO; procedure Ghdlfilter is - type Mode_Kind is (Mode_93, Mode_87); + type Mode_Kind is (Mode_93, Mode_87, Mode_08); Mode : Mode_Kind; Line : String (1 .. 128); @@ -12,7 +12,7 @@ procedure Ghdlfilter is Block_Comment : Boolean; begin if Argument_Count /= 1 then - Put_Line (Standard_Error, "usage: " & Command_Name & " -v93|-v87"); + Put_Line (Standard_Error, "usage: " & Command_Name & " -v93|-v87|-v08"); return; end if; @@ -20,6 +20,8 @@ begin Mode := Mode_93; elsif Argument (1) = "-v87" then Mode := Mode_87; + elsif Argument (1) = "-v08" then + Mode := Mode_08; else Put_Line (Standard_Error, "bad mode"); return; @@ -34,19 +36,28 @@ begin Comment := Block_Comment; if Len > 5 then - if Mode = Mode_87 and Line (Len - 4 .. Len) = "--V93" then + if Mode = Mode_87 and ( (Line (Len - 4 .. Len) = "--V93") or (Line (Len - 4 .. Len) = "--V08") ) then Comment := True; - elsif Mode = Mode_93 and Line (Len - 4 .. Len) = "--V87" then + elsif Mode = Mode_93 and ( (Line (Len - 4 .. Len) = "--V87") or (Line (Len - 4 .. Len) = "--V08") ) then + Comment := True; + elsif Mode = Mode_08 and ( (Line (Len - 4 .. Len) = "--V87") or (Line (Len - 4 .. Len) = "--V93") ) then Comment := True; end if; end if; + if Len = 11 - and then Mode = Mode_87 + and then Mode /= Mode_93 and then Line (1 .. 11) = "--START-V93" then Block_Comment := True; end if; - if Len = 9 and then Line (1 .. 9) = "--END-V93" then + if Len = 11 + and then Mode /= Mode_08 + and then Line (1 .. 11) = "--START-V08" then + Block_Comment := True; + end if; + + if Len = 9 and then ( (Line (1 .. 9) = "--END-V93") or (Line (1 .. 9) = "--END-V08") ) then Block_Comment := False; end if; |