mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-11 23:07:36 +02:00
Recognize #true and #false
This commit is contained in:
parent
ae3c0ffefe
commit
17be2dc09a
3 changed files with 22 additions and 3 deletions
|
@ -1,6 +1,10 @@
|
||||||
# Next Release - Date TBD
|
# Next Release - Date TBD
|
||||||
TODO: SRFI 113
|
TODO: SRFI 113
|
||||||
|
|
||||||
|
Features:
|
||||||
|
|
||||||
|
- Allow the reader to recognize `#true` and `#false`.
|
||||||
|
|
||||||
# 0.3.2 - November 22, 2016
|
# 0.3.2 - November 22, 2016
|
||||||
|
|
||||||
Features:
|
Features:
|
||||||
|
|
|
@ -33,7 +33,7 @@ Section | Status | Comments
|
||||||
5.7 The REPL | Yes |
|
5.7 The REPL | Yes |
|
||||||
6.1 Equivalence predicates | Yes |
|
6.1 Equivalence predicates | Yes |
|
||||||
6.2 Numbers | Partial | Only integers and reals are supported at this time.
|
6.2 Numbers | Partial | Only integers and reals are supported at this time.
|
||||||
6.3 Booleans | Yes | `#true` and `#false` are not recognized by parser.
|
6.3 Booleans | Yes |
|
||||||
6.4 Pairs and lists | Yes |
|
6.4 Pairs and lists | Yes |
|
||||||
6.5 Symbols | Yes |
|
6.5 Symbols | Yes |
|
||||||
6.6 Characters | Partial | No unicode support.
|
6.6 Characters | Partial | No unicode support.
|
||||||
|
|
|
@ -344,12 +344,27 @@
|
||||||
;; Booleans
|
;; Booleans
|
||||||
;; Do not use add-tok below, no need to quote a bool
|
;; Do not use add-tok below, no need to quote a bool
|
||||||
((eq? #\t next-c)
|
((eq? #\t next-c)
|
||||||
;; TODO: read in rest of #true if it is there
|
;; read in rest of #true if it is there
|
||||||
|
(when (eq? #\r (peek-char fp))
|
||||||
|
(if (not (and (eq? #\r (read-char fp))
|
||||||
|
(eq? #\u (read-char fp))
|
||||||
|
(eq? #\e (read-char fp))))
|
||||||
|
(parse-error "Invalid syntax for boolean true"
|
||||||
|
(in-port:get-lnum ptbl)
|
||||||
|
(in-port:get-cnum ptbl))))
|
||||||
(if all?
|
(if all?
|
||||||
(parse fp '() (cons #t toks) all? #f parens ptbl)
|
(parse fp '() (cons #t toks) all? #f parens ptbl)
|
||||||
#t))
|
#t))
|
||||||
((eq? #\f next-c)
|
((eq? #\f next-c)
|
||||||
;; TODO: read in rest of #false if it is there
|
;; read in rest of #false if it is there
|
||||||
|
(when (eq? #\a (peek-char fp))
|
||||||
|
(if (not (and (eq? #\a (read-char fp))
|
||||||
|
(eq? #\l (read-char fp))
|
||||||
|
(eq? #\s (read-char fp))
|
||||||
|
(eq? #\e (read-char fp))))
|
||||||
|
(parse-error "Invalid syntax for boolean false"
|
||||||
|
(in-port:get-lnum ptbl)
|
||||||
|
(in-port:get-cnum ptbl))))
|
||||||
(if all?
|
(if all?
|
||||||
(parse fp '() (cons #f toks) all? #f parens ptbl)
|
(parse fp '() (cons #f toks) all? #f parens ptbl)
|
||||||
#f))
|
#f))
|
||||||
|
|
Loading…
Add table
Reference in a new issue