Skip to content

Commit

Permalink
Add comments in lexer.nim
Browse files Browse the repository at this point in the history
  • Loading branch information
bichanna committed Mar 24, 2022
1 parent 5cdbfdc commit 6593bbf
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lexer.nim
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ type
tokens*: seq[Token]
current*, line*: int

# newLexer creates a new Lexer and returns it.
proc newLexer*(src: string, path: string): Lexer =
error.sources[token.sourceId] = path
source = src
Expand Down Expand Up @@ -201,6 +202,9 @@ proc slahShorthand(l: var Lexer) =
else:
l.appendToken(Slash)

# This proc iterates every character of the source,
# tokenize them, and returns a sequence (list or array)
# of tokens.
proc tokenize*(l: var Lexer): seq[Token] =
var c: char
var strInterpBreak = false
Expand Down

0 comments on commit 6593bbf

Please sign in to comment.