mirror of https://github.com/zachjs/sv2v.git
more useful error message on bad stmt asgn
This commit is contained in:
parent
5ac7a79f8b
commit
2a4d1cc5a8
|
|
@ -261,7 +261,10 @@ parseDTsAsDeclOrStmt tokens =
|
||||||
_ -> case takeLHS tokens of
|
_ -> case takeLHS tokens of
|
||||||
Just fullLHS -> Subroutine (lhsToExpr fullLHS) (Args [] [])
|
Just fullLHS -> Subroutine (lhsToExpr fullLHS) (Args [] [])
|
||||||
_ -> error $ "invalid block item decl or stmt: " ++ show tokens
|
_ -> error $ "invalid block item decl or stmt: " ++ show tokens
|
||||||
Just lhs = takeLHS $ init tokens
|
lhsToks = init tokens
|
||||||
|
lhs = case takeLHS lhsToks of
|
||||||
|
Nothing -> error $ "could not parse as LHS: " ++ show lhsToks
|
||||||
|
Just l -> l
|
||||||
hasLeadingDecl = tokens /= l4 && tripLookahead l4
|
hasLeadingDecl = tokens /= l4 && tripLookahead l4
|
||||||
(_, l1) = takeDir tokens
|
(_, l1) = takeDir tokens
|
||||||
(_, l2) = takeLifetime l1
|
(_, l2) = takeLifetime l1
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue