aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/interp/compiler.boot13
-rw-r--r--src/interp/spad-parser.boot16
-rw-r--r--src/interp/spad.lisp2
3 files changed, 10 insertions, 21 deletions
diff --git a/src/interp/compiler.boot b/src/interp/compiler.boot
index fa193e00..3bcb0399 100644
--- a/src/interp/compiler.boot
+++ b/src/interp/compiler.boot
@@ -85,6 +85,7 @@ compTopLevel: (%Form,%Mode,%Env) -> %Maybe %Triple
compTopLevel(x,m,e) ==
-- signals that target is derived from lhs-- see NRTmakeSlot1Info
$NRTderivedTargetIfTrue: local := false
+ $currentFunction: local := nil
$forceAdd: local:= false
-- start with a base list of domains we may want to inline.
$optimizableConstructorNames: local := $SystemInlinableConstructorNames
@@ -2799,8 +2800,8 @@ preprocessParseTree pt ==
++ Takes a parse tree `pt', typecheck it and compile it down
++ to VM instructions.
compileParseTree pt ==
+ $topOp: local := nil
pt = nil => nil
- CURSTRM: local := $OutputStream
pf := preprocessParseTree pt
pf = nil => nil -- stop if preprocessing was a disaster.
-- Don't go further if only preprocessing was requested.
@@ -2811,13 +2812,11 @@ compileParseTree pt ==
$x: local := nil -- ???
$m: local := nil -- ???
$s: local := nil -- ???
+ $returnMode: local := $EmptyMode
$exitModeStack: local := [] -- Used by the compiler proper
- -- We don't usually call the compiler to process interpreter
- -- input, however attempt to second guess nevertheless.
- if $InteractiveMode then
- processInteractive(pf,nil)
- else if T := compTopLevel(pf,$EmptyMode,$InteractiveFrame) then
- [.,.,$InteractiveFrame] := T
+ $leaveLevelStack: local := []
+ if T := compTopLevel(pf,$EmptyMode,$InteractiveFrame) then
+ $InteractiveFrame := T.env
finishLine $OutputStream
diff --git a/src/interp/spad-parser.boot b/src/interp/spad-parser.boot
index e2a33476..1e33482b 100644
--- a/src/interp/spad-parser.boot
+++ b/src/interp/spad-parser.boot
@@ -1039,29 +1039,19 @@ parseSpecialCommand rd ==
--%
-translateSpad x ==
+translateSpad(ifile,x) ==
$Index: local := 0
_*PRETTY_-PRINT_*: local := true
+ $InteractiveMode: local := false
$MACROASSOC: local := nil
$NEWSPAD: local := true
- $currentFunction: local := nil
- $topOp: local := nil
$semanticErrorStack: local := []
$warningStack: local := []
- $returnMode: local := $EmptyMode
- $leaveLevelStack: local := []
- $insideFunctorIfTrue: local := false
- $insideExpressionIfTrue: local := false
- $insideCoerceInteractiveHardIfTrue: local := false
- $insideWhereIfTrue: local := false
- $insideCategoryIfTrue: local := false
- $insideCapsuleFunctionIfTrue: local := false
- $form: local := nil
$e: local := $EmptyEnvironment
$genSDVar: local := 0
$previousTime: local := TEMPUS_-FUGIT()
$backend: local := function(x +-> PRINT_-FULL(x,$OutputStream))
- compileParseTree x
+ compileParseTree x
--%
diff --git a/src/interp/spad.lisp b/src/interp/spad.lisp
index 22e01ef0..2f4161e5 100644
--- a/src/interp/spad.lisp
+++ b/src/interp/spad.lisp
@@ -95,7 +95,7 @@
(|parseNewExpr| rd)
(let ((parseout (|popStack1|)) )
(when parseout
- (|translateSpad| parseout)
+ (|translateSpad| ifile parseout)
(format |$OutputStream| "~&")))
))))
(|ioClear!| rd)))