generate: now we have a way to do errors, i guess

This commit is contained in:
Pat Hickey
2020-01-22 20:47:40 -08:00
parent 97077954f8
commit c05475b806
8 changed files with 158 additions and 96 deletions

View File

@@ -12,8 +12,9 @@ impl Names {
pub fn new() -> Names {
Names {}
}
pub fn type_(&self, id: &Id) -> Ident {
format_ident!("{}", id.as_str().to_camel_case())
pub fn type_(&self, id: &Id) -> TokenStream {
let ident = format_ident!("{}", id.as_str().to_camel_case());
quote!(#ident)
}
pub fn builtin_type(&self, b: BuiltinType) -> TokenStream {
match b {