Skip to content

Commit

Permalink
update to rust edition 2018
Browse files Browse the repository at this point in the history
  • Loading branch information
hlorenzi committed Aug 19, 2019
1 parent f64ea0e commit eaf702f
Show file tree
Hide file tree
Showing 25 changed files with 70 additions and 69 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[package]
name = "customasm"
version = "0.10.0"
edition = "2018"
authors = ["Henrique Lorenzi <[email protected]>"]

[lib]
Expand Down
14 changes: 7 additions & 7 deletions src/asm/assembler.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
use diagn::{Span, RcReport};
use expr::{Expression, ExpressionValue, ExpressionEvalContext};
use asm::{AssemblerParser, BinaryOutput, LabelManager, LabelContext};
use asm::BankDef;
use asm::BinaryBlock;
use asm::cpudef::CpuDef;
use util::FileServer;
use crate::diagn::{Span, RcReport};
use crate::expr::{Expression, ExpressionValue, ExpressionEvalContext};
use crate::asm::{AssemblerParser, BinaryOutput, LabelManager, LabelContext};
use crate::asm::BankDef;
use crate::asm::BinaryBlock;
use crate::asm::cpudef::CpuDef;
use crate::util::FileServer;
use num_bigint::ToBigInt;


Expand Down
4 changes: 2 additions & 2 deletions src/asm/bankdef/bankdef.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use diagn::Span;
use syntax::{Token, TokenKind, Parser};
use crate::diagn::Span;
use crate::syntax::{Token, TokenKind, Parser};


pub struct BankDef
Expand Down
6 changes: 3 additions & 3 deletions src/asm/cpudef/cpudef.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use syntax::{Token, TokenKind, Parser};
use expr::{Expression, ExpressionValue};
use asm::cpudef::{Rule, RuleParameterType, RulePatternMatcher};
use crate::syntax::{Token, TokenKind, Parser};
use crate::expr::{Expression, ExpressionValue};
use crate::asm::cpudef::{Rule, RuleParameterType, RulePatternMatcher};
use num_bigint::BigInt;
use std::collections::HashMap;

Expand Down
6 changes: 3 additions & 3 deletions src/asm/cpudef/rule.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use diagn::Span;
use syntax::{Token, TokenKind};
use expr::{Expression, ExpressionValue};
use crate::diagn::Span;
use crate::syntax::{Token, TokenKind};
use crate::expr::{Expression, ExpressionValue};


#[derive(Debug)]
Expand Down
8 changes: 4 additions & 4 deletions src/asm/cpudef/rule_pattern_matcher.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use diagn::RcReport;
use syntax::{TokenKind, Parser};
use expr::{Expression, ExpressionValue};
use asm::cpudef::{Rule, RuleParameterType, RulePatternPart, CustomTokenDef};
use crate::diagn::RcReport;
use crate::syntax::{TokenKind, Parser};
use crate::expr::{Expression, ExpressionValue};
use crate::asm::cpudef::{Rule, RuleParameterType, RulePatternPart, CustomTokenDef};
use std::collections::HashMap;


Expand Down
2 changes: 1 addition & 1 deletion src/asm/label.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use expr::ExpressionValue;
use crate::expr::ExpressionValue;
use num_bigint::BigInt;
use num_traits::Zero;
use std::collections::HashMap;
Expand Down
20 changes: 10 additions & 10 deletions src/asm/parser.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
use diagn::{Span, RcReport};
use syntax::{Token, TokenKind, tokenize, Parser};
use syntax::excerpt_as_string_contents;
use expr::{Expression, ExpressionValue, ExpressionEvalContext};
use asm::{AssemblerState, ParsedInstruction, ParsedExpression};
use asm::cpudef::CpuDef;
use asm::BankDef;
use asm::BinaryBlock;
use util::filename_navigate;
use util::FileServer;
use crate::diagn::{Span, RcReport};
use crate::syntax::{Token, TokenKind, tokenize, Parser};
use crate::syntax::excerpt_as_string_contents;
use crate::expr::{Expression, ExpressionValue, ExpressionEvalContext};
use crate::asm::{AssemblerState, ParsedInstruction, ParsedExpression};
use crate::asm::cpudef::CpuDef;
use crate::asm::BankDef;
use crate::asm::BinaryBlock;
use crate::util::filename_navigate;
use crate::util::FileServer;
use num_bigint::BigInt;
use num_traits::ToPrimitive;

Expand Down
6 changes: 3 additions & 3 deletions src/diagn/report.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use diagn::Span;
use util::CharCounter;
use util::FileServer;
use crate::diagn::Span;
use crate::util::CharCounter;
use crate::util::FileServer;
use std::rc::Rc;
use std::cell::RefCell;
use std::io::Write;
Expand Down
10 changes: 5 additions & 5 deletions src/driver.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use diagn::RcReport;
use util::FileServer;
use util::enable_windows_ansi_support;
use asm::BinaryOutput;
use asm::AssemblerState;
use crate::diagn::RcReport;
use crate::util::FileServer;
use crate::util::enable_windows_ansi_support;
use crate::asm::BinaryOutput;
use crate::asm::AssemblerState;
use std::io::stdout;
use getopts;

Expand Down
2 changes: 1 addition & 1 deletion src/expr/eval.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use diagn::{RcReport, Span};
use crate::diagn::{RcReport, Span};
use super::Expression;
use super::ExpressionValue;
use super::UnaryOp;
Expand Down
2 changes: 1 addition & 1 deletion src/expr/expression.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use diagn::Span;
use crate::diagn::Span;
use num_bigint::BigInt;


Expand Down
2 changes: 1 addition & 1 deletion src/expr/inspect.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use diagn::Span;
use crate::diagn::Span;
use super::Expression;
use super::BinaryOp;

Expand Down
2 changes: 1 addition & 1 deletion src/expr/parser.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use syntax::{TokenKind, Parser, excerpt_as_usize, excerpt_as_bigint};
use crate::syntax::{TokenKind, Parser, excerpt_as_usize, excerpt_as_bigint};
use super::{Expression, ExpressionValue, UnaryOp, BinaryOp};


Expand Down
2 changes: 1 addition & 1 deletion src/syntax/excerpt.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use diagn::{Span, RcReport};
use crate::diagn::{Span, RcReport};
use num_bigint::BigInt;
use num_traits::Zero;

Expand Down
4 changes: 2 additions & 2 deletions src/syntax/parser.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use diagn::RcReport;
use syntax::{Token, TokenKind, excerpt_as_usize};
use crate::diagn::RcReport;
use crate::syntax::{Token, TokenKind, excerpt_as_usize};


pub struct Parser
Expand Down
2 changes: 1 addition & 1 deletion src/syntax/token.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use diagn::{Span, RcReport};
use crate::diagn::{Span, RcReport};
use std::rc::Rc;


Expand Down
6 changes: 3 additions & 3 deletions src/test/asm.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use diagn::RcReport;
use asm::AssemblerState;
use util::{FileServer, FileServerMock};
use crate::diagn::RcReport;
use crate::asm::AssemblerState;
use crate::util::{FileServer, FileServerMock};
use super::ExpectedResult::*;
use super::{ExpectedResult, expect_result};

Expand Down
8 changes: 4 additions & 4 deletions src/test/cpudef.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use diagn::RcReport;
use asm::cpudef::CpuDef;
use syntax::{Parser, tokenize};
use util::{FileServer, FileServerMock};
use crate::diagn::RcReport;
use crate::asm::cpudef::CpuDef;
use crate::syntax::{Parser, tokenize};
use crate::util::{FileServer, FileServerMock};
use super::ExpectedResult::*;
use super::{ExpectedResult, expect_result};

Expand Down
6 changes: 3 additions & 3 deletions src/test/excerpt.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use diagn::{Span, RcReport};
use syntax::excerpt_as_string_contents;
use util::FileServerMock;
use crate::diagn::{Span, RcReport};
use crate::syntax::excerpt_as_string_contents;
use crate::util::FileServerMock;
use super::ExpectedResult::*;
use super::{ExpectedResult, expect_result};
use std::rc::Rc;
Expand Down
10 changes: 5 additions & 5 deletions src/test/expr.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use diagn::RcReport;
use syntax::{tokenize, Parser};
use expr::{Expression, ExpressionValue, ExpressionEvalContext};
use util::{FileServer, FileServerMock};
use crate::diagn::RcReport;
use crate::syntax::{tokenize, Parser};
use crate::expr::{Expression, ExpressionValue, ExpressionEvalContext};
use crate::util::{FileServer, FileServerMock};
use super::ExpectedResult::*;
use super::{ExpectedResult, expect_result};
use num_bigint::BigInt;
Expand All @@ -10,7 +10,7 @@ use num_bigint::BigInt;
fn test<S>(src: S, expected: ExpectedResult<ExpressionValue>)
where S: Into<Vec<u8>>
{
fn compile(report: RcReport, fileserver: &FileServer) -> Result<ExpressionValue, ()>
fn compile(report: RcReport, fileserver: &dyn FileServer) -> Result<ExpressionValue, ()>
{
let chars = fileserver.get_chars(report.clone(), "test", None)?;
let tokens = tokenize(report.clone(), "test", &chars)?;
Expand Down
6 changes: 3 additions & 3 deletions src/test/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ mod cpudef;
mod asm;


use diagn::RcReport;
use util::FileServer;
use util::enable_windows_ansi_support;
use crate::diagn::RcReport;
use crate::util::FileServer;
use crate::util::enable_windows_ansi_support;
use std::fmt::Debug;
use std::cmp::PartialEq;

Expand Down
2 changes: 1 addition & 1 deletion src/util/filename.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use diagn::{Span, RcReport};
use crate::diagn::{Span, RcReport};
use std::path::{PathBuf, Component};


Expand Down
2 changes: 1 addition & 1 deletion src/util/fileserver.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use diagn::{Span, RcReport};
use crate::diagn::{Span, RcReport};
use std::collections::HashMap;
use std::fs::File;
use std::io::{Read, Write};
Expand Down
6 changes: 3 additions & 3 deletions src/webasm/mod.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use asm::AssemblerState;
use diagn::RcReport;
use util::FileServerMock;
use crate::asm::AssemblerState;
use crate::diagn::RcReport;
use crate::util::FileServerMock;
use std::mem;
use std::ptr;

Expand Down

0 comments on commit eaf702f

Please sign in to comment.