Playing with proc macros

This commit is contained in:
2025-05-23 22:12:24 -07:00
parent 856f817dbe
commit 59392ccad2
8 changed files with 64 additions and 0 deletions
+5
View File
@@ -1,15 +1,20 @@
mod encoding;
mod labels;
mod peg;
mod preprocess;
mod world;
use anyhow::anyhow;
use labels::labels::print_labels;
use peg_macro::grammar;
use preprocess::eval::Context;
use std::{env, error::Error, fs, path::PathBuf, process::exit};
use world::World;
fn main() -> Result<(), Box<dyn Error>> {
grammar!(123);
grammar!("abc");
let args: Vec<String> = env::args().collect();
if args.len() != 2 {
eprintln!("Usage: {} WORLD_FILE", args[0]);
+3
View File
@@ -0,0 +1,3 @@
pub mod peg;
pub use peg::*;
+6
View File
@@ -0,0 +1,6 @@
#[derive(Debug)]
#[allow(dead_code)]
pub enum Foo {
Bar(usize),
Baz(String),
}