Skip to content

Commit 81def89

Browse files
Added block comments tokens to tokenizer (#479)
1 parent fc5057a commit 81def89

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/core/tokenizer.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ const FIXED_TOKENS = [
3434
"\\r",
3535
"\\n",
3636
"\\t",
37+
"/*",
38+
"*/",
39+
"<!--",
40+
"-->",
3741
];
3842
const REPEATABLE_SYMBOLS_REGEX = REPEATABLE_SYMBOLS.map(escapeRegExp)
3943
.map((s) => `${s}+`)

src/test/suite/tokenizer.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ const tests: TestCase[] = [
4848
["``", ["`", "`"]],
4949
// Comments
5050
["// Hello world", ["//", "Hello", "world"]],
51+
["/* Hello world */", ["/*", "Hello", "world", "*/"]],
52+
["<!-- Hello world -->", ["<!--", "Hello", "world", "-->"]],
5153
// Hex colors
5254
["#aaaaaa", ["#", "aaaaaa"]],
5355
["#11aaaa", ["#", "11aaaa"]],

0 commit comments

Comments
 (0)