aboutsummaryrefslogtreecommitdiff
path: root/src/parser/event_parser/mod.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-01-01 13:05:46 +0000
committerAleksey Kladov <[email protected]>2018-01-01 13:05:46 +0000
commit4cda3255309e7ed9c9d9094e12a8d91bdc1554ab (patch)
treee82fd275d4b019397c4f8d559c4036fbd80e01d9 /src/parser/event_parser/mod.rs
parente24cadb490ee3d912a500d8ae4f1455ece0d5e68 (diff)
Parser: even more groundwork
Diffstat (limited to 'src/parser/event_parser/mod.rs')
-rw-r--r--src/parser/event_parser/mod.rs20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/parser/event_parser/mod.rs b/src/parser/event_parser/mod.rs
new file mode 100644
index 000000000..14107720a
--- /dev/null
+++ b/src/parser/event_parser/mod.rs
@@ -0,0 +1,20 @@
1use {Token, TextUnit, SyntaxKind};
2
3use syntax_kinds::*;
4mod grammar;
5mod parser;
6
7pub(crate) enum Event {
8 Start { kind: SyntaxKind },
9 Finish,
10 Token {
11 kind: SyntaxKind,
12 n_raw_tokens: u8,
13 }
14}
15
16pub(crate) fn parse<'t>(text: &'t str, raw_tokens: &'t [Token]) -> Vec<Event> {
17 let mut parser = parser::Parser::new(text, raw_tokens);
18 grammar::parse_file(&mut parser);
19 parser.into_events()
20} \ No newline at end of file