mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Add TtCursorTokenSource and TtCursorTokenSink
This commit is contained in:
parent
1d7735fbc6
commit
aac9dfa464
4 changed files with 216 additions and 24 deletions
|
@ -61,6 +61,14 @@ pub fn parse(token_source: &dyn TokenSource, tree_sink: &mut dyn TreeSink) {
|
|||
event::process(tree_sink, events);
|
||||
}
|
||||
|
||||
/// Parse given tokens into the given sink as a path
|
||||
pub fn parse_path(token_source: &dyn TokenSource, tree_sink: &mut dyn TreeSink) {
|
||||
let mut p = parser::Parser::new(token_source);
|
||||
grammar::path(&mut p);
|
||||
let events = p.finish();
|
||||
event::process(tree_sink, events);
|
||||
}
|
||||
|
||||
/// A parsing function for a specific braced-block.
|
||||
pub struct Reparser(fn(&mut parser::Parser));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue