Playing with proc macros
This commit is contained in:
@@ -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]);
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
pub mod peg;
|
||||
|
||||
pub use peg::*;
|
||||
@@ -0,0 +1,6 @@
|
||||
#[derive(Debug)]
|
||||
#[allow(dead_code)]
|
||||
pub enum Foo {
|
||||
Bar(usize),
|
||||
Baz(String),
|
||||
}
|
||||
Reference in New Issue
Block a user