mirror of
https://github.com/italicsjenga/agb.git
synced 2024-12-24 00:31:34 +11:00
Use syn crate rather than litrs
This commit is contained in:
parent
21a11a4e41
commit
19e0a0527b
11
agb-image-converter/Cargo.lock
generated
11
agb-image-converter/Cargo.lock
generated
|
@ -13,8 +13,8 @@ name = "agb_image_converter"
|
||||||
version = "0.4.0"
|
version = "0.4.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"image",
|
"image",
|
||||||
"litrs",
|
|
||||||
"serde",
|
"serde",
|
||||||
|
"syn",
|
||||||
"toml",
|
"toml",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -88,15 +88,6 @@ dependencies = [
|
||||||
"png",
|
"png",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "litrs"
|
|
||||||
version = "0.2.3"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "f9275e0933cf8bb20f008924c0cb07a0692fe54d8064996520bf998de9eb79aa"
|
|
||||||
dependencies = [
|
|
||||||
"proc-macro2",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "miniz_oxide"
|
name = "miniz_oxide"
|
||||||
version = "0.3.7"
|
version = "0.3.7"
|
||||||
|
|
|
@ -13,4 +13,4 @@ proc-macro = true
|
||||||
image = { version = "0.23.14", default-features = false, features = [ "png", "bmp" ] }
|
image = { version = "0.23.14", default-features = false, features = [ "png", "bmp" ] }
|
||||||
toml = "0.5.8"
|
toml = "0.5.8"
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
litrs = "0.2.3"
|
syn = "1.0.73"
|
|
@ -1,7 +1,6 @@
|
||||||
use litrs::StringLit;
|
|
||||||
use proc_macro::TokenStream;
|
use proc_macro::TokenStream;
|
||||||
|
use syn::parse_macro_input;
|
||||||
|
|
||||||
use std::convert::TryFrom;
|
|
||||||
use std::fmt::Write;
|
use std::fmt::Write;
|
||||||
use std::path::Path;
|
use std::path::Path;
|
||||||
|
|
||||||
|
@ -32,12 +31,9 @@ impl TileSize {
|
||||||
|
|
||||||
#[proc_macro]
|
#[proc_macro]
|
||||||
pub fn include_gfx(input: TokenStream) -> TokenStream {
|
pub fn include_gfx(input: TokenStream) -> TokenStream {
|
||||||
let first_token = input.into_iter().next().expect("no input");
|
let input = parse_macro_input!(input as syn::LitStr);
|
||||||
|
|
||||||
let filename = match StringLit::try_from(first_token) {
|
let filename = input.value();
|
||||||
Err(e) => return e.to_compile_error(),
|
|
||||||
Ok(filename) => filename.into_value(),
|
|
||||||
};
|
|
||||||
|
|
||||||
let root = std::env::var("CARGO_MANIFEST_DIR").expect("Failed to get cargo manifest dir");
|
let root = std::env::var("CARGO_MANIFEST_DIR").expect("Failed to get cargo manifest dir");
|
||||||
let path = Path::new(&root).join(&*filename);
|
let path = Path::new(&root).join(&*filename);
|
||||||
|
|
11
agb/Cargo.lock
generated
11
agb/Cargo.lock
generated
|
@ -21,8 +21,8 @@ name = "agb_image_converter"
|
||||||
version = "0.4.0"
|
version = "0.4.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"image",
|
"image",
|
||||||
"litrs",
|
|
||||||
"serde",
|
"serde",
|
||||||
|
"syn",
|
||||||
"toml",
|
"toml",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -96,15 +96,6 @@ dependencies = [
|
||||||
"png",
|
"png",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "litrs"
|
|
||||||
version = "0.2.3"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "f9275e0933cf8bb20f008924c0cb07a0692fe54d8064996520bf998de9eb79aa"
|
|
||||||
dependencies = [
|
|
||||||
"proc-macro2",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "miniz_oxide"
|
name = "miniz_oxide"
|
||||||
version = "0.3.7"
|
version = "0.3.7"
|
||||||
|
|
Loading…
Reference in a new issue