diff --git a/beautiful-racket-demo/basic-demo-3/lexer.rkt b/beautiful-racket-demo/basic-demo-3/lexer.rkt index 9601ef0..90a950f 100644 --- a/beautiful-racket-demo/basic-demo-3/lexer.rkt +++ b/beautiful-racket-demo/basic-demo-3/lexer.rkt @@ -19,7 +19,8 @@ [(:or (:seq (:? digits) "." digits) (:seq digits ".")) (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 "'" "'")) (token 'STRING (substring lexeme diff --git a/beautiful-racket-demo/basic-demo-3/sample-for.rkt b/beautiful-racket-demo/basic-demo-3/sample-for.rkt index 6590ba1..1242f24 100644 --- a/beautiful-racket-demo/basic-demo-3/sample-for.rkt +++ b/beautiful-racket-demo/basic-demo-3/sample-for.rkt @@ -1,6 +1,6 @@ #lang basic-demo-3 10 for a = 1 to 3 21 for b = 9 to 7 step -1 -22 print a ; b +22 print a : print b 23 next b 30 next a \ No newline at end of file