Skip to content
This repository has been archived by the owner on Jul 28, 2019. It is now read-only.

Commit

Permalink
Move handling of comments and whitespace to lexer.
Browse files Browse the repository at this point in the history
  • Loading branch information
juanibiapina committed Oct 17, 2014
1 parent 82672ed commit 584b2c4
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions lang/lexer.rkt
Expand Up @@ -20,8 +20,8 @@

(define lex
(lexer
[(:+ lex:whitespace) (void)]
[lex:comment (void)]
[(:+ lex:whitespace) (lex input-port)]
[lex:comment (lex input-port)]
[(eof) (token <eof>)]
[(:: #\" (:* (:~ #\")) #\") (token <string> (substring lexeme 1 (- (string-length lexeme) 1)))]
[#\( (token <lparem>)]
Expand All @@ -37,8 +37,4 @@
(define (make-token-gen port src)
(port-count-lines! port)
(lambda ()
(let loop ()
(let ([v (lex port)])
(if (void? v)
(loop)
v)))))
(lex port)))

0 comments on commit 584b2c4

Please sign in to comment.