Get it all to compile!

This commit is contained in:
Eric Correia 2021-10-02 13:48:07 -04:00
parent 555478cdf0
commit 8272ea876f
21 changed files with 217 additions and 21 deletions

View file

@ -27,6 +27,7 @@ impl<'a> Formattable<'a> for Expr<'a> {
Float(_)
| Num(_)
| NonBase10Int { .. }
| SingleQuote(_)
| Access(_, _)
| AccessorFunction(_)
| Var { .. }
@ -228,6 +229,11 @@ impl<'a> Formattable<'a> for Expr<'a> {
Num(string) | Float(string) | GlobalTag(string) | PrivateTag(string) => {
buf.push_str(string)
}
SingleQuote(string) => {
buf.push('\'');
buf.push_str(string);
buf.push('\'');
}
NonBase10Int {
base,
string,

View file

@ -35,6 +35,7 @@ impl<'a> Formattable<'a> for Pattern<'a> {
| Pattern::NonBase10Literal { .. }
| Pattern::FloatLiteral(_)
| Pattern::StrLiteral(_)
| Pattern::SingleQuote(_)
| Pattern::Underscore(_)
| Pattern::Malformed(_)
| Pattern::MalformedIdent(_, _)
@ -127,6 +128,11 @@ impl<'a> Formattable<'a> for Pattern<'a> {
StrLiteral(literal) => {
todo!("Format string literal: {:?}", literal);
}
SingleQuote(string) => {
buf.push('\'');
buf.push_str(string);
buf.push('\'');
}
Underscore(name) => {
buf.push('_');
buf.push_str(name);