Skip to content

Commit 0df96d8

Browse files
committed
Move linter context into core module
1 parent 91acfe4 commit 0df96d8

30 files changed

Lines changed: 51 additions & 55 deletions

rusty_linter/src/converter/common/convertible.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use rusty_common::{AtPos, Position, Positioned};
22

3-
use crate::converter::common::Context;
4-
use crate::core::LintErrorPos;
3+
use crate::core::{Context, LintErrorPos};
54

65
/// Convert from the current type into the target type O.
76
/// By default, O is the same as the current type.
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
1-
mod context;
21
mod convertible;
32
mod program_rules;
43
mod types;
54

6-
pub use self::context::*;
75
pub use self::convertible::*;
86
pub use self::types::*;

rusty_linter/src/converter/common/program_rules.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ use rusty_parser::{
33
DimVar, FunctionImplementation, GlobalStatement, GlobalStatementPos, Program, Statement, Statements, SubImplementation
44
};
55

6-
use crate::converter::common::{Context, Convertible, ConvertibleIn};
7-
use crate::core::{IntoQualified, LintErrorPos, ScopeName};
6+
use crate::converter::common::{Convertible, ConvertibleIn};
7+
use crate::core::{Context, IntoQualified, LintErrorPos, ScopeName};
88
use crate::names::ImplicitVars;
99

1010
impl Convertible for Program {

rusty_linter/src/converter/dim_rules/array_dimension.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
use rusty_parser::ArrayDimension;
22

3-
use crate::converter::common::{Context, Convertible, ConvertibleIn};
4-
use crate::core::LintErrorPos;
3+
use crate::converter::common::{Convertible, ConvertibleIn};
4+
use crate::core::{Context, LintErrorPos};
55

66
impl Convertible for ArrayDimension {
77
fn convert(self, ctx: &mut Context) -> Result<Self, LintErrorPos> {

rusty_linter/src/converter/dim_rules/dim_type_rules.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use rusty_common::*;
22
use rusty_parser::*;
33

4-
use crate::converter::common::{DimNameState, *};
5-
use crate::core::{IntoTypeQualifier, LintError, LintErrorPos, ValidateStringLength};
4+
use crate::converter::common::{Convertible, DimContext, DimNameState};
5+
use crate::core::{Context, IntoTypeQualifier, LintError, LintErrorPos, ValidateStringLength};
66

77
pub fn on_dim_type(
88
dim_type: DimType,

rusty_linter/src/converter/dim_rules/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
use rusty_common::*;
22
use rusty_parser::*;
33

4-
use crate::converter::common::{Context, ConvertibleIn, DimContext, DimNameState};
4+
use crate::converter::common::{ConvertibleIn, DimContext, DimNameState};
55
use crate::converter::dim_rules::dim_type_rules::on_dim_type;
66
use crate::converter::dim_rules::redim::on_redim_type;
77
use crate::converter::dim_rules::validation;
8-
use crate::core::{LintError, LintErrorPos};
8+
use crate::core::{Context, LintError, LintErrorPos};
99

1010
impl ConvertibleIn<DimContext> for DimList {
1111
fn convert_in(self, ctx: &mut Context, dim_context: DimContext) -> Result<Self, LintErrorPos> {

rusty_linter/src/converter/dim_rules/param_rules.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
use rusty_common::Position;
22
use rusty_parser::Parameter;
33

4-
use crate::converter::common::{Context, ConvertibleIn};
4+
use crate::converter::common::ConvertibleIn;
55
use crate::converter::dim_rules::param_type_rules::on_param_type;
66
use crate::converter::dim_rules::validation;
7-
use crate::core::LintErrorPos;
7+
use crate::core::{Context, LintErrorPos};
88

99
impl ConvertibleIn<Position> for Parameter {
1010
fn convert_in(self, ctx: &mut Context, pos: Position) -> Result<Self, LintErrorPos> {

rusty_linter/src/converter/dim_rules/param_type_rules.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
use rusty_common::Position;
22
use rusty_parser::{BareName, ParamType};
33

4-
use crate::converter::common::Context;
54
use crate::converter::dim_rules::dim_type_rules;
6-
use crate::core::LintErrorPos;
5+
use crate::core::{Context, LintErrorPos};
76

87
pub fn on_param_type(
98
dim_type: ParamType,

rusty_linter/src/converter/dim_rules/redim.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
use rusty_common::*;
22
use rusty_parser::*;
33

4-
use crate::converter::common::{Context, Convertible, DimNameState};
5-
use crate::core::{IntoTypeQualifier, LintError, LintErrorPos, ValidateStringLength};
4+
use crate::converter::common::{Convertible, DimNameState};
5+
use crate::core::{Context, IntoTypeQualifier, LintError, LintErrorPos, ValidateStringLength};
66

77
pub fn on_redim_type(
88
var_type: DimType,

rusty_linter/src/converter/dim_rules/validation.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
use rusty_common::{AtPos, Position, Positioned};
22
use rusty_parser::{AsBareName, DimVar, Parameter, TypedName, VarType};
33

4-
use crate::converter::common::Context;
5-
use crate::core::{ConstLookup, IntoTypeQualifier, LintError, LintErrorPos};
4+
use crate::core::{ConstLookup, Context, IntoTypeQualifier, LintError, LintErrorPos};
65

76
pub fn validate<T>(
87
var_name: &TypedName<T>,

0 commit comments

Comments
 (0)