normalize trailing whitespace in escaped identifiers

This commit is contained in:
Zachary Snow 2021-07-08 17:17:45 -04:00
parent 9aa8b7033e
commit 91e3ac0fb1
2 changed files with 19 additions and 0 deletions

View File

@ -498,6 +498,11 @@ postProcess stack (Token Dir_end_keywords _ pos : ts) =
case stack of
(_ : stack') -> postProcess stack' ts
[] -> throwError $ show pos ++ ": unmatched end_keywords"
postProcess stack (Token Id_escaped str pos : ts) =
postProcess stack ts >>= return . (t' :)
where
t' = Token Id_escaped str' pos
str' = (++ " ") $ init str
postProcess [] (t : ts) = do
ts' <- postProcess [] ts
return $ t : ts'

View File

@ -0,0 +1,14 @@
module mod(
input \AFancySignalName[3].Something ,
output \AFancySignalName[3].SomethingElse
);
endmodule
module top;
wire \BFancySignalName.Something = 1;
wire \BFancySignalName.SomethingElse ;
mod inst_of_fancy_module(
.\AFancySignalName[3].Something (\BFancySignalName.Something ),
.\AFancySignalName[3].SomethingElse (\BFancySignalName.SomethingElse )
);
endmodule