aboutsummaryrefslogtreecommitdiff
path: root/src/parser_impl
diff options
context:
space:
mode:
Diffstat (limited to 'src/parser_impl')
-rw-r--r--src/parser_impl/event.rs2
-rw-r--r--src/parser_impl/mod.rs8
2 files changed, 5 insertions, 5 deletions
diff --git a/src/parser_impl/event.rs b/src/parser_impl/event.rs
index eb5d0a4be..66a0b6fc0 100644
--- a/src/parser_impl/event.rs
+++ b/src/parser_impl/event.rs
@@ -76,7 +76,7 @@ pub(crate) enum Event {
76 }, 76 },
77} 77}
78 78
79pub(super) fn process(builder: &mut impl Sink, tokens: &[Token], events: Vec<Event>) { 79pub(super) fn process<'a>(builder: &mut impl Sink<'a>, tokens: &[Token], events: Vec<Event>) {
80 let mut idx = 0; 80 let mut idx = 0;
81 81
82 let mut holes = Vec::new(); 82 let mut holes = Vec::new();
diff --git a/src/parser_impl/mod.rs b/src/parser_impl/mod.rs
index b58094be3..2791c8da5 100644
--- a/src/parser_impl/mod.rs
+++ b/src/parser_impl/mod.rs
@@ -14,10 +14,10 @@ use {
14 14
15use SyntaxKind::{self, EOF, TOMBSTONE}; 15use SyntaxKind::{self, EOF, TOMBSTONE};
16 16
17pub(crate) trait Sink { 17pub(crate) trait Sink<'a> {
18 type Tree; 18 type Tree;
19 19
20 fn new(text: String) -> Self; 20 fn new(text: &'a str) -> Self;
21 21
22 fn leaf(&mut self, kind: SyntaxKind, len: TextUnit); 22 fn leaf(&mut self, kind: SyntaxKind, len: TextUnit);
23 fn start_internal(&mut self, kind: SyntaxKind); 23 fn start_internal(&mut self, kind: SyntaxKind);
@@ -27,9 +27,9 @@ pub(crate) trait Sink {
27} 27}
28 28
29/// Parse a sequence of tokens into the representative node tree 29/// Parse a sequence of tokens into the representative node tree
30pub(crate) fn parse<S: Sink>(text: String, tokens: &[Token]) -> S::Tree { 30pub(crate) fn parse<'a, S: Sink<'a>>(text: &'a str, tokens: &[Token]) -> S::Tree {
31 let events = { 31 let events = {
32 let input = input::ParserInput::new(&text, tokens); 32 let input = input::ParserInput::new(text, tokens);
33 let parser_impl = ParserImpl::new(&input); 33 let parser_impl = ParserImpl::new(&input);
34 let mut parser_api = Parser(parser_impl); 34 let mut parser_api = Parser(parser_impl);
35 grammar::file(&mut parser_api); 35 grammar::file(&mut parser_api);