Parse issue for hexadecimal literals in cast expressions
Closed this issue · 0 comments
Mark1626 commented
The following fails with a strange message
let x = (0x9e3779b9 as ubit<32>);
Error message
[Error] For input string: "779b9 a" under radix 16
Issue seems to be the way hex literals are parsed
dahlia/src/main/scala/Parser.scala
Lines 103 to 113 in ffb3866
A fix would be to handle it in the same way as Octal literals with the CharsWhileIn("0-9a-fA-F")
instead of CharIn("0-9a-fA-F").rep(1)
Interestingly it seems to work on the online example editor in https://capra.cs.cornell.edu/dahlia/