mirror of https://github.com/zachjs/sv2v.git
add explicit unknown token error message
This commit is contained in:
parent
60c0819bf4
commit
c1ce7d067b
|
|
@ -509,6 +509,8 @@ postProcess stack (Token Id_escaped str pos : ts) =
|
||||||
where
|
where
|
||||||
t' = Token Id_escaped str' pos
|
t' = Token Id_escaped str' pos
|
||||||
str' = (++ " ") $ init str
|
str' = (++ " ") $ init str
|
||||||
|
postProcess _ (Token Unknown str pos : _) =
|
||||||
|
throwError $ show pos ++ ": unknown token '" ++ str ++ "'"
|
||||||
postProcess [] (t : ts) = do
|
postProcess [] (t : ts) = do
|
||||||
ts' <- postProcess [] ts
|
ts' <- postProcess [] ts
|
||||||
return $ t : ts'
|
return $ t : ts'
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
// pattern: Parse error: unexpected token '`'
|
// pattern: unknown token '`'
|
||||||
|
// location: double_backtick.sv:4:5
|
||||||
module top;
|
module top;
|
||||||
``
|
``
|
||||||
endmodule
|
endmodule
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
// pattern: Parse error
|
// pattern: unknown token '`'
|
||||||
|
// location: stray_escaped_vendor_comment.sv:4:6
|
||||||
module top;
|
module top;
|
||||||
/``* some awful garbage *``/
|
/``* some awful garbage *``/
|
||||||
endmodule
|
endmodule
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue