Commit 359a3de9 by Zachary Snow

parser rejects errant declarations

parent 8537a9ef
...@@ -343,9 +343,13 @@ parseDTsAsComponents tokens = ...@@ -343,9 +343,13 @@ parseDTsAsComponents tokens =
parseDTsAsComponent :: [DeclToken] -> (Position, Component, [DeclToken]) parseDTsAsComponent :: [DeclToken] -> (Position, Component, [DeclToken])
parseDTsAsComponent [] = error "parseDTsAsComponent unexpected end of tokens" parseDTsAsComponent [] = error "parseDTsAsComponent unexpected end of tokens"
parseDTsAsComponent l0 = parseDTsAsComponent l0 =
if l /= Nothing && l /= Just Automatic if l /= Nothing && l /= Just Automatic then
then error $ "unexpected non-automatic lifetime: " ++ show l0 error $ "unexpected non-automatic lifetime: " ++ show l0
else (position, component, l5) else if dir == Local && tf rs == Implicit Unspecified [] then
error $ "declaration(s) missing type information: "
++ show (position, tps)
else
(position, component, l5)
where where
(dir, l1) = takeDir l0 (dir, l1) = takeDir l0
(l , l2) = takeLifetime l1 (l , l2) = takeLifetime l1
......
module top;
logic y;
y = 1;
endmodule
...@@ -9,6 +9,7 @@ addTest() { ...@@ -9,6 +9,7 @@ addTest() {
suite_addTest test_$test suite_addTest test_$test
} }
source ../lib/functions.sh
source ../lib/discover.sh source ../lib/discover.sh
. shunit2 . shunit2
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment