Skip to content

Commit

Permalink
Lint Rust
Browse files Browse the repository at this point in the history
  • Loading branch information
lukastaegert committed May 7, 2024
1 parent 15a59b4 commit b3d39d6
Show file tree
Hide file tree
Showing 57 changed files with 160 additions and 85 deletions.
2 changes: 1 addition & 1 deletion rust/parse_ast/src/ast_nodes/arrow_function_expression.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
use swc_ecma_ast::{ArrowExpr, BlockStmtOrExpr};

use crate::convert_ast::annotations::AnnotationKind;
use crate::convert_ast::converter::{AstConverter, convert_annotation};
use crate::convert_ast::converter::ast_constants::{
ARROW_FUNCTION_EXPRESSION_ANNOTATIONS_OFFSET, ARROW_FUNCTION_EXPRESSION_ASYNC_FLAG,
ARROW_FUNCTION_EXPRESSION_BODY_OFFSET, ARROW_FUNCTION_EXPRESSION_EXPRESSION_FLAG,
ARROW_FUNCTION_EXPRESSION_FLAGS_OFFSET, ARROW_FUNCTION_EXPRESSION_GENERATOR_FLAG,
ARROW_FUNCTION_EXPRESSION_PARAMS_OFFSET, ARROW_FUNCTION_EXPRESSION_RESERVED_BYTES,
TYPE_ARROW_FUNCTION_EXPRESSION,
};
use crate::convert_ast::converter::{convert_annotation, AstConverter};

