Commit 98384eb3 authored by mevenson@1c010e3e-69d0-11dd-93a8-456734b0d56f's avatar mevenson@1c010e3e-69d0-11dd-93a8-456734b0d56f
Browse files

Correctly initialize/restore *BACKQUOTE-COUNT* special when loading FASLs.

Throw intelligible errors from problems encountered by SHARPSIGN-DOT
macros passed through '--eval' arguments.

Fixes #334.
parent 9ba4c078
...@@ -595,10 +595,19 @@ public final class Interpreter ...@@ -595,10 +595,19 @@ public final class Interpreter
initializeJLisp(); initializeJLisp();
StringInputStream stream = new StringInputStream(s); StringInputStream stream = new StringInputStream(s);
final LispThread thread = LispThread.currentThread(); final LispThread thread = LispThread.currentThread();
LispObject obj = stream.read(false, EOF, false, thread, LispObject obj = null;
Stream.currentReadtable);
final SpecialBindingsMark mark0 = thread.markSpecialBindings();
thread.bindSpecial(Symbol.DEBUGGER_HOOK, _DEBUGGER_HOOK_FUNCTION);
try { // catch possible errors from use of SHARPSIGN_DOT macros in --eval stanzas
obj = stream.read(false, EOF, false, thread,
Stream.currentReadtable);
} finally {
thread.resetSpecialBindings(mark0);
}
if (obj == EOF) if (obj == EOF)
return error(new EndOfFile(stream)); return error(new EndOfFile(stream));
final SpecialBindingsMark mark = thread.markSpecialBindings(); final SpecialBindingsMark mark = thread.markSpecialBindings();
thread.bindSpecial(Symbol.DEBUGGER_HOOK, _DEBUGGER_HOOK_FUNCTION); thread.bindSpecial(Symbol.DEBUGGER_HOOK, _DEBUGGER_HOOK_FUNCTION);
try { try {
......
...@@ -484,6 +484,7 @@ public final class Load ...@@ -484,6 +484,7 @@ public final class Load
for (Symbol special : savedSpecials) for (Symbol special : savedSpecials)
thread.bindSpecialToCurrentValue(special); thread.bindSpecialToCurrentValue(special);
thread.bindSpecial(_BACKQUOTE_COUNT_, Fixnum.getInstance(0));
int loadDepth = Fixnum.getValue(_LOAD_DEPTH_.symbolValue(thread)); int loadDepth = Fixnum.getValue(_LOAD_DEPTH_.symbolValue(thread));
thread.bindSpecial(_LOAD_DEPTH_, Fixnum.getInstance(++loadDepth)); thread.bindSpecial(_LOAD_DEPTH_, Fixnum.getInstance(++loadDepth));
final String prefix = getLoadVerbosePrefix(loadDepth); final String prefix = getLoadVerbosePrefix(loadDepth);
......
...@@ -72,11 +72,11 @@ ...@@ -72,11 +72,11 @@
;;;<hair> involves starting over again pretending you had read ".,a)" instead ;;;<hair> involves starting over again pretending you had read ".,a)" instead
;;; of ",@a)" ;;; of ",@a)"
;; (%defvar '*backquote-count* 0) ;; (%defvar '*backquote-count* 0) ; defined in Java, q.v. Lisp.java:2754
(%defvar '*bq-comma-flag* '(|,|)) (%defvar '*bq-comma-flag* '(|,|))
(%defvar '*bq-at-flag* '(|,@|)) (%defvar '*bq-at-flag* '(|,@|))
(%defvar '*bq-dot-flag* '(|,.|)) (%defvar '*bq-dot-flag* '(|,.|))
;; (%defvar '*bq-vector-flag* '(|bqv|)) ;; (%defvar '*bq-vector-flag* '(|bqv|)) ; defined in Java, q.v. Lisp.java:2757
;;; the actual character macro ;;; the actual character macro
(defun backquote-macro (stream ignore) (defun backquote-macro (stream ignore)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment