From fc8f720da64920db34cb47ea48d647b7b7fd971d Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Mon, 6 Mar 2017 22:11:45 -0800 Subject: [PATCH] Eliminate support for custom parser tables. --- src/edwin/edwin.pkg | 1 - src/edwin/intmod.scm | 4 ++-- src/runtime/parse.scm | 25 +++---------------------- src/runtime/runtime.pkg | 33 ++++++++++++++------------------- 4 files changed, 19 insertions(+), 44 deletions(-) diff --git a/src/edwin/edwin.pkg b/src/edwin/edwin.pkg index 9ede2924a..7cf21f6d1 100644 --- a/src/edwin/edwin.pkg +++ b/src/edwin/edwin.pkg @@ -119,7 +119,6 @@ USA. runtime-param:parser-associate-positions?) (param:parser-fold-case? runtime-param:parser-fold-case?) (param:parser-radix runtime-param:parser-radix) - (param:parser-table runtime-param:parser-table) get-param:parser-fold-case?) (import (runtime port) (make-port make-textual-port) diff --git a/src/edwin/intmod.scm b/src/edwin/intmod.scm index 5d151ac9c..bff038162 100644 --- a/src/edwin/intmod.scm +++ b/src/edwin/intmod.scm @@ -997,8 +997,8 @@ If this is an error, the debugger examines the error condition." (define (operation/read-char port) (error "READ-CHAR not supported on this port:" port)) -(define (operation/read port parser-table) - parser-table +(define (operation/read port environment) + (declare (ignore environment)) (read-expression port (nearest-cmdl/level))) (define read-expression diff --git a/src/runtime/parse.scm b/src/runtime/parse.scm index f13345725..335cdc0e6 100644 --- a/src/runtime/parse.scm +++ b/src/runtime/parse.scm @@ -34,7 +34,6 @@ USA. (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) @@ -43,7 +42,6 @@ USA. (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) @@ -52,7 +50,6 @@ USA. (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) @@ -94,9 +91,6 @@ USA. (define get-param:parser-radix (param-getter 'param:parser-radix '*parser-radix*)) - -(define get-param:parser-table - (param-getter 'param:parser-table '*parser-table*)) (define (parse-object port environment) ((top-level-parser port) port environment)) @@ -134,7 +128,7 @@ USA. (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))) @@ -161,7 +155,7 @@ USA. (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) @@ -218,9 +212,6 @@ USA. (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?)) @@ -236,8 +227,6 @@ USA. (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!)) @@ -304,10 +293,6 @@ USA. (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)) @@ -924,8 +909,7 @@ USA. (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) @@ -974,9 +958,6 @@ USA. (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)) diff --git a/src/runtime/runtime.pkg b/src/runtime/runtime.pkg index 72c5fe397..33d23dfc6 100644 --- a/src/runtime/runtime.pkg +++ b/src/runtime/runtime.pkg @@ -3307,8 +3307,7 @@ USA. *parser-atom-delimiters* *parser-canonicalize-symbols?* *parser-constituents* - *parser-radix* - *parser-table*) + *parser-radix*) (export () define-bracketed-object-parser-method param:parser-associate-positions? @@ -3318,10 +3317,8 @@ USA. 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?) @@ -3331,8 +3328,7 @@ USA. (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) @@ -3344,26 +3340,25 @@ USA. 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") -- 2.25.1