From 359d3be308cab2415218200f5799c5031213c250 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 2 May 2020 14:34:39 +0200 Subject: Fix parsing of blocks without `{` --- crates/ra_parser/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_parser/src/lib.rs') diff --git a/crates/ra_parser/src/lib.rs b/crates/ra_parser/src/lib.rs index 652492c1e..e08ad4dae 100644 --- a/crates/ra_parser/src/lib.rs +++ b/crates/ra_parser/src/lib.rs @@ -112,7 +112,7 @@ pub fn parse_fragment( FragmentKind::Type => grammar::fragments::type_, FragmentKind::Pattern => grammar::fragments::pattern, FragmentKind::Item => grammar::fragments::item, - FragmentKind::Block => grammar::fragments::block, + FragmentKind::Block => grammar::fragments::block_expr, FragmentKind::Visibility => grammar::fragments::opt_visibility, FragmentKind::MetaItem => grammar::fragments::meta_item, FragmentKind::Statement => grammar::fragments::stmt, -- cgit v1.2.3 From ef6d53521f07caa9c524749116d5fe53e1e8408d Mon Sep 17 00:00:00 2001 From: Simon Vandel Sillesen Date: Sat, 16 May 2020 18:06:23 +0200 Subject: Shrink ra_parser::Event from 32 bytes to 16 bytes This boxes the Error variant with the assumption that it is rarely constructed --- crates/ra_parser/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_parser/src/lib.rs') diff --git a/crates/ra_parser/src/lib.rs b/crates/ra_parser/src/lib.rs index e08ad4dae..eeb8ad66b 100644 --- a/crates/ra_parser/src/lib.rs +++ b/crates/ra_parser/src/lib.rs @@ -25,7 +25,7 @@ pub(crate) use token_set::TokenSet; pub use syntax_kind::SyntaxKind; #[derive(Debug, Clone, PartialEq, Eq, Hash)] -pub struct ParseError(pub String); +pub struct ParseError(pub Box); /// `TokenSource` abstracts the source of the tokens parser operates on. /// -- cgit v1.2.3