mirror of https://github.com/zachjs/sv2v.git
parser rejects errant declarations
This commit is contained in:
parent
8537a9efda
commit
359a3de91e
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -0,0 +1,4 @@
|
|||
module top;
|
||||
logic y;
|
||||
y = 1;
|
||||
endmodule
|
||||
|
|
@ -9,6 +9,7 @@ addTest() {
|
|||
suite_addTest test_$test
|
||||
}
|
||||
|
||||
source ../lib/functions.sh
|
||||
source ../lib/discover.sh
|
||||
|
||||
. shunit2
|
||||
|
|
|
|||
Loading…
Reference in New Issue