Bump edition to 2024, cargo fmt
This commit is contained in:
+1
-1
@@ -1,7 +1,7 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "assembler"
|
name = "assembler"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2024"
|
||||||
|
|
||||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
use anyhow::{anyhow, Result};
|
use anyhow::{Result, anyhow};
|
||||||
use codepage_437::CP437_WINGDINGS;
|
use codepage_437::CP437_WINGDINGS;
|
||||||
|
|
||||||
// Serialize multi-line content with CR-terminated lines
|
// Serialize multi-line content with CR-terminated lines
|
||||||
|
|||||||
+3
-1
@@ -25,7 +25,9 @@ fn main() -> Result<(), Box<dyn Error>> {
|
|||||||
|
|
||||||
// Prepare to evaluate macros from the world file's directory
|
// Prepare to evaluate macros from the world file's directory
|
||||||
let world_pathbuf = PathBuf::from(&world_filename);
|
let world_pathbuf = PathBuf::from(&world_filename);
|
||||||
let world_dir = world_pathbuf.parent().ok_or(anyhow!("Couldn't get world's directory"))?;
|
let world_dir = world_pathbuf
|
||||||
|
.parent()
|
||||||
|
.ok_or(anyhow!("Couldn't get world's directory"))?;
|
||||||
let eval_context = Context::new(&world_dir);
|
let eval_context = Context::new(&world_dir);
|
||||||
|
|
||||||
println!("num boards: {}", &world.boards.len());
|
println!("num boards: {}", &world.boards.len());
|
||||||
|
|||||||
@@ -1,9 +1,12 @@
|
|||||||
use std::{fs, path::{Path, PathBuf}};
|
use std::{
|
||||||
|
fs,
|
||||||
|
path::{Path, PathBuf},
|
||||||
|
};
|
||||||
|
|
||||||
use anyhow::{anyhow, bail, Result};
|
use anyhow::{Result, anyhow, bail};
|
||||||
|
|
||||||
use super::{
|
use super::{
|
||||||
parse::{parse, Expr},
|
parse::{Expr, parse},
|
||||||
scan::scan,
|
scan::scan,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -41,7 +44,7 @@ impl Context {
|
|||||||
pub fn new(working_directory: &Path) -> Self {
|
pub fn new(working_directory: &Path) -> Self {
|
||||||
Context {
|
Context {
|
||||||
file_loader: Box::new(FileLoader {
|
file_loader: Box::new(FileLoader {
|
||||||
working_dir: working_directory.into()
|
working_dir: working_directory.into(),
|
||||||
}),
|
}),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
use anyhow::{anyhow, Result};
|
use anyhow::{Result, anyhow};
|
||||||
|
|
||||||
use super::scan::Token;
|
use super::scan::Token;
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -1,13 +1,13 @@
|
|||||||
use std::{error::Error, fmt::Display};
|
use std::{error::Error, fmt::Display};
|
||||||
|
|
||||||
use nom::{
|
use nom::{
|
||||||
|
Err, IResult, Parser,
|
||||||
bytes::complete::{tag, take},
|
bytes::complete::{tag, take},
|
||||||
combinator::fail,
|
combinator::fail,
|
||||||
error::{ErrorKind, ParseError},
|
error::{ErrorKind, ParseError},
|
||||||
multi::count,
|
multi::count,
|
||||||
number::complete::{le_i16, le_u16, le_u8},
|
number::complete::{le_i16, le_u8, le_u16},
|
||||||
sequence::tuple,
|
sequence::tuple,
|
||||||
Err, IResult, Parser,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
|||||||
Reference in New Issue
Block a user