mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-12 13:18:47 +00:00
reformat
This commit is contained in:
parent
0ae26c344a
commit
ac932df22a
6 changed files with 11 additions and 14 deletions
|
@ -25,7 +25,7 @@ mod parser;
|
|||
pub mod syntax_kinds;
|
||||
pub use text::{TextRange, TextUnit};
|
||||
pub use tree::{File, Node, SyntaxKind, Token};
|
||||
pub(crate) use tree::{FileBuilder, Sink, ErrorMsg};
|
||||
pub(crate) use tree::{ErrorMsg, FileBuilder, Sink};
|
||||
pub use lexer::{next_token, tokenize};
|
||||
pub use parser::parse;
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
use {File, FileBuilder, ErrorMsg, Sink, SyntaxKind, TextUnit, Token};
|
||||
use {ErrorMsg, File, FileBuilder, Sink, SyntaxKind, TextUnit, Token};
|
||||
use syntax_kinds::TOMBSTONE;
|
||||
use super::is_insignificant;
|
||||
|
||||
|
@ -141,8 +141,8 @@ pub(super) fn to_file(text: String, tokens: &[Token], events: Vec<Event>) -> Fil
|
|||
builder.leaf(kind, len);
|
||||
}
|
||||
&Event::Error { ref message } => builder.error(ErrorMsg {
|
||||
message: message.clone()
|
||||
})
|
||||
message: message.clone(),
|
||||
}),
|
||||
}
|
||||
}
|
||||
builder.finish()
|
||||
|
|
|
@ -45,7 +45,7 @@ fn path_segment(p: &mut Parser, first: bool) {
|
|||
IDENT | SELF_KW | SUPER_KW => p.bump(),
|
||||
_ => {
|
||||
p.error("expected identifier");
|
||||
},
|
||||
}
|
||||
};
|
||||
segment.complete(p, PATH_SEGMENT);
|
||||
}
|
||||
|
|
|
@ -27,9 +27,9 @@ impl Marker {
|
|||
if idx == p.events.len() - 1 {
|
||||
match p.events.pop() {
|
||||
Some(Event::Start {
|
||||
kind: TOMBSTONE,
|
||||
forward_parent: None,
|
||||
}) => (),
|
||||
kind: TOMBSTONE,
|
||||
forward_parent: None,
|
||||
}) => (),
|
||||
_ => unreachable!(),
|
||||
}
|
||||
}
|
||||
|
@ -188,9 +188,6 @@ impl<'p, 't: 'p> Drop for ErrorBuilder<'p, 't> {
|
|||
|
||||
impl<'t, 'p> ErrorBuilder<'p, 't> {
|
||||
fn new(parser: &'p mut Parser<'t>, message: String) -> Self {
|
||||
ErrorBuilder {
|
||||
message,
|
||||
parser,
|
||||
}
|
||||
ErrorBuilder { message, parser }
|
||||
}
|
||||
}
|
||||
|
|
|
@ -157,5 +157,5 @@ fn grow(left: &mut TextRange, right: TextRange) {
|
|||
|
||||
#[derive(Default)]
|
||||
pub(crate) struct ErrorMsg {
|
||||
pub(crate) message: String
|
||||
pub(crate) message: String,
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ use std::fmt;
|
|||
use std::cmp;
|
||||
|
||||
mod file_builder;
|
||||
pub(crate) use self::file_builder::{FileBuilder, Sink, ErrorMsg};
|
||||
pub(crate) use self::file_builder::{ErrorMsg, FileBuilder, Sink};
|
||||
|
||||
pub use syntax_kinds::SyntaxKind;
|
||||
|
||||
|
|
Loading…
Reference in a new issue