aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lexer/mod.rs3
-rw-r--r--tests/data/lexer/0004_numbers.rs (renamed from tests/data/lexer/0004_number.rs)0
-rw-r--r--tests/data/lexer/0004_numbers.txt (renamed from tests/data/lexer/0004_number.txt)0
-rw-r--r--tests/data/lexer/0006_chars.rs1
-rw-r--r--tests/data/lexer/0006_chars.txt6
-rw-r--r--tests/data/lexer/0007_lifetimes.rs1
-rw-r--r--tests/data/lexer/0007_lifetimes.txt8
7 files changed, 18 insertions, 1 deletions
diff --git a/src/lexer/mod.rs b/src/lexer/mod.rs
index 918683556..320d59de5 100644
--- a/src/lexer/mod.rs
+++ b/src/lexer/mod.rs
@@ -101,7 +101,7 @@ fn next_token_inner(c: char, ptr: &mut Ptr) -> SyntaxKind {
101 _ => NOT, 101 _ => NOT,
102 }, 102 },
103 103
104 // '\'' => scan_char_or_lifetime(ptr), 104 '\'' => return scan_char_or_lifetime(ptr),
105 _ => (), 105 _ => (),
106 } 106 }
107 ERROR 107 ERROR
@@ -159,6 +159,7 @@ fn scan_literal_suffix(ptr: &mut Ptr) {
159} 159}
160 160
161fn scan_char_or_byte(ptr: &mut Ptr) { 161fn scan_char_or_byte(ptr: &mut Ptr) {
162 //FIXME: deal with escape sequencies
162 ptr.bump(); 163 ptr.bump();
163} 164}
164 165
diff --git a/tests/data/lexer/0004_number.rs b/tests/data/lexer/0004_numbers.rs
index dc974b553..dc974b553 100644
--- a/tests/data/lexer/0004_number.rs
+++ b/tests/data/lexer/0004_numbers.rs
diff --git a/tests/data/lexer/0004_number.txt b/tests/data/lexer/0004_numbers.txt
index be8dee48b..be8dee48b 100644
--- a/tests/data/lexer/0004_number.txt
+++ b/tests/data/lexer/0004_numbers.txt
diff --git a/tests/data/lexer/0006_chars.rs b/tests/data/lexer/0006_chars.rs
new file mode 100644
index 000000000..03598d908
--- /dev/null
+++ b/tests/data/lexer/0006_chars.rs
@@ -0,0 +1 @@
'x' ' ' '0'
diff --git a/tests/data/lexer/0006_chars.txt b/tests/data/lexer/0006_chars.txt
new file mode 100644
index 000000000..ecaf22355
--- /dev/null
+++ b/tests/data/lexer/0006_chars.txt
@@ -0,0 +1,6 @@
1CHAR 3 "\'x\'"
2WHITESPACE 1 " "
3CHAR 3 "\' \'"
4WHITESPACE 1 " "
5CHAR 3 "\'0\'"
6WHITESPACE 1 "\n"
diff --git a/tests/data/lexer/0007_lifetimes.rs b/tests/data/lexer/0007_lifetimes.rs
new file mode 100644
index 000000000..b764f1dce
--- /dev/null
+++ b/tests/data/lexer/0007_lifetimes.rs
@@ -0,0 +1 @@
'a 'foo 'foo_bar_baz '_
diff --git a/tests/data/lexer/0007_lifetimes.txt b/tests/data/lexer/0007_lifetimes.txt
new file mode 100644
index 000000000..005c29100
--- /dev/null
+++ b/tests/data/lexer/0007_lifetimes.txt
@@ -0,0 +1,8 @@
1LIFETIME 2 "\'a"
2WHITESPACE 1 " "
3LIFETIME 4 "\'foo"
4WHITESPACE 1 " "
5LIFETIME 12 "\'foo_bar_baz"
6WHITESPACE 1 " "
7LIFETIME 2 "\'_"
8WHITESPACE 1 "\n"