Skip to content

Commit

Permalink
Overhaul parser to use tokenizer
Browse files Browse the repository at this point in the history
This is a huge cleanup, but it should pay off nicely if we implement
`sql_quote!`.
  • Loading branch information
emk committed Oct 21, 2023
1 parent ffc1be1 commit 91548a4
Show file tree
Hide file tree
Showing 13 changed files with 869 additions and 1,204 deletions.
4 changes: 2 additions & 2 deletions joinery_macros/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fn impl_emit_macro(ast: &syn::DeriveInput) -> TokenStream2 {
let (impl_generics, ty_generics, where_clause) = &ast.generics.split_for_impl();
quote! {
impl #impl_generics Emit for #name #ty_generics #where_clause {
fn emit(&self, t: Target, f: &mut fmt::Formatter<'_>) -> fmt::Result {
fn emit(&self, t: Target, f: &mut TokenWriter<'_>) -> ::std::io::Result<()> {
<#name #ty_generics as EmitDefault>::emit_default(self, t, f)
}
}
Expand All @@ -40,7 +40,7 @@ fn impl_emit_default_macro(ast: &syn::DeriveInput) -> TokenStream2 {
let implementation = emit_default_body(name, &ast.data);
quote! {
impl #impl_generics EmitDefault for #name #ty_generics #where_clause {
fn emit_default(&self, t: Target, f: &mut fmt::Formatter<'_>) -> fmt::Result {
fn emit_default(&self, t: Target, f: &mut TokenWriter<'_>) -> ::std::io::Result<()> {
#implementation
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/analyze.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ impl FunctionCallCounts {
"{}(",
special_date_function_call
.function_name
.unescaped_bigquery()
.ident
.name
.to_ascii_uppercase(),
);
for (i, _) in special_date_function_call.args.node_iter().enumerate() {
Expand Down
Loading

0 comments on commit 91548a4

Please sign in to comment.