Skip to content

Commit

Permalink
code improvement
Browse files Browse the repository at this point in the history
  • Loading branch information
Fumuran committed Feb 25, 2023
1 parent 644b6b0 commit f72569a
Show file tree
Hide file tree
Showing 6 changed files with 124 additions and 106 deletions.
2 changes: 1 addition & 1 deletion air-script/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ path = "src/main.rs"

[dependencies]
codegen-winter = { package = "air-codegen-winter", path = "../codegen/winterfell", version = "0.2.0" }
codegen-gce = { package = "air-codegen-gce", path = "../codegen/gce", version = "0.1.0" }
codegen-gce = { package = "air-codegen-gce", path = "../codegen/gce", version = "0.2.0" }
env_logger = "0.10.0"
ir = { package = "air-ir", path = "../ir", version = "0.2.0" }
log = { version = "0.4", default-features = false }
Expand Down
1 change: 1 addition & 0 deletions air-script/tests/main.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use expect_test::expect_file;
use std::fs::{self, File};
use std::io::prelude::*;

mod helpers;
use helpers::Test;

Expand Down
2 changes: 1 addition & 1 deletion codegen/gce/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "air-codegen-gce"
version = "0.1.0"
version = "0.2.0"
description="Code generation for the generic constraint evaluation format."
authors = ["miden contributors"]
readme="README.md"
Expand Down
8 changes: 4 additions & 4 deletions codegen/gce/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,23 +10,23 @@ pub enum ConstraintEvaluationError {
impl ConstraintEvaluationError {
pub fn invalid_trace_segment(segment: u8) -> Self {
ConstraintEvaluationError::InvalidTraceSegment(format!(
"Trace segment {segment} is invalid"
"Trace segment {segment} is invalid."
))
}

pub fn constant_not_found(name: &str) -> Self {
ConstraintEvaluationError::ConstantNotFound(format!("Constant \"{name}\" not found"))
ConstraintEvaluationError::ConstantNotFound(format!("Constant \"{name}\" not found."))
}

pub fn invalid_constant_type(name: &str, constant_type: &str) -> Self {
ConstraintEvaluationError::InvalidConstantType(format!(
"Invalid type of constant \"{name}\". {constant_type} exprected."
"Invalid type of constant \"{name}\". Expected \"{constant_type}\"."
))
}

pub fn operation_not_found(index: usize) -> Self {
ConstraintEvaluationError::OperationNotFound(format!(
"Operation with index {index} does not match the expression in the expressions JSON array"
"Operation with index {index} does not match the expression in the JSON expressions array."
))
}
}
Loading

0 comments on commit f72569a

Please sign in to comment.