|
1 | | -use crate::{linker::generate_link_section, resolve_path, AssetParseError}; |
| 1 | +use crate::{linker::generate_link_section, AssetParseError, PathResolution, PathResolver}; |
2 | 2 | use macro_string::MacroString; |
3 | 3 | use proc_macro2::TokenStream as TokenStream2; |
4 | 4 | use quote::{quote, ToTokens}; |
@@ -44,8 +44,9 @@ impl Parse for AssetParser { |
44 | 44 | // But we need to decide the hint first before parsing the options |
45 | 45 | fn parse(input: ParseStream) -> syn::Result<Self> { |
46 | 46 | // And then parse the options |
| 47 | + let resolution = input.call(PathResolution::parse)?; |
47 | 48 | let (MacroString(src), path_expr) = input.call(crate::parse_with_tokens)?; |
48 | | - let asset = resolve_path(&src, path_expr.span()); |
| 49 | + let asset = PathResolver::new(resolution, &src, &path_expr.span()).resolve(); |
49 | 50 | let _comma = input.parse::<Token![,]>(); |
50 | 51 | let options = input.parse()?; |
51 | 52 |
|
@@ -133,7 +134,7 @@ impl AssetParser { |
133 | 134 | let asset_tokens = self.expand_asset_tokens(asset); |
134 | 135 | quote! { ::core::option::Option::Some(#asset_tokens) } |
135 | 136 | } |
136 | | - Err(AssetParseError::AssetDoesntExist { .. }) => { |
| 137 | + Err(AssetParseError::DoesNotExist { .. }) => { |
137 | 138 | quote! { ::core::option::Option::<manganis::Asset>::None } |
138 | 139 | } |
139 | 140 | Err(err) => self.error_tokens(err), |
|
0 commit comments