(define *parser-canonicalize-symbols?* #!default)
(define *parser-constituents* #!default)
(define *parser-radix* #!default)
-(define *parser-table* #!default)
(define param:parser-associate-positions?)
(define param:parser-atom-delimiters)
(define param:parser-constituents)
(define param:parser-keyword-style)
(define param:parser-radix)
-(define param:parser-table)
(define runtime-param:parser-associate-positions?)
(define runtime-param:parser-atom-delimiters)
(define runtime-param:parser-constituents)
(define runtime-param:parser-keyword-style)
(define runtime-param:parser-radix)
-(define runtime-param:parser-table)
(define ignore-extra-list-closes #t)
(define get-param:parser-radix
(param-getter 'param:parser-radix '*parser-radix*))
-
-(define get-param:parser-table
- (param-getter 'param:parser-table '*parser-table*))
\f
(define (parse-object port environment)
((top-level-parser port) port environment))
(read-in-context port db 'OBJECT))
(define (dispatch port db ctx)
- (let ((handlers (parser-table/initial (db-parser-table db))))
+ (let ((handlers (parser-table/initial system-global-parser-table)))
(let loop ()
(let* ((position (current-position port db))
(char (%read-char port db)))
(define (handler:special port db ctx char1)
(let ((char2 (%read-char/no-eof port db)))
- ((get-handler char2 (parser-table/special (db-parser-table db)))
+ ((get-handler char2 (parser-table/special system-global-parser-table))
port db ctx char1 char2)))
(define (get-handler char handlers)
(set! param:parser-radix
(make-unsettable-parameter 10
radix-converter))
- (set! param:parser-table
- (make-unsettable-parameter system-global-parser-table
- parser-table-converter))
(set! runtime-param:parser-associate-positions?
(copy-parameter param:parser-associate-positions?))
(copy-parameter param:parser-keyword-style))
(set! runtime-param:parser-radix
(copy-parameter param:parser-radix))
- (set! runtime-param:parser-table
- (copy-parameter param:parser-table))
(set! hashed-object-interns (make-strong-eq-hash-table))
(initialize-condition-types!))
(error "Invalid keyword style:" value))
value)
-(define (parser-table-converter value)
- (guarantee parser-table? value)
- value)
-
(define (radix-converter value)
(if (not (memv value '(2 8 10 16)))
(error "Invalid parser radix:" value))
(define (initial-db port environment)
(let ((environment
- (if (or (default-object? environment)
- (parser-table? environment))
+ (if (default-object? environment)
(nearest-repl/environment)
(begin
(guarantee environment? environment)
(define db-constituents
(db-env-getter get-param:parser-constituents))
-(define db-parser-table
- (db-env-getter get-param:parser-table))
-
(define db-radix
(db-env-getter get-param:parser-radix))
*parser-atom-delimiters*
*parser-canonicalize-symbols?*
*parser-constituents*
- *parser-radix*
- *parser-table*)
+ *parser-radix*)
(export ()
define-bracketed-object-parser-method
param:parser-associate-positions?
param:parser-fold-case?
param:parser-keyword-style
param:parser-radix
- param:parser-table
parse-object
- parse-objects
- system-global-parser-table)
+ parse-objects)
(export (runtime)
(param:parser-associate-positions?
runtime-param:parser-associate-positions?)
(param:parser-enable-attributes?
runtime-param:parser-enable-attributes?)
(param:parser-keyword-style runtime-param:parser-keyword-style)
- (param:parser-radix runtime-param:parser-radix)
- (param:parser-table runtime-param:parser-table))
+ (param:parser-radix runtime-param:parser-radix))
(export (runtime swank)
get-param:parser-fold-case?)
(export (runtime unparser)
repl-environment-value)
(initialization (initialize-package!)))
-(define-package (runtime file-attributes)
- (files "file-attributes")
- (parent (runtime))
- (export (runtime)
- parse-file-attributes-string)
- (export (runtime parser)
- parse-file-attributes-line))
-
(define-package (runtime parser-table)
(files "partab")
(parent (runtime))
- (export ()
+ (export (runtime parser)
make-parser-table
parser-table/copy
parser-table/entry
+ parser-table/initial
parser-table/set-entry!
- parser-table?)
+ parser-table/special
+ parser-table?))
+
+(define-package (runtime file-attributes)
+ (files "file-attributes")
+ (parent (runtime))
+ (export (runtime)
+ parse-file-attributes-string)
(export (runtime parser)
- parser-table/initial
- parser-table/special))
+ parse-file-attributes-line))
(define-package (runtime pathname)
(files "pathnm")