1 files changed, 16 insertions(+), 17 deletions(-)
M scanner.scm
M scanner.scm => scanner.scm +16 -17
@@ 19,23 19,22 @@
(and (char<=? #\A c) (char>=? #\Z c)))))
(define (get-keyword k)
- (let ((kpair (assoc k '(("and" AND)
- ("class" CLASS)
- ("else" ELSE)
- ("false" FALSE)
- ("for" FOR)
- ("fun" FUN)
- ("if" IF)
- ("nil" NIL)
- ("or" OR)
- ("print" PRINT)
- ("return" RETURN)
- ("super" SUPER)
- ("this" THIS)
- ("true" TRUE)
- ("var" VAR)
- ("while" WHILE)))))
- (if kpair (cadr kpair) #f)))
+ (alist-ref k '(("and" . AND)
+ ("class" . CLASS)
+ ("else" . ELSE)
+ ("false" . FALSE)
+ ("for" . FOR)
+ ("fun" . FUN)
+ ("if" . IF)
+ ("nil" . NIL)
+ ("or" . OR)
+ ("print" . PRINT)
+ ("return". RETURN)
+ ("super" . SUPER)
+ ("this" . THIS)
+ ("true" . TRUE)
+ ("var" . VAR)
+ ("while" . WHILE)) equal?))
(define (alnum? c)
(and c (or (alpha? c) (digit? c))))