Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

Commit

Permalink
Fix after merge
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaReiser committed Nov 25, 2021
1 parent a497fb2 commit 5e930e8
Show file tree
Hide file tree
Showing 9 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions crates/rslint_parser/src/parser.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ use std::ops::Range;

pub use parse_error::*;
pub use parsed_syntax::{ConditionalParsedSyntax, InvalidParsedSyntax, ParsedSyntax};
#[allow(deprecated)]
pub use single_token_parse_recovery::SingleTokenParseRecovery;

pub use crate::parser::parse_recovery::{ParseRecovery, RecoveryError, RecoveryResult};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ use rslint_lexer::{SyntaxKind, T};
///
/// By default it doesn't check curly braces, use [with_braces_included] to turn opt-in the check
#[derive(Debug)]
#[deprecated(note = "Use ParsedSyntax with ParseRecovery instead")]
pub struct SingleTokenParseRecovery {
/// The [Diagnostic] to emit
error: Option<ParserError>,
Expand All @@ -18,6 +19,7 @@ pub struct SingleTokenParseRecovery {
unknown_node_kind: SyntaxKind,
}

#[allow(deprecated)]
impl SingleTokenParseRecovery {
pub fn new(recovery: TokenSet, unknown_node_kind: SyntaxKind) -> Self {
Self {
Expand Down
1 change: 1 addition & 0 deletions crates/rslint_parser/src/syntax/class.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#[allow(deprecated)]
use crate::parser::single_token_parse_recovery::SingleTokenParseRecovery;
use crate::parser::ParsedSyntax;
use crate::syntax::decl::{formal_param_pat, parameter_list, parameters_list};
Expand Down
1 change: 1 addition & 0 deletions crates/rslint_parser/src/syntax/decl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
use super::expr::assign_expr;
use super::pat::pattern;
use super::typescript::*;
#[allow(deprecated)]
use crate::parser::single_token_parse_recovery::SingleTokenParseRecovery;
use crate::parser::ParsedSyntax;
use crate::syntax::function::function_body;
Expand Down
1 change: 1 addition & 0 deletions crates/rslint_parser/src/syntax/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use super::decl::{arrow_body, parameter_list};
use super::pat::pattern;
use super::typescript::*;
use super::util::*;
#[allow(deprecated)]
use crate::parser::single_token_parse_recovery::SingleTokenParseRecovery;
use crate::syntax::class::class_expression;
use crate::syntax::function::function_expression;
Expand Down
2 changes: 2 additions & 0 deletions crates/rslint_parser/src/syntax/object.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#[allow(deprecated)]
use crate::parser::single_token_parse_recovery::SingleTokenParseRecovery;
use crate::parser::ParsedSyntax;
use crate::parser::ParsedSyntax::{Absent, Present};
Expand Down Expand Up @@ -160,6 +161,7 @@ fn object_member(p: &mut Parser) -> ParsedSyntax {
// test_err object_expr_non_ident_literal_prop
// let b = {5}

#[allow(deprecated)]
SingleTokenParseRecovery::new(token_set![T![:], T![,]], ERROR).recover(p);

if p.eat(T![:]) {
Expand Down
1 change: 1 addition & 0 deletions crates/rslint_parser/src/syntax/pat.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use super::expr::{assign_expr, identifier_name, lhs_expr, reference_identifier_expression};
#[allow(deprecated)]
use crate::parser::single_token_parse_recovery::SingleTokenParseRecovery;
use crate::syntax::object::object_prop_name;
use crate::{SyntaxKind::*, *};
Expand Down
2 changes: 2 additions & 0 deletions crates/rslint_parser/src/syntax/stmt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,14 @@ use super::pat::*;
use super::program::{export_decl, import_decl};
use super::typescript::*;
use super::util::{check_for_stmt_declaration, check_label_use, check_lhs};
#[allow(deprecated)]
use crate::parser::single_token_parse_recovery::SingleTokenParseRecovery;
use crate::parser::ParsedSyntax;
use crate::syntax::class::class_declaration;
use crate::syntax::function::function_declaration;
use crate::syntax::js_parse_error;
use crate::JsSyntaxFeature::StrictMode;
use crate::ParsedSyntax::{Absent, Present};
use crate::SyntaxFeature;
use crate::{SyntaxKind::*, *};

Expand Down
1 change: 1 addition & 0 deletions crates/rslint_parser/src/syntax/typescript.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
use super::decl::*;
use super::expr::{assign_expr, identifier_name, lhs_expr, literal_expression};
use super::stmt::{semi, statements, variable_declaration_statement};
#[allow(deprecated)]
use crate::parser::SingleTokenParseRecovery;
use crate::syntax::class::class_declaration;
use crate::syntax::expr::any_reference_member;
Expand Down

0 comments on commit 5e930e8

Please sign in to comment.