Skip to content

Commit

Permalink
Rename asn1rs_model::generat{or,e}
Browse files Browse the repository at this point in the history
  • Loading branch information
kellerkindt committed Jan 16, 2024
1 parent c61f020 commit 90d54fe
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 17 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::asn::{ObjectIdentifier, ObjectIdentifierComponent};
use crate::generator::Generator;
use crate::generate::Generator;
use crate::model::Definition;
use crate::model::Model;
use crate::protobuf::{Protobuf, ProtobufType};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::asn::{Tag, TagProperty, Type as AsnType, Type};
use crate::generator::Generator;
use crate::generate::Generator;
use crate::model::{Definition, Model};
use crate::rust::{DataEnum, Field, Rust, RustType};
use crate::rust::{EncodingOrdering, PlainEnum};
Expand Down Expand Up @@ -922,7 +922,7 @@ impl RustCodeGenerator {
#[cfg(test)]
pub(crate) mod tests {
use super::*;
use crate::generator::walker::tests::assert_starts_with_lines;
use crate::generate::walker::tests::assert_starts_with_lines;
use crate::parse::Tokenizer;

#[test]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::asn::Charset;
use crate::asn::{Range, Size, Tag, TagProperty};
use crate::generator::RustCodeGenerator;
use crate::generate::RustCodeGenerator;
use crate::model::{Definition, LiteralValue, Model};
use crate::rust::{DataEnum, EncodingOrdering, Field, PlainEnum, Rust, RustType};
use codegen::{Block, Impl, Scope};
Expand Down
2 changes: 1 addition & 1 deletion asn1rs-model/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ extern crate strum_macros;
pub mod protobuf;

pub mod asn;
pub mod generator;
pub mod generate;
pub mod parse;
pub mod proc_macro;
pub mod resolve;
Expand Down
4 changes: 2 additions & 2 deletions asn1rs-model/src/proc_macro/inline.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use crate::generator::rust::RustCodeGenerator as RustGenerator;
use crate::generator::Generator;
use crate::generate::rust::RustCodeGenerator as RustGenerator;
use crate::generate::Generator;
use crate::model::Model;
use crate::parse::Tokenizer;

Expand Down
2 changes: 1 addition & 1 deletion asn1rs-model/src/proc_macro/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ pub fn expand(definition: Option<Definition<AsnModelType>>) -> Vec<TokenStream>

if let Some(definition) = definition {
model.definitions.push(definition);
use crate::generator::walker::AsnDefWriter;
use crate::generate::walker::AsnDefWriter;

if cfg!(feature = "debug-proc-macro") {
println!("---------- parsed definition to rust begin ----------");
Expand Down
4 changes: 2 additions & 2 deletions asn1rs-model/src/rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1205,8 +1205,8 @@ mod tests {
use crate::asn::Type as AsnType;
use crate::asn::{test_property, Range, Size, Tag};
use crate::asn::{Choice, Enumerated, EnumeratedVariant};
use crate::generator::walker::tests::assert_starts_with_lines;
use crate::generator::RustCodeGenerator;
use crate::generate::walker::tests::assert_starts_with_lines;
use crate::generate::RustCodeGenerator;
use crate::model::tests::*;
use crate::model::Field;
use crate::parse::Tokenizer;
Expand Down
12 changes: 6 additions & 6 deletions src/converter.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use asn1rs_model::asn::MultiModuleResolver;
use asn1rs_model::generator::rust::RustCodeGenerator as RustGenerator;
use asn1rs_model::generator::Generator;
use asn1rs_model::generate::rust::RustCodeGenerator as RustGenerator;
use asn1rs_model::generate::Generator;
use asn1rs_model::parse::Tokenizer;
use asn1rs_model::Model;
use std::collections::HashMap;
Expand All @@ -10,15 +10,15 @@ use std::path::Path;
pub enum Error {
RustGenerator,
#[cfg(feature = "protobuf")]
ProtobufGenerator(asn1rs_model::generator::protobuf::Error),
ProtobufGenerator(asn1rs_model::generate::protobuf::Error),
Model(asn1rs_model::parse::Error),
Io(std::io::Error),
ResolveError(asn1rs_model::resolve::Error),
}

#[cfg(feature = "protobuf")]
impl From<asn1rs_model::generator::protobuf::Error> for Error {
fn from(g: asn1rs_model::generator::protobuf::Error) -> Self {
impl From<asn1rs_model::generate::protobuf::Error> for Error {
fn from(g: asn1rs_model::generate::protobuf::Error) -> Self {
Error::ProtobufGenerator(g)
}
}
Expand Down Expand Up @@ -99,7 +99,7 @@ impl Converter {
let mut files = HashMap::with_capacity(models.len());

for model in &models {
let mut generator = asn1rs_model::generator::protobuf::ProtobufDefGenerator::default();
let mut generator = asn1rs_model::generate::protobuf::ProtobufDefGenerator::default();
generator.add_model(model.to_rust_with_scope(&scope[..]).to_protobuf());

files.insert(
Expand Down
2 changes: 1 addition & 1 deletion tests/proc_macro_reparse.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
//! V |
//! Rust-Model <--- proc-macro <---+

use asn1rs_model::generator::RustCodeGenerator;
use asn1rs_model::generate::RustCodeGenerator;
use asn1rs_model::parse::Tokenizer;
use asn1rs_model::rust::Rust;
use asn1rs_model::Definition;
Expand Down

0 comments on commit 90d54fe

Please sign in to comment.