Formatting

This commit is contained in:
Aleksey Kladov 2018-02-11 17:58:33 +03:00
parent 59087840f5
commit f356628ad8
5 changed files with 8 additions and 14 deletions

View File

@ -140,9 +140,7 @@ pub(super) fn to_file(text: String, tokens: &[Token], events: Vec<Event>) -> Fil
}
builder.leaf(kind, len);
}
&Event::Error { ref msg } => builder.error(ErrorMsg {
msg: msg.clone(),
}),
&Event::Error { ref msg } => builder.error(ErrorMsg { msg: msg.clone() }),
}
}
builder.finish()

View File

@ -94,7 +94,7 @@ fn item(p: &mut Parser) {
// test unsafe_auto_trait
// unsafe auto trait T {}
IDENT if p.at_kw("auto") && la == TRAIT_KW => {
IDENT if p.at_contextual_kw("auto") && la == TRAIT_KW => {
p.bump_remap(AUTO_KW);
traits::trait_item(p);
TRAIT_ITEM
@ -109,7 +109,7 @@ fn item(p: &mut Parser) {
// test unsafe_default_impl
// unsafe default impl Foo {}
IDENT if p.at_kw("default") && la == IMPL_KW => {
IDENT if p.at_contextual_kw("default") && la == IMPL_KW => {
p.bump_remap(DEFAULT_KW);
traits::impl_item(p);
IMPL_ITEM

View File

@ -1,8 +1,8 @@
use parser::input::{ParserInput, InputPosition};
use parser::input::{InputPosition, ParserInput};
use parser::event::Event;
use SyntaxKind;
use syntax_kinds::{TOMBSTONE, EOF};
use syntax_kinds::{EOF, TOMBSTONE};
/// Implementation details of `Parser`, extracted
/// to a separate struct in order not to pollute
@ -29,7 +29,6 @@ impl<'t> ParserImpl<'t> {
self.events
}
pub(super) fn nth(&self, n: u32) -> SyntaxKind {
self.inp.kind(self.pos + n)
}
@ -92,9 +91,9 @@ impl<'t> ParserImpl<'t> {
if idx == self.events.len() - 1 {
match self.events.pop() {
Some(Event::Start {
kind: TOMBSTONE,
forward_parent: None,
}) => (),
kind: TOMBSTONE,
forward_parent: None,
}) => (),
_ => unreachable!(),
}
}
@ -114,7 +113,6 @@ impl<'t> ParserImpl<'t> {
new_pos
}
fn event(&mut self, event: Event) {
self.events.push(event)
}

View File

@ -126,7 +126,6 @@ impl Drop for Marker {
}
}
pub(crate) struct CompletedMarker(u32);
impl CompletedMarker {

View File

@ -22,4 +22,3 @@ macro_rules! token_set {
token_set!($($t),*)
};
}