fix lexer

pull/10/head
Matthew Butterick 8 years ago
parent 5c817a33b7
commit f5dd28cd05

@ -19,7 +19,8 @@
[(:or (:seq (:? digits) "." digits) [(:or (:seq (:? digits) "." digits)
(:seq digits ".")) (:seq digits "."))
(token 'DECIMAL (string->number lexeme))] (token 'DECIMAL (string->number lexeme))]
[(:+ (:~ id-kapu)) (token 'ID (string->symbol lexeme))] [(:seq (:~ (:or "-" id-kapu)) (:* (:~ id-kapu)))
(token 'ID (string->symbol lexeme))]
[(:or (from/to "\"" "\"") (from/to "'" "'")) [(:or (from/to "\"" "\"") (from/to "'" "'"))
(token 'STRING (token 'STRING
(substring lexeme (substring lexeme

@ -1,6 +1,6 @@
#lang basic-demo-3 #lang basic-demo-3
10 for a = 1 to 3 10 for a = 1 to 3
21 for b = 9 to 7 step -1 21 for b = 9 to 7 step -1
22 print a ; b 22 print a : print b
23 next b 23 next b
30 next a 30 next a
Loading…
Cancel
Save