Skip to content

Commit ddb57d1

Browse files
committed
Add support for * to lexer
1 parent f65423b commit ddb57d1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/language/lexer.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ export class Lexer {
9191
export function isPunctuatorTokenKind(kind: TokenKind): boolean {
9292
return (
9393
kind === TokenKind.BANG ||
94+
kind === TokenKind.ASTERISK ||
9495
kind === TokenKind.DOLLAR ||
9596
kind === TokenKind.AMP ||
9697
kind === TokenKind.PAREN_L ||
@@ -246,7 +247,7 @@ function readNextToken(lexer: Lexer, start: number): Token {
246247
// - FloatValue
247248
// - StringValue
248249
//
249-
// Punctuator :: one of ! $ & ( ) ... : = @ [ ] { | }
250+
// Punctuator :: one of ! $ & ( ) * ... : = @ [ ] { | }
250251
case 0x0021: // !
251252
return createToken(lexer, TokenKind.BANG, position, position + 1);
252253
case 0x0024: // $
@@ -257,6 +258,8 @@ function readNextToken(lexer: Lexer, start: number): Token {
257258
return createToken(lexer, TokenKind.PAREN_L, position, position + 1);
258259
case 0x0029: // )
259260
return createToken(lexer, TokenKind.PAREN_R, position, position + 1);
261+
case 0x002a: // *
262+
return createToken(lexer, TokenKind.ASTERISK, position, position + 1);
260263
case 0x002e: // .
261264
if (
262265
body.charCodeAt(position + 1) === 0x002e &&

0 commit comments

Comments
 (0)