diff options
author | Aleksey Kladov <[email protected]> | 2017-12-28 21:56:36 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2017-12-28 21:56:36 +0000 |
commit | 5e1e8ed34a46738dda507a4a0f4e73065be74e57 (patch) | |
tree | 5191bbb793ce1a563026a9360380cbb207b43b9b /src/lexer.rs | |
parent | 45fce4b3ef53b0ffc78aac7064701f1f31792a5a (diff) |
Lexer scaffold
Diffstat (limited to 'src/lexer.rs')
-rw-r--r-- | src/lexer.rs | 10 |
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 @@ | |||
1 | use {Token, TextUnit}; | ||
2 | use syntax_kinds::*; | ||
3 | |||
4 | pub 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 | ||