Closed cbarrett closed 13 years ago
Hm. Not sure I grok this. Thinking out loud.
Currently, a string literal CExpr node would be constructed with:
Constant (CString "foobar")
Which has a type CExpr
So our newtype could be:
newtype StringLiteral = StringLiteral CExpr {
getExpr :: CExpr
}
and then you would make one of these with:
StringLiteral (Constant (CString "foobar"))
Does that make sense?
Colin and I have discussed this, and we think the best solution is to create a distinct StringLiteral node that holds C strings.
Fixed in a7c03bc1fdf4eb18d17d23e78a6b5626fcc102a3.
There are lots of places in the AST where a string literal can go, but since it's a leaf node of CExpr, it looks like other junk can go in there.