aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs2
-rw-r--r--src/parser/mod.rs12
2 files changed, 11 insertions, 3 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 0685e3f2c..13872a3d9 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -3,8 +3,10 @@ extern crate unicode_xid;
3mod text; 3mod text;
4mod tree; 4mod tree;
5mod lexer; 5mod lexer;
6mod parser;
6 7
7pub mod syntax_kinds; 8pub mod syntax_kinds;
8pub use text::{TextUnit, TextRange}; 9pub use text::{TextUnit, TextRange};
9pub use tree::{SyntaxKind, Token, FileBuilder, File, Node}; 10pub use tree::{SyntaxKind, Token, FileBuilder, File, Node};
10pub use lexer::{next_token, tokenize}; 11pub use lexer::{next_token, tokenize};
12pub use parser::parse;
diff --git a/src/parser/mod.rs b/src/parser/mod.rs
index da902e2b7..7336c5136 100644
--- a/src/parser/mod.rs
+++ b/src/parser/mod.rs
@@ -1,5 +1,11 @@
1use {Token, File}; 1use {Token, File, FileBuilder};
2 2
3pub fn parse(tokens: &[Token]) -> File { 3use syntax_kinds::*;
4 unimplemented!() 4
5
6pub fn parse(text: String, tokens: &[Token]) -> File {
7 let mut builder = FileBuilder::new(text);
8 builder.start_internal(FILE);
9 builder.finish_internal();
10 builder.finish()
5} \ No newline at end of file 11} \ No newline at end of file