|
|
@ -6,9 +6,9 @@
|
|
|
|
(define basic-lexer
|
|
|
|
(define basic-lexer
|
|
|
|
(lexer-srcloc
|
|
|
|
(lexer-srcloc
|
|
|
|
[(eof) (return-without-srcloc eof)]
|
|
|
|
[(eof) (return-without-srcloc eof)]
|
|
|
|
[(from/stop-before "rem" "\n") (token 'REM lexeme)]
|
|
|
|
|
|
|
|
["\n" (token 'NEWLINE)]
|
|
|
|
["\n" (token 'NEWLINE)]
|
|
|
|
[whitespace (token lexeme #:skip? #t)]
|
|
|
|
[whitespace (token lexeme #:skip? #t)]
|
|
|
|
|
|
|
|
[(from/stop-before "rem" "\n") (token 'REM lexeme)]
|
|
|
|
[(:or "print" "goto" "end" "+" ":") lexeme]
|
|
|
|
[(:or "print" "goto" "end" "+" ":") lexeme]
|
|
|
|
[digits (token 'INTEGER (string->number lexeme))]
|
|
|
|
[digits (token 'INTEGER (string->number lexeme))]
|
|
|
|
[(:or (:seq (:? digits) "." digits)
|
|
|
|
[(:or (:seq (:? digits) "." digits)
|
|
|
|