Rename macro crate, start prepping for publish
This commit is contained in:
Generated
+11
-11
@@ -138,8 +138,8 @@ dependencies = [
|
|||||||
"compact_str",
|
"compact_str",
|
||||||
"insta",
|
"insta",
|
||||||
"lexopt",
|
"lexopt",
|
||||||
|
"mzp-peg-macro",
|
||||||
"nom",
|
"nom",
|
||||||
"peg_macro",
|
|
||||||
"rustc-hash",
|
"rustc-hash",
|
||||||
]
|
]
|
||||||
|
|
||||||
@@ -149,6 +149,16 @@ version = "2.7.5"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0"
|
checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0"
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "mzp-peg-macro"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"itertools",
|
||||||
|
"proc-macro2",
|
||||||
|
"quote",
|
||||||
|
"syn",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "nom"
|
name = "nom"
|
||||||
version = "8.0.0"
|
version = "8.0.0"
|
||||||
@@ -164,16 +174,6 @@ version = "1.21.3"
|
|||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
|
checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d"
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "peg_macro"
|
|
||||||
version = "0.1.0"
|
|
||||||
dependencies = [
|
|
||||||
"itertools",
|
|
||||||
"proc-macro2",
|
|
||||||
"quote",
|
|
||||||
"syn",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "proc-macro2"
|
name = "proc-macro2"
|
||||||
version = "1.0.95"
|
version = "1.0.95"
|
||||||
|
|||||||
+2
-2
@@ -8,7 +8,7 @@ edition = "2024"
|
|||||||
[dependencies]
|
[dependencies]
|
||||||
anyhow = "1.0.86"
|
anyhow = "1.0.86"
|
||||||
codepage-437 = "0.1.0"
|
codepage-437 = "0.1.0"
|
||||||
peg_macro = { path = "./peg_macro"}
|
mzp-peg-macro = { path = "./mzp_peg_macro", version = "0.1.0" }
|
||||||
insta = "1.39.0"
|
insta = "1.39.0"
|
||||||
nom = "8.0.0"
|
nom = "8.0.0"
|
||||||
compact_str = "0.9.0"
|
compact_str = "0.9.0"
|
||||||
@@ -27,4 +27,4 @@ name = "marzipan"
|
|||||||
path = "src/main.rs"
|
path = "src/main.rs"
|
||||||
|
|
||||||
[workspace]
|
[workspace]
|
||||||
members = [".", "peg_macro"]
|
members = [".", "mzp_peg_macro"]
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "peg_macro"
|
name = "mzp-peg-macro"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
|
|
||||||
+1
-1
@@ -121,7 +121,7 @@ pub fn parse_stat_labels(stat: &Stat, ctx: &Context) -> ParsedStat {
|
|||||||
}
|
}
|
||||||
|
|
||||||
mod grammar {
|
mod grammar {
|
||||||
use peg_macro::grammar;
|
use mzp_peg_macro::grammar;
|
||||||
|
|
||||||
grammar! {
|
grammar! {
|
||||||
program = (line ("\n" line)*)? EOI;
|
program = (line ("\n" line)*)? EOI;
|
||||||
|
|||||||
+1
-1
@@ -207,7 +207,7 @@ impl<'a, T: Clone> Capture<'a, T> {
|
|||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
mod tests {
|
mod tests {
|
||||||
use insta::assert_debug_snapshot;
|
use insta::assert_debug_snapshot;
|
||||||
use peg_macro::grammar;
|
use mzp_peg_macro::grammar;
|
||||||
|
|
||||||
use super::ParseState;
|
use super::ParseState;
|
||||||
|
|
||||||
|
|||||||
+1
-2
@@ -128,8 +128,7 @@ pub struct Stat {
|
|||||||
impl World {
|
impl World {
|
||||||
pub fn from_bytes(bytes: &[u8]) -> Result<World, LoadError> {
|
pub fn from_bytes(bytes: &[u8]) -> Result<World, LoadError> {
|
||||||
let (input, (_, num_boards)) = (tag(&[0xff, 0xff][..]), le_i16).parse(bytes)?;
|
let (input, (_, num_boards)) = (tag(&[0xff, 0xff][..]), le_i16).parse(bytes)?;
|
||||||
let (input, (ammo, gems, keys)) =
|
let (input, (ammo, gems, keys)) = (le_i16, le_i16, count(bool_u8, 7)).parse(input)?;
|
||||||
(le_i16, le_i16, count(bool_u8, 7)).parse(input)?;
|
|
||||||
let (input, (health, starting_board, torches, torch_cycles, energizer_cycles)) =
|
let (input, (health, starting_board, torches, torch_cycles, energizer_cycles)) =
|
||||||
(le_i16, le_i16, le_i16, le_i16, le_i16).parse(input)?;
|
(le_i16, le_i16, le_i16, le_i16, le_i16).parse(input)?;
|
||||||
let (input, (_, score, world_name)) = (take(2usize), le_i16, pstring(20)).parse(input)?;
|
let (input, (_, score, world_name)) = (take(2usize), le_i16, pstring(20)).parse(input)?;
|
||||||
|
|||||||
Reference in New Issue
Block a user