Skip to content

Commit

Permalink
Merge pull request #1 from berkus/fix/update-edition
Browse files Browse the repository at this point in the history
Update edition, upgrade package deps
  • Loading branch information
no111u3 authored Nov 15, 2024
2 parents 45f09ed + e055774 commit 972486a
Show file tree
Hide file tree
Showing 18 changed files with 869 additions and 527 deletions.
972 changes: 644 additions & 328 deletions Cargo.lock

Large diffs are not rendered by default.

30 changes: 16 additions & 14 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
[package]
name = "avra-rs"
version = "0.3.0"
version = "0.4.0"
authors = ["Boris Vinogradov <no111u3@gmail.com>"]
description = "Assembler for Microchip(similar to Atmel) AVR microcontroller family"
edition = "2018"
edition = "2021"
license = "Apache-2.0"
keywords = ["avr", "assembly", "assembler", "asm"]
categories = ["embedded"]
Expand All @@ -19,20 +19,22 @@ name = "avra_lib"
path = "src/lib.rs"

[dependencies]
peg = "0.6"
byteorder = "1.3"
peg = "0.8"
byteorder = "1.5"
failure = "0.1"
strum = "0.17"
strum_macros = "0.17"
ihex = "1.1"
strum = "0.26"
strum_macros = "0.26"
ihex = "3.0"
maplit = "1.0"
lazy_static = "1.4"
clap = "2.33"
clap = "4.5"
structopt = "0.3"
walkdir = "2.3"
dirs = "2.0"
walkdir = "2.5"
dirs = "5.0"

[build-dependencies]
checksums = "0.6"
walkdir = "2.3"
dirs = "2.0"
checksums = "0.9"
walkdir = "2.5"
dirs = "5.0"

[profile.release]
lto = true
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,19 @@ To build the `avra-rs` you can use `cargo build` and `cargo install`, or you can

## Usage

To compile source file you need to run `avra-rs` with argument `-s` for describe path to
source and optionally you can provide output path by `-o`. for provide another place of
eeprom store you can use `-e` key.
To compile source file you need to run `avra-rs` with argument `-s` with path to the
source and optionally you can provide output path with `-o`. To provide another place in
EEPROM store you can use `-e`.

For more verbose output you can use `-v` key.
For more verbose output you can use `-v`.

Other options aren't supported.
Detail information of assembler will be added in near future.

## MSRV

`cargo msrv` puts it at 1.80.1.

## Change log

See [CHANGELOG.md](CHANGELOG.md).
See [CHANGELOG.md](CHANGELOG.md).
4 changes: 1 addition & 3 deletions build.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
use std::collections::BTreeSet;
use std::fs;
use std::path::PathBuf;
use std::{collections::BTreeSet, fs, path::PathBuf};

use checksums::{hash_file, Algorithm};
use dirs::config_dir;
Expand Down
2 changes: 2 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[toolchain]
channel = "stable"
1 change: 1 addition & 0 deletions rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
imports_granularity = "Crate"
12 changes: 7 additions & 5 deletions src/builder/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ pub mod pass0;
pub mod pass1;
pub mod pass2;

use crate::builder::pass0::build_pass_0 as pass0;
use crate::builder::pass1::build_pass_1 as pass1;
use crate::builder::pass2::build_pass_2 as pass2;
use crate::context::{CommonContext, Context};
use crate::parser::{parse_file, parse_str, ParseResult, Paths};
use crate::{
builder::{
pass0::build_pass_0 as pass0, pass1::build_pass_1 as pass1, pass2::build_pass_2 as pass2,
},
context::{CommonContext, Context},
parser::{parse_file, parse_str, ParseResult, Paths},
};

use failure::{bail, Error};
use std::path::PathBuf;
Expand Down
24 changes: 12 additions & 12 deletions src/builder/pass0.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
//! Contains zero pass builder of AVRA-rs
use std::cell::RefCell;
use std::collections::HashMap;
use std::path::PathBuf;
use std::rc::Rc;
use std::string::ToString;
use std::{cell::RefCell, collections::HashMap, path::PathBuf, rc::Rc, string::ToString};

use crate::context::CommonContext;
use crate::instruction::operation::Operation;
use crate::parser::{
parse_iter, CodePoint, Item, Macro, ParseContext, ParseResult, Paths, Segment, SegmentType,
use crate::{
context::CommonContext,
instruction::operation::Operation,
parser::{
parse_iter, CodePoint, Item, Macro, ParseContext, ParseResult, Paths, Segment, SegmentType,
},
};

use crate::instruction::InstructionOps;
Expand Down Expand Up @@ -214,9 +212,11 @@ fn macro_expand(
#[cfg(test)]
mod builder_tests {
use super::*;
use crate::expr::Expr;
use crate::instruction::{register::Reg8, InstructionOps};
use crate::parser::parse_str;
use crate::{
expr::Expr,
instruction::{register::Reg8, InstructionOps},
parser::parse_str,
};

#[test]
fn check_non_argument_macro() {
Expand Down
22 changes: 13 additions & 9 deletions src/builder/pass1.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
//! Contains first pass builder of AVRA-rs
use crate::builder::pass0::BuildResultPass0;
use crate::context::{CommonContext, Context};
use crate::directive::{GetData, Operand};
use crate::expr::Expr;
use crate::parser::{CodePoint, DataDefine, Item, Segment, SegmentType};
use crate::{
builder::pass0::BuildResultPass0,
context::{CommonContext, Context},
directive::{GetData, Operand},
expr::Expr,
parser::{CodePoint, DataDefine, Item, Segment, SegmentType},
};

use failure::{bail, Error};

Expand Down Expand Up @@ -158,10 +160,12 @@ fn pass_1_internal(
#[cfg(test)]
mod builder_tests {
use super::*;
use crate::builder::pass0::build_pass_0;
use crate::directive::Operand;
use crate::instruction::{operation::Operation, register::Reg8, InstructionOps};
use crate::parser::parse_str;
use crate::{
builder::pass0::build_pass_0,
directive::Operand,
instruction::{operation::Operation, register::Reg8, InstructionOps},
parser::parse_str,
};
use maplit::hashmap;

#[test]
Expand Down
24 changes: 15 additions & 9 deletions src/builder/pass2.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
//! Contains second pass builder of AVRA-rs
use crate::builder::pass1::BuildResultPass1;
use crate::context::{CommonContext, Context};
use crate::directive::GetData;
use crate::expr::Expr;
use crate::instruction::{process, register::Reg8};
use crate::parser::{DataDefine, Item, Segment, SegmentType};
use crate::{
builder::pass1::BuildResultPass1,
context::{CommonContext, Context},
directive::GetData,
expr::Expr,
instruction::{process, register::Reg8},
parser::{DataDefine, Item, Segment, SegmentType},
};

use std::str::FromStr;

Expand Down Expand Up @@ -162,9 +164,13 @@ fn pass_2_internal(segment: &Segment, common_context: &CommonContext) -> Result<
#[cfg(test)]
mod builder_tests {
use super::*;
use crate::builder::pass0::{build_pass_0, BuildResultPass0};
use crate::builder::pass1::build_pass_1;
use crate::parser::parse_str;
use crate::{
builder::{
pass0::{build_pass_0, BuildResultPass0},
pass1::build_pass_1,
},
parser::parse_str,
};

#[test]
fn check_empty() {
Expand Down
11 changes: 3 additions & 8 deletions src/context.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
use crate::device::Device;
use crate::expr::Expr;
use crate::instruction::register::Reg8;
use crate::parser::SegmentType;

use std::cell::RefCell;
use std::collections::HashMap;
use std::rc::Rc;
use crate::{device::Device, expr::Expr, instruction::register::Reg8, parser::SegmentType};

use std::{cell::RefCell, collections::HashMap, rc::Rc};

use maplit::hashmap;

Expand Down
Loading

0 comments on commit 972486a

Please sign in to comment.