parser rejects errant declarations

This commit is contained in:
Zachary Snow 2020-07-22 21:35:25 -06:00
parent 8537a9efda
commit 359a3de91e
3 changed files with 12 additions and 3 deletions

View File

@ -343,9 +343,13 @@ parseDTsAsComponents tokens =
parseDTsAsComponent :: [DeclToken] -> (Position, Component, [DeclToken])
parseDTsAsComponent [] = error "parseDTsAsComponent unexpected end of tokens"
parseDTsAsComponent l0 =
if l /= Nothing && l /= Just Automatic
then error $ "unexpected non-automatic lifetime: " ++ show l0
else (position, component, l5)
if l /= Nothing && l /= Just Automatic then
error $ "unexpected non-automatic lifetime: " ++ show l0
else if dir == Local && tf rs == Implicit Unspecified [] then
error $ "declaration(s) missing type information: "
++ show (position, tps)
else
(position, component, l5)
where
(dir, l1) = takeDir l0
(l , l2) = takeLifetime l1

View File

@ -0,0 +1,4 @@
module top;
logic y;
y = 1;
endmodule

View File

@ -9,6 +9,7 @@ addTest() {
suite_addTest test_$test
}
source ../lib/functions.sh
source ../lib/discover.sh
. shunit2