impl<'a> AstConverter<'a> {
pub fn store_arrow_function_expression(&mut self, arrow_expression: &ArrowExpr) {
Expand Down
4 changes: 2 additions & 2 deletions rust/parse_ast/src/ast_nodes/binary_expression.rs
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
use swc_ecma_ast::{BinaryOp, BinExpr};
use swc_ecma_ast::{BinExpr, BinaryOp};

use crate::convert_ast::converter::ast_constants::{
BINARY_EXPRESSION_LEFT_OFFSET, BINARY_EXPRESSION_OPERATOR_OFFSET,
BINARY_EXPRESSION_RESERVED_BYTES, BINARY_EXPRESSION_RIGHT_OFFSET, TYPE_BINARY_EXPRESSION,
TYPE_LOGICAL_EXPRESSION,
};
use crate::convert_ast::converter::AstConverter;
use crate::convert_ast::converter::string_constants::{
STRING_ADD, STRING_BITAND, STRING_BITOR, STRING_BITXOR, STRING_DIV, STRING_EQEQ, STRING_EQEQEQ,
STRING_EXP, STRING_GT, STRING_GTEQ, STRING_IN, STRING_INSTANCEOF, STRING_LOGICALAND,
STRING_LOGICALOR, STRING_LSHIFT, STRING_LT, STRING_LTEQ, STRING_MOD, STRING_MUL, STRING_NOTEQ,
STRING_NOTEQEQ, STRING_NULLISHCOALESCING, STRING_RSHIFT, STRING_SUB, STRING_ZEROFILLRSHIFT,
};
use crate::convert_ast::converter::AstConverter;

impl<'a> AstConverter<'a> {
pub fn store_binary_expression(&mut self, binary_expression: &BinExpr) {
Expand Down
2 changes: 1 addition & 1 deletion rust/parse_ast/src/ast_nodes/block_statement.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use swc_ecma_ast::{BlockStmt, Expr, Lit, Stmt};

use crate::convert_ast::converter::ast_constants::{
BLOCK_STATEMENT_BODY_OFFSET, BLOCK_STATEMENT_RESERVED_BYTES, TYPE_BLOCK_STATEMENT,
BLOCK_STATEMENT_BODY_OFFSET, BLOCK_STATEMENT_RESERVED_BYTES, TYPE_BLOCK_STATEMENT,
};
use crate::convert_ast::converter::AstConverter;

Expand Down
2 changes: 1 addition & 1 deletion rust/parse_ast/src/ast_nodes/call_expression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ use swc_common::Span;
use swc_ecma_ast::{Expr, ExprOrSpread, OptCall, Super};

use crate::convert_ast::annotations::AnnotationKind;
use crate::convert_ast::converter::{AstConverter, convert_annotation};
use crate::convert_ast::converter::ast_constants::{
CALL_EXPRESSION_ANNOTATIONS_OFFSET, CALL_EXPRESSION_ARGUMENTS_OFFSET,
CALL_EXPRESSION_CALLEE_OFFSET, CALL_EXPRESSION_FLAGS_OFFSET, CALL_EXPRESSION_OPTIONAL_FLAG,
CALL_EXPRESSION_RESERVED_BYTES, TYPE_CALL_EXPRESSION,
};
use crate::convert_ast::converter::{convert_annotation, AstConverter};

impl<'a> AstConverter<'a> {
pub fn store_call_expression(
Expand Down
4 changes: 2 additions & 2 deletions rust/parse_ast/src/ast_nodes/catch_clause.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use swc_ecma_ast::CatchClause;

use crate::convert_ast::converter::ast_constants::{
CATCH_CLAUSE_BODY_OFFSET, CATCH_CLAUSE_PARAM_OFFSET, CATCH_CLAUSE_RESERVED_BYTES,
TYPE_CATCH_CLAUSE,
CATCH_CLAUSE_BODY_OFFSET, CATCH_CLAUSE_PARAM_OFFSET, CATCH_CLAUSE_RESERVED_BYTES,
TYPE_CATCH_CLAUSE,
};
use crate::convert_ast::converter::AstConverter;

Expand Down
5 changes: 4 additions & 1 deletion rust/parse_ast/src/ast_nodes/export_specifier.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
use swc_ecma_ast::ExportNamedSpecifier;

use crate::convert_ast::converter::ast_constants::{EXPORT_SPECIFIER_EXPORTED_OFFSET, EXPORT_SPECIFIER_LOCAL_OFFSET, EXPORT_SPECIFIER_RESERVED_BYTES, TYPE_EXPORT_SPECIFIER};
use crate::convert_ast::converter::ast_constants::{
EXPORT_SPECIFIER_EXPORTED_OFFSET, EXPORT_SPECIFIER_LOCAL_OFFSET, EXPORT_SPECIFIER_RESERVED_BYTES,
TYPE_EXPORT_SPECIFIER,
};
use crate::convert_ast::converter::AstConverter;

impl<'a> AstConverter<'a> {
Expand Down
4 changes: 2 additions & 2 deletions rust/parse_ast/src/ast_nodes/expression_statement.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use swc_ecma_ast::ExprStmt;

use crate::convert_ast::converter::ast_constants::{
EXPRESSION_STATEMENT_EXPRESSION_OFFSET, EXPRESSION_STATEMENT_RESERVED_BYTES,
TYPE_EXPRESSION_STATEMENT,
EXPRESSION_STATEMENT_EXPRESSION_OFFSET, EXPRESSION_STATEMENT_RESERVED_BYTES,
TYPE_EXPRESSION_STATEMENT,
};
use crate::convert_ast::converter::AstConverter;

Expand Down
5 changes: 4 additions & 1 deletion rust/parse_ast/src/ast_nodes/for_in_statement.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
use swc_ecma_ast::ForInStmt;

use crate::convert_ast::converter::ast_constants::{FOR_IN_STATEMENT_BODY_OFFSET, FOR_IN_STATEMENT_LEFT_OFFSET, FOR_IN_STATEMENT_RESERVED_BYTES, FOR_IN_STATEMENT_RIGHT_OFFSET, TYPE_FOR_IN_STATEMENT};
use crate::convert_ast::converter::ast_constants::{
FOR_IN_STATEMENT_BODY_OFFSET, FOR_IN_STATEMENT_LEFT_OFFSET, FOR_IN_STATEMENT_RESERVED_BYTES,
FOR_IN_STATEMENT_RIGHT_OFFSET, TYPE_FOR_IN_STATEMENT,
};
use crate::convert_ast::converter::AstConverter;

impl<'a> AstConverter<'a> {
Expand Down
6 changes: 3 additions & 3 deletions rust/parse_ast/src/ast_nodes/for_of_statement.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use swc_ecma_ast::ForOfStmt;

use crate::convert_ast::converter::ast_constants::{
FOR_OF_STATEMENT_AWAIT_FLAG, FOR_OF_STATEMENT_BODY_OFFSET, FOR_OF_STATEMENT_FLAGS_OFFSET,
FOR_OF_STATEMENT_LEFT_OFFSET, FOR_OF_STATEMENT_RESERVED_BYTES, FOR_OF_STATEMENT_RIGHT_OFFSET,
TYPE_FOR_OF_STATEMENT,
FOR_OF_STATEMENT_AWAIT_FLAG, FOR_OF_STATEMENT_BODY_OFFSET, FOR_OF_STATEMENT_FLAGS_OFFSET,
FOR_OF_STATEMENT_LEFT_OFFSET, FOR_OF_STATEMENT_RESERVED_BYTES, FOR_OF_STATEMENT_RIGHT_OFFSET,
TYPE_FOR_OF_STATEMENT,
};
use crate::convert_ast::converter::AstConverter;

Expand Down
5 changes: 4 additions & 1 deletion rust/parse_ast/src/ast_nodes/for_statement.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
use swc_ecma_ast::ForStmt;

use crate::convert_ast::converter::ast_constants::{FOR_STATEMENT_BODY_OFFSET, FOR_STATEMENT_INIT_OFFSET, FOR_STATEMENT_RESERVED_BYTES, FOR_STATEMENT_TEST_OFFSET, FOR_STATEMENT_UPDATE_OFFSET, TYPE_FOR_STATEMENT};
use crate::convert_ast::converter::ast_constants::{
FOR_STATEMENT_BODY_OFFSET, FOR_STATEMENT_INIT_OFFSET, FOR_STATEMENT_RESERVED_BYTES,
FOR_STATEMENT_TEST_OFFSET, FOR_STATEMENT_UPDATE_OFFSET, TYPE_FOR_STATEMENT,
};
use crate::convert_ast::converter::AstConverter;

impl<'a> AstConverter<'a> {
Expand Down
4 changes: 3 additions & 1 deletion rust/parse_ast/src/ast_nodes/identifier.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use swc_ecma_ast::{BindingIdent, Ident};

use crate::convert_ast::converter::ast_constants::{IDENTIFIER_NAME_OFFSET, IDENTIFIER_RESERVED_BYTES, TYPE_IDENTIFIER};
use crate::convert_ast::converter::ast_constants::{
IDENTIFIER_NAME_OFFSET, IDENTIFIER_RESERVED_BYTES, TYPE_IDENTIFIER,
};
use crate::convert_ast::converter::AstConverter;

impl<'a> AstConverter<'a> {
Expand Down
4 changes: 2 additions & 2 deletions rust/parse_ast/src/ast_nodes/if_statement.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use swc_ecma_ast::IfStmt;

use crate::convert_ast::converter::ast_constants::{
IF_STATEMENT_ALTERNATE_OFFSET, IF_STATEMENT_CONSEQUENT_OFFSET, IF_STATEMENT_RESERVED_BYTES,
IF_STATEMENT_TEST_OFFSET, TYPE_IF_STATEMENT,
IF_STATEMENT_ALTERNATE_OFFSET, IF_STATEMENT_CONSEQUENT_OFFSET, IF_STATEMENT_RESERVED_BYTES,
IF_STATEMENT_TEST_OFFSET, TYPE_IF_STATEMENT,
};
use crate::convert_ast::converter::AstConverter;

Expand Down
4 changes: 2 additions & 2 deletions rust/parse_ast/src/ast_nodes/import_declaration.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use swc_ecma_ast::ImportDecl;

use crate::convert_ast::converter::ast_constants::{
IMPORT_DECLARATION_ATTRIBUTES_OFFSET, IMPORT_DECLARATION_RESERVED_BYTES,
IMPORT_DECLARATION_SOURCE_OFFSET, IMPORT_DECLARATION_SPECIFIERS_OFFSET, TYPE_IMPORT_DECLARATION,
IMPORT_DECLARATION_ATTRIBUTES_OFFSET, IMPORT_DECLARATION_RESERVED_BYTES,
IMPORT_DECLARATION_SOURCE_OFFSET, IMPORT_DECLARATION_SPECIFIERS_OFFSET, TYPE_IMPORT_DECLARATION,
};
use crate::convert_ast::converter::AstConverter;

Expand Down
4 changes: 2 additions & 2 deletions rust/parse_ast/src/ast_nodes/import_default_specifier.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use swc_ecma_ast::ImportDefaultSpecifier;

use crate::convert_ast::converter::ast_constants::{
IMPORT_DEFAULT_SPECIFIER_LOCAL_OFFSET, IMPORT_DEFAULT_SPECIFIER_RESERVED_BYTES,
TYPE_IMPORT_DEFAULT_SPECIFIER,
IMPORT_DEFAULT_SPECIFIER_LOCAL_OFFSET, IMPORT_DEFAULT_SPECIFIER_RESERVED_BYTES,
TYPE_IMPORT_DEFAULT_SPECIFIER,
};
use crate::convert_ast::converter::AstConverter;

Expand Down
4 changes: 2 additions & 2 deletions rust/parse_ast/src/ast_nodes/import_expression.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ use swc_common::Span;
use swc_ecma_ast::ExprOrSpread;

use crate::convert_ast::converter::ast_constants::{
IMPORT_EXPRESSION_OPTIONS_OFFSET, IMPORT_EXPRESSION_RESERVED_BYTES,
IMPORT_EXPRESSION_SOURCE_OFFSET, TYPE_IMPORT_EXPRESSION,
IMPORT_EXPRESSION_OPTIONS_OFFSET, IMPORT_EXPRESSION_RESERVED_BYTES,
IMPORT_EXPRESSION_SOURCE_OFFSET, TYPE_IMPORT_EXPRESSION,
};
use crate::convert_ast::converter::AstConverter;

Expand Down
4 changes: 2 additions & 2 deletions rust/parse_ast/src/ast_nodes/import_namespace_specifier.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use swc_ecma_ast::ImportStarAsSpecifier;

use crate::convert_ast::converter::ast_constants::{
IMPORT_NAMESPACE_SPECIFIER_LOCAL_OFFSET, IMPORT_NAMESPACE_SPECIFIER_RESERVED_BYTES,
TYPE_IMPORT_NAMESPACE_SPECIFIER,
IMPORT_NAMESPACE_SPECIFIER_LOCAL_OFFSET, IMPORT_NAMESPACE_SPECIFIER_RESERVED_BYTES,
TYPE_IMPORT_NAMESPACE_SPECIFIER,
};
use crate::convert_ast::converter::AstConverter;

Expand Down
4 changes: 2 additions & 2 deletions rust/parse_ast/src/ast_nodes/import_specifier.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use swc_ecma_ast::ImportNamedSpecifier;

use crate::convert_ast::converter::ast_constants::{
IMPORT_SPECIFIER_IMPORTED_OFFSET, IMPORT_SPECIFIER_LOCAL_OFFSET, IMPORT_SPECIFIER_RESERVED_BYTES,
TYPE_IMPORT_SPECIFIER,
IMPORT_SPECIFIER_IMPORTED_OFFSET, IMPORT_SPECIFIER_LOCAL_OFFSET, IMPORT_SPECIFIER_RESERVED_BYTES,
TYPE_IMPORT_SPECIFIER,
};
use crate::convert_ast::converter::AstConverter;

Expand Down
5 changes: 4 additions & 1 deletion rust/parse_ast/src/ast_nodes/labeled_statement.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
use swc_ecma_ast::LabeledStmt;

use crate::convert_ast::converter::ast_constants::{LABELED_STATEMENT_BODY_OFFSET, LABELED_STATEMENT_LABEL_OFFSET, LABELED_STATEMENT_RESERVED_BYTES, TYPE_LABELED_STATEMENT};
use crate::convert_ast::converter::ast_constants::{
LABELED_STATEMENT_BODY_OFFSET, LABELED_STATEMENT_LABEL_OFFSET, LABELED_STATEMENT_RESERVED_BYTES,
TYPE_LABELED_STATEMENT,
};
use crate::convert_ast::converter::AstConverter;

impl<'a> AstConverter<'a> {
Expand Down
4 changes: 2 additions & 2 deletions rust/parse_ast/src/ast_nodes/literal_big_int.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use swc_ecma_ast::BigInt;

use crate::convert_ast::converter::ast_constants::{
LITERAL_BIG_INT_BIGINT_OFFSET, LITERAL_BIG_INT_RAW_OFFSET, LITERAL_BIG_INT_RESERVED_BYTES,
TYPE_LITERAL_BIG_INT,
LITERAL_BIG_INT_BIGINT_OFFSET, LITERAL_BIG_INT_RAW_OFFSET, LITERAL_BIG_INT_RESERVED_BYTES,
TYPE_LITERAL_BIG_INT,
};
use crate::convert_ast::converter::AstConverter;

Expand Down
5 changes: 4 additions & 1 deletion rust/parse_ast/src/ast_nodes/literal_boolean.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
use swc_ecma_ast::Bool;

use crate::convert_ast::converter::ast_constants::{LITERAL_BOOLEAN_FLAGS_OFFSET, LITERAL_BOOLEAN_RESERVED_BYTES, LITERAL_BOOLEAN_VALUE_FLAG, TYPE_LITERAL_BOOLEAN};
use crate::convert_ast::converter::ast_constants::{
LITERAL_BOOLEAN_FLAGS_OFFSET, LITERAL_BOOLEAN_RESERVED_BYTES, LITERAL_BOOLEAN_VALUE_FLAG,
TYPE_LITERAL_BOOLEAN,
};
use crate::convert_ast::converter::AstConverter;

impl<'a> AstConverter<'a> {
Expand Down
4 changes: 3 additions & 1 deletion rust/parse_ast/src/ast_nodes/literal_null.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use swc_ecma_ast::Null;

use crate::convert_ast::converter::ast_constants::{LITERAL_NULL_RESERVED_BYTES, TYPE_LITERAL_NULL};
use crate::convert_ast::converter::ast_constants::{
LITERAL_NULL_RESERVED_BYTES, TYPE_LITERAL_NULL,
};
use crate::convert_ast::converter::AstConverter;

impl<'a> AstConverter<'a> {
Expand Down
5 changes: 4 additions & 1 deletion rust/parse_ast/src/ast_nodes/literal_number.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
use swc_ecma_ast::Number;

use crate::convert_ast::converter::ast_constants::{LITERAL_NUMBER_RAW_OFFSET, LITERAL_NUMBER_RESERVED_BYTES, LITERAL_NUMBER_VALUE_OFFSET, TYPE_LITERAL_NUMBER};
use crate::convert_ast::converter::ast_constants::{
LITERAL_NUMBER_RAW_OFFSET, LITERAL_NUMBER_RESERVED_BYTES, LITERAL_NUMBER_VALUE_OFFSET,
TYPE_LITERAL_NUMBER,
};
use crate::convert_ast::converter::AstConverter;

impl<'a> AstConverter<'a> {
Expand Down
4 changes: 2 additions & 2 deletions rust/parse_ast/src/ast_nodes/literal_reg_exp.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use swc_ecma_ast::Regex;

use crate::convert_ast::converter::ast_constants::{
LITERAL_REG_EXP_FLAGS_OFFSET, LITERAL_REG_EXP_PATTERN_OFFSET, LITERAL_REG_EXP_RESERVED_BYTES,
TYPE_LITERAL_REG_EXP,
LITERAL_REG_EXP_FLAGS_OFFSET, LITERAL_REG_EXP_PATTERN_OFFSET, LITERAL_REG_EXP_RESERVED_BYTES,
TYPE_LITERAL_REG_EXP,
};
use crate::convert_ast::converter::AstConverter;

Expand Down
4 changes: 2 additions & 2 deletions rust/parse_ast/src/ast_nodes/literal_string.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
use swc_ecma_ast::Str;

use crate::convert_ast::converter::ast_constants::{
LITERAL_STRING_RAW_OFFSET, LITERAL_STRING_RESERVED_BYTES, LITERAL_STRING_VALUE_OFFSET,
TYPE_LITERAL_STRING,
LITERAL_STRING_RAW_OFFSET, LITERAL_STRING_RESERVED_BYTES, LITERAL_STRING_VALUE_OFFSET,
TYPE_LITERAL_STRING,
};
use crate::convert_ast::converter::AstConverter;

Expand Down
5 changes: 4 additions & 1 deletion rust/parse_ast/src/ast_nodes/meta_property.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
use swc_ecma_ast::{MetaPropExpr, MetaPropKind};

use crate::convert_ast::converter::ast_constants::{META_PROPERTY_META_OFFSET, META_PROPERTY_PROPERTY_OFFSET, META_PROPERTY_RESERVED_BYTES, TYPE_META_PROPERTY};
use crate::convert_ast::converter::ast_constants::{
META_PROPERTY_META_OFFSET, META_PROPERTY_PROPERTY_OFFSET, META_PROPERTY_RESERVED_BYTES,
TYPE_META_PROPERTY,
};
use crate::convert_ast::converter::AstConverter;

impl<'a> AstConverter<'a> {
Expand Down
7 changes: 5 additions & 2 deletions rust/parse_ast/src/ast_nodes/method_definition.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
use swc_common::Span;
use swc_ecma_ast::{ClassMethod, Constructor, Function, MethodKind, ParamOrTsParamProp, Pat, PrivateMethod, PrivateName, PropName};
use swc_ecma_ast::{
ClassMethod, Constructor, Function, MethodKind, ParamOrTsParamProp, Pat, PrivateMethod,
PrivateName, PropName,
};

use crate::convert_ast::converter::analyze_code::find_first_occurrence_outside_comment;
use crate::convert_ast::converter::ast_constants::{
METHOD_DEFINITION_COMPUTED_FLAG, METHOD_DEFINITION_FLAGS_OFFSET, METHOD_DEFINITION_KEY_OFFSET,
METHOD_DEFINITION_KIND_OFFSET, METHOD_DEFINITION_RESERVED_BYTES, METHOD_DEFINITION_STATIC_FLAG,
METHOD_DEFINITION_VALUE_OFFSET, TYPE_FUNCTION_EXPRESSION, TYPE_METHOD_DEFINITION,
};
use crate::convert_ast::converter::AstConverter;
use crate::convert_ast::converter::string_constants::{
STRING_CONSTRUCTOR, STRING_GET, STRING_METHOD, STRING_SET,
};
use crate::convert_ast::converter::AstConverter;

impl<'a> AstConverter<'a> {
pub fn store_method_definition(
Expand Down
6 changes: 3 additions & 3 deletions rust/parse_ast/src/ast_nodes/new_expression.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
use swc_ecma_ast::NewExpr;

use crate::convert_ast::annotations::AnnotationKind;
use crate::convert_ast::converter::{AstConverter, convert_annotation};
use crate::convert_ast::converter::ast_constants::{
NEW_EXPRESSION_ANNOTATIONS_OFFSET, NEW_EXPRESSION_ARGUMENTS_OFFSET, NEW_EXPRESSION_CALLEE_OFFSET,
NEW_EXPRESSION_RESERVED_BYTES, TYPE_NEW_EXPRESSION,
NEW_EXPRESSION_ANNOTATIONS_OFFSET, NEW_EXPRESSION_ARGUMENTS_OFFSET, NEW_EXPRESSION_CALLEE_OFFSET,
NEW_EXPRESSION_RESERVED_BYTES, TYPE_NEW_EXPRESSION,
};
use crate::convert_ast::converter::{convert_annotation, AstConverter};

impl<'a> AstConverter<'a> {
pub fn store_new_expression(&mut self, new_expression: &NewExpr) {
Expand Down
4 changes: 3 additions & 1 deletion rust/parse_ast/src/ast_nodes/object_expression.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use swc_ecma_ast::ObjectLit;

use crate::convert_ast::converter::ast_constants::{OBJECT_EXPRESSION_PROPERTIES_OFFSET, OBJECT_EXPRESSION_RESERVED_BYTES, TYPE_OBJECT_EXPRESSION};
use crate::convert_ast::converter::ast_constants::{
OBJECT_EXPRESSION_PROPERTIES_OFFSET, OBJECT_EXPRESSION_RESERVED_BYTES, TYPE_OBJECT_EXPRESSION,
};
use crate::convert_ast::converter::AstConverter;

impl<'a> AstConverter<'a> {
Expand Down
4 changes: 3 additions & 1 deletion rust/parse_ast/src/ast_nodes/object_pattern.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
use swc_ecma_ast::ObjectPat;

use crate::convert_ast::converter::ast_constants::{OBJECT_PATTERN_PROPERTIES_OFFSET, OBJECT_PATTERN_RESERVED_BYTES, TYPE_OBJECT_PATTERN};
use crate::convert_ast::converter::ast_constants::{
OBJECT_PATTERN_PROPERTIES_OFFSET, OBJECT_PATTERN_RESERVED_BYTES, TYPE_OBJECT_PATTERN,
};
use crate::convert_ast::converter::AstConverter;

impl<'a> AstConverter<'a> {
Expand Down
2 changes: 1 addition & 1 deletion rust/parse_ast/src/ast_nodes/panic_error.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::convert_ast::converter::{convert_string, update_reference_position};
use crate::convert_ast::converter::ast_constants::{
PANIC_ERROR_MESSAGE_OFFSET, PANIC_ERROR_RESERVED_BYTES, TYPE_PANIC_ERROR,
};
use crate::convert_ast::converter::{convert_string, update_reference_position};

pub fn get_panic_error_buffer(message: &str) -> Vec<u8> {
// type
Expand Down
4 changes: 2 additions & 2 deletions rust/parse_ast/src/ast_nodes/parse_error.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use crate::convert_ast::converter::ast_constants::{
PARSE_ERROR_MESSAGE_OFFSET, PARSE_ERROR_RESERVED_BYTES, TYPE_PARSE_ERROR,
PARSE_ERROR_MESSAGE_OFFSET, PARSE_ERROR_RESERVED_BYTES, TYPE_PARSE_ERROR,
};
use crate::convert_ast::converter::update_reference_position;

pub fn get_parse_error_buffer(error_buffer: &Vec<u8>, utf_16_pos: &u32) -> Vec<u8> {
pub fn get_parse_error_buffer(error_buffer: &[u8], utf_16_pos: &u32) -> Vec<u8> {
// type
let mut buffer = TYPE_PARSE_ERROR.to_vec();
// start
Expand Down
6 changes: 4 additions & 2 deletions rust/parse_ast/src/ast_nodes/program.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
use swc_ecma_ast::{Expr, Lit, ModuleItem, Program, Stmt};

use crate::convert_ast::converter::{AstConverter, convert_annotation};
use crate::convert_ast::converter::ast_constants::{PROGRAM_BODY_OFFSET, PROGRAM_INVALID_ANNOTATIONS_OFFSET, PROGRAM_RESERVED_BYTES, TYPE_PROGRAM};
use crate::convert_ast::converter::ast_constants::{
PROGRAM_BODY_OFFSET, PROGRAM_INVALID_ANNOTATIONS_OFFSET, PROGRAM_RESERVED_BYTES, TYPE_PROGRAM,
};
use crate::convert_ast::converter::{convert_annotation, AstConverter};

impl<'a> AstConverter<'a> {
pub fn store_program(&mut self, body: ModuleItemsOrStatements) {
Expand Down
2 changes: 1 addition & 1 deletion rust/parse_ast/src/ast_nodes/property.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ use crate::convert_ast::converter::ast_constants::{
PROPERTY_METHOD_FLAG, PROPERTY_RESERVED_BYTES, PROPERTY_SHORTHAND_FLAG, PROPERTY_VALUE_OFFSET,
TYPE_FUNCTION_EXPRESSION, TYPE_PROPERTY,
};
use crate::convert_ast::converter::AstConverter;
use crate::convert_ast::converter::string_constants::{STRING_GET, STRING_INIT, STRING_SET};
use crate::convert_ast::converter::AstConverter;

impl<'a> AstConverter<'a> {
pub fn convert_property(&mut self, property: &Prop) {
Expand Down

0 comments on commit b3d39d6

Please sign in to comment.