* libtokenizer now librarified
This commit is contained in:
parent
726d53ac1b
commit
5d7afb92d4
BIN
src/ikarus.boot
BIN
src/ikarus.boot
Binary file not shown.
|
@ -1,8 +1,8 @@
|
|||
|
||||
;;; 9.1: bignum reader
|
||||
;;; 9.0: graph marks/refs
|
||||
;;;
|
||||
(let ()
|
||||
(library (ikarus tokenizer)
|
||||
(export)
|
||||
(import (scheme))
|
||||
|
||||
(define delimiter?
|
||||
(lambda (c)
|
||||
(or (char-whitespace? c)
|
||||
|
@ -459,7 +459,8 @@
|
|||
(error 'tokenize
|
||||
"invalid char ~a inside gensym" c)])))]))]
|
||||
[($char= #\@ c)
|
||||
(cons 'datum ($fasl-read p))]
|
||||
(error 'read "FIXME: fasl read disabled")
|
||||
'(cons 'datum ($fasl-read p))]
|
||||
[else
|
||||
(unread-char c p)
|
||||
(error 'tokenize "invalid syntax #~a" c)])))
|
||||
|
@ -738,7 +739,7 @@
|
|||
h1)))
|
||||
h))))))
|
||||
|
||||
(define read
|
||||
(define my-read
|
||||
(lambda (p)
|
||||
(let-values ([(expr locs k) (read-expr p '() void)])
|
||||
(cond
|
||||
|
@ -775,10 +776,10 @@
|
|||
(error 'read-token "~s is not an input port" p))]))
|
||||
(primitive-set! 'read
|
||||
(case-lambda
|
||||
[() (read (current-input-port))]
|
||||
[() (my-read (current-input-port))]
|
||||
[(p)
|
||||
(if (input-port? p)
|
||||
(read p)
|
||||
(my-read p)
|
||||
(error 'read "~s is not an input port" p))]))
|
||||
(primitive-set! 'comment-handler
|
||||
(make-parameter
|
||||
|
@ -790,7 +791,7 @@
|
|||
(let ()
|
||||
(define read-and-eval
|
||||
(lambda (p eval)
|
||||
(let ([x (read p)])
|
||||
(let ([x (my-read p)])
|
||||
(unless (eof-object? x)
|
||||
(eval x)
|
||||
(read-and-eval p eval)))))
|
||||
|
|
|
@ -533,6 +533,7 @@
|
|||
[null? null?-label (core-prim . null?)]
|
||||
[procedure? procedure?-label (core-prim . procedure?)]
|
||||
[eof-object? eof-object?-label (core-prim . eof-object?)]
|
||||
[eof-object eof-object-label (core-prim . eof-object)]
|
||||
;;; comparison
|
||||
[eq? eq?-label (core-prim . eq?)]
|
||||
[eqv? eqv?-label (core-prim . eqv?)]
|
||||
|
@ -549,8 +550,11 @@
|
|||
[cadr cadr-label (core-prim . cadr)]
|
||||
[cddr cddr-label (core-prim . cddr)]
|
||||
[list list-label (core-prim . list)]
|
||||
[make-list make-list-label (core-prim . make-list)]
|
||||
[list* list*-label (core-prim . list*)]
|
||||
[list? list?-label (core-prim . list?)]
|
||||
[append append-label (core-prim . append)]
|
||||
[reverse reverse-label (core-prim . reverse)]
|
||||
[length length-label (core-prim . length)]
|
||||
[assq assq-label (core-prim . assq)]
|
||||
[assv assv-label (core-prim . assv)]
|
||||
|
@ -563,15 +567,23 @@
|
|||
[char=? char=?-label (core-prim . char=?)]
|
||||
[integer->char integer->char-label (core-prim . integer->char)]
|
||||
[char->integer char->integer-label (core-prim . char->integer)]
|
||||
[char-whitespace? char-whitespace?-label (core-prim . char-whitespace?)]
|
||||
[$char? $char?-label (core-prim . $char?)]
|
||||
[$char<= $char<=-label (core-prim . $char<=)]
|
||||
[$char= $char=-label (core-prim . $char=)]
|
||||
[$char->fixnum $char->fixnum-label (core-prim . $char->fixnum)]
|
||||
;;; strings
|
||||
[string? string?-label (core-prim . string?)]
|
||||
[make-string make-string-label (core-prim . make-string)]
|
||||
[string-ref string-ref-label (core-prim . string-ref)]
|
||||
[string-set! string-set!-label (core-prim . string-set!)]
|
||||
[string-length string-length-label (core-prim . string-length)]
|
||||
[string=? string=?-label (core-prim . string=?)]
|
||||
[substring substring-label (core-prim . substring)]
|
||||
[list->string list->string-label (core-prim . list->string)]
|
||||
;;; vectors
|
||||
[vector vector-label (core-prim . vector)]
|
||||
[make-vector make-vector-label (core-prim . make-vector)]
|
||||
[vector-ref vector-ref-label (core-prim . vector-ref)]
|
||||
[vector-set! vector-set!-label (core-prim . vector-set!)]
|
||||
[vector? vector?-label (core-prim . vector?)]
|
||||
|
@ -592,6 +604,7 @@
|
|||
[fx= fx=-label (core-prim . fx=)]
|
||||
[fx- fx--label (core-prim . fx-)]
|
||||
[fx+ fx+-label (core-prim . fx+)]
|
||||
[fx* fx*-label (core-prim . fx*)]
|
||||
[fxzero? fxzero?-label (core-prim . fxzero?)]
|
||||
[fxadd1 fxadd1-label (core-prim . fxadd1)]
|
||||
[fxsub1 fxsub1-label (core-prim . fxsub1)]
|
||||
|
@ -604,6 +617,8 @@
|
|||
[fxlognot fxlognot-label (core-prim . fxlognot)]
|
||||
[$fx>= $fx>=-label (core-prim . $fx>=)]
|
||||
[$fx< $fx<-label (core-prim . $fx<)]
|
||||
;;; flonum
|
||||
[string->flonum string->flonum-label (core-prim . string->flonum)]
|
||||
;;; generic arithmetic
|
||||
[- minus-label (core-prim . -)]
|
||||
[* *-label (core-prim . *)]
|
||||
|
@ -615,6 +630,7 @@
|
|||
[gensym gensym-label (core-prim . gensym)]
|
||||
[getprop getprop-label (core-prim . getprop)]
|
||||
[putprop putprop-label (core-prim . putprop)]
|
||||
[string->symbol string->symbol-label (core-prim . string->symbol)]
|
||||
[symbol->string symbol->string-label (core-prim . symbol->string)]
|
||||
[gensym->unique-string gensym->unique-string-label (core-prim . gensym->unique-string)]
|
||||
[$set-symbol-value! $set-symbol-value!-label (core-prim . $set-symbol-value!)]
|
||||
|
@ -624,6 +640,9 @@
|
|||
[set-top-level-value! set-top-level-value!-label (core-prim . set-top-level-value!)]
|
||||
;;; IO/ports
|
||||
[output-port? output-port?-label (core-prim . output-port?)]
|
||||
[input-port? input-port?-label (core-prim . input-port?)]
|
||||
[open-input-file open-input-file-label (core-prim . open-input-file)]
|
||||
[close-input-port close-input-port-label (core-prim . close-input-port)]
|
||||
[console-input-port console-input-port-label (core-prim . console-input-port)]
|
||||
[console-output-port console-output-port-label (core-prim . console-output-port)]
|
||||
[current-input-port current-input-port-label (core-prim . current-input-port)]
|
||||
|
@ -636,15 +655,20 @@
|
|||
[write-char write-char-label (core-prim . write-char)]
|
||||
[read read-label (core-prim . read)]
|
||||
[read-char read-char-label (core-prim . read-char)]
|
||||
[read-token read-token-label (core-prim . read-token)]
|
||||
[peek-char peek-char-label (core-prim . peek-char)]
|
||||
[unread-char unread-char-label (core-prim . unread-char)]
|
||||
[newline newline-label (core-prim . newline)]
|
||||
[printf printf-label (core-prim . printf)]
|
||||
[format format-label (core-prim . format)]
|
||||
[pretty-print pretty-print-label (core-prim . pretty-print)]
|
||||
[comment-handler comment-handler-label (core-prim . comment-handler)]
|
||||
;;; hash tables
|
||||
[make-hash-table make-hash-table-label (core-prim . make-hash-table)]
|
||||
[get-hash-table get-hash-table-label (core-prim . get-hash-table)]
|
||||
[put-hash-table! put-hash-table!-label (core-prim . put-hash-table!)]
|
||||
;;; evaluation / control
|
||||
[make-parameter make-parameter-label (core-prim . make-parameter)]
|
||||
[apply apply-label (core-prim . apply)]
|
||||
[values values-label (core-prim . values)]
|
||||
[call-with-values cwv-label (core-prim . call-with-values)]
|
||||
|
|
Loading…
Reference in New Issue