aboutsummaryrefslogtreecommitdiff
path: root/src/lexer.rs
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2017-12-28 21:56:36 +0000
committerAleksey Kladov <[email protected]>2017-12-28 21:56:36 +0000
commit5e1e8ed34a46738dda507a4a0f4e73065be74e57 (patch)
tree5191bbb793ce1a563026a9360380cbb207b43b9b /src/lexer.rs
parent45fce4b3ef53b0ffc78aac7064701f1f31792a5a (diff)
Lexer scaffold
Diffstat (limited to 'src/lexer.rs')
-rw-r--r--src/lexer.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/lexer.rs b/src/lexer.rs
new file mode 100644
index 000000000..cda9fe2b2
--- /dev/null
+++ b/src/lexer.rs
@@ -0,0 +1,10 @@
1use {Token, TextUnit};
2use syntax_kinds::*;
3
4pub fn next_token(text: &str) -> Token {
5 let c = text.chars().next().unwrap();
6 Token {
7 kind: IDENT,
8 len: TextUnit::len_of_char(c),
9 }
10} \ No newline at end of file