diff options
author | Aleksey Kladov <[email protected]> | 2019-02-20 19:02:03 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-02-20 19:02:03 +0000 |
commit | d2bce118ae72ee5cf96b8c6ac687914cb842363c (patch) | |
tree | 21e35f7d44add69cb3bc3d4af09e0bdd01dac0a9 /crates/ra_syntax/src/parsing/parser_api.rs | |
parent | 0c81b9deeed81bfb2cf8142af9d748317d5d71a1 (diff) |
switch to dynamic dispatch for TokenSource
Benchmarks show no difference. This is probably because we are
bottlenecked on memory allocations, and we should fix that, but we are
not optimizing for performance just yet.
changes. Lines starting # with '#' will be ignored, and an empty
message aborts the commit. # # On branch token-source # Changes to be
committed: # modified: crates/ra_syntax/src/parsing/parser_api.rs #
modified: crates/ra_syntax/src/parsing/parser_impl.rs #
Diffstat (limited to 'crates/ra_syntax/src/parsing/parser_api.rs')
-rw-r--r-- | crates/ra_syntax/src/parsing/parser_api.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/crates/ra_syntax/src/parsing/parser_api.rs b/crates/ra_syntax/src/parsing/parser_api.rs index 813ae494c..aed23a6a4 100644 --- a/crates/ra_syntax/src/parsing/parser_api.rs +++ b/crates/ra_syntax/src/parsing/parser_api.rs | |||
@@ -4,7 +4,7 @@ use crate::{ | |||
4 | SyntaxKind::{self, ERROR}, | 4 | SyntaxKind::{self, ERROR}, |
5 | parsing::{ | 5 | parsing::{ |
6 | token_set::TokenSet, | 6 | token_set::TokenSet, |
7 | parser_impl::ParserImpl | 7 | parser_impl::ParserImpl, |
8 | }, | 8 | }, |
9 | }; | 9 | }; |
10 | 10 | ||
@@ -17,9 +17,7 @@ use crate::{ | |||
17 | /// tree, but rather a flat stream of events of the form | 17 | /// tree, but rather a flat stream of events of the form |
18 | /// "start expression, consume number literal, | 18 | /// "start expression, consume number literal, |
19 | /// finish expression". See `Event` docs for more. | 19 | /// finish expression". See `Event` docs for more. |
20 | pub(crate) struct Parser<'t>( | 20 | pub(crate) struct Parser<'t>(pub(super) ParserImpl<'t>); |
21 | pub(super) ParserImpl<crate::parsing::parser_impl::input::ParserInput<'t>>, | ||
22 | ); | ||
23 | 21 | ||
24 | impl<'t> Parser<'t> { | 22 | impl<'t> Parser<'t> { |
25 | /// Returns the kind of the current token. | 23 | /// Returns the kind of the current token. |