make saving raw source of literals optional
dherman opened this issue · 0 comments
dherman commented
Make StringLiteral
and NumberLiteral
parameterized types to allow making it configurable whether to save the raw source. Probably something like
struct StringLiteral<T: Display, StringLiteralParser> {
pub source: T,
pub value: String
}
where StringLiteralParser
is a custom trait that modularizes the parsing logic for string literals. This lets you construct a parser at compile time with the literal parsing logic you want.