Skip to content

Commit c33d84b

Browse files
committed
chore: lexer comments
1 parent 3e59bfc commit c33d84b

1 file changed

Lines changed: 40 additions & 0 deletions

File tree

src/lexer/Lexer.ts

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,10 @@ export default class Lexer {
194194
return LexMode.UNKNOWN;
195195
}
196196

197+
/**
198+
* Tokenize identifier
199+
* @private
200+
*/
197201
private lexIdent() {
198202

199203
this.value += this.character;
@@ -212,6 +216,10 @@ export default class Lexer {
212216
}
213217
}
214218

219+
/**
220+
* Tokenize string
221+
* @private
222+
*/
215223
private lexString() {
216224

217225
let escSequence = (this.character === grammar.STRING_ESCAPE_SYMBOL);
@@ -247,6 +255,10 @@ export default class Lexer {
247255
}
248256
}
249257

258+
/**
259+
* Tokenize number
260+
* @private
261+
*/
250262
private lexNumber() {
251263
this.value += this.character;
252264
this.cursor++;
@@ -264,6 +276,10 @@ export default class Lexer {
264276
}
265277
}
266278

279+
/**
280+
* Tokenize symbol
281+
* @private
282+
*/
267283
private lexSymbol() {
268284

269285
this.cursor++;
@@ -279,19 +295,31 @@ export default class Lexer {
279295
this.mode = LexMode.ALL;
280296
}
281297

298+
/**
299+
* Tokenize newline
300+
* @private
301+
*/
282302
private lexNewline() {
283303
this.cursor++;
284304
this.line++;
285305
this.column = 1;
286306
this.mode = LexMode.ALL;
287307
}
288308

309+
/**
310+
* Tokenize whitespace
311+
* @private
312+
*/
289313
private lexWhitespace() {
290314
this.cursor++;
291315
this.column++;
292316
this.mode = LexMode.ALL;
293317
}
294318

319+
/**
320+
* Tokenize color
321+
* @private
322+
*/
295323
private lexColor() {
296324
if (grammar.REGEX_COLOR.exec(this.character)) {
297325
this.value += this.character;
@@ -313,6 +341,10 @@ export default class Lexer {
313341
}
314342
}
315343

344+
/**
345+
* Tokenize variable
346+
* @private
347+
*/
316348
private lexVariable() {
317349
if (grammar.REGEX_VAR.exec(this.character)) {
318350
this.value += this.character;
@@ -334,6 +366,10 @@ export default class Lexer {
334366
}
335367
}
336368

369+
/**
370+
* Tokenize unknown
371+
* @private
372+
*/
337373
private lexUnknown() {
338374
this.tokens.push({
339375
type: TokenType.UNKNOWN,
@@ -347,6 +383,10 @@ export default class Lexer {
347383
this.mode = LexMode.ALL;
348384
}
349385

386+
/**
387+
* Tokenize comment
388+
* @private
389+
*/
350390
private lexComment() {
351391
this.cursor++;
352392

0 commit comments

Comments
 (0)