diff options
| author | dos-reis <gdr@axiomatics.org> | 2010-06-20 06:39:48 +0000 |
|---|---|---|
| committer | dos-reis <gdr@axiomatics.org> | 2010-06-20 06:39:48 +0000 |
| commit | 4ee9e8c9ec410567f7904da3e3be59c06f059a6c (patch) | |
| tree | fe584e64470a08b420ca4654b42c5c725fc489d7 /src/interp | |
| parent | e61f5a0fa4656dd256ad664528e9a6355638bd41 (diff) | |
| download | open-axiom-4ee9e8c9ec410567f7904da3e3be59c06f059a6c.tar.gz | |
* boot/tokens.boot (readOnly?): New builtin Boot function.
* interp/c-util.boot (isLispSpecialVariable): Tidy.
(transformToBackendCode): Likewise.
Diffstat (limited to 'src/interp')
| -rw-r--r-- | src/interp/c-util.boot | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/interp/c-util.boot b/src/interp/c-util.boot index 80016080..d3ed9926 100644 --- a/src/interp/c-util.boot +++ b/src/interp/c-util.boot @@ -1447,7 +1447,7 @@ pushLocalVariable x == isLispSpecialVariable x == s := PNAME x - s.0 = char "$" and #s > 1 and alphabetic? s.1 and not BOUNDP x + s.0 = char "$" and #s > 1 and alphabetic? s.1 and not readOnly? x noteSpecialVariable x == $SpecialVars := insert(x,$SpecialVars) @@ -1618,9 +1618,8 @@ transformToBackendCode x == body := skipDeclarations CDDR x -- Make it explicitly a sequence of statements if it is not a one liner. body := - stmt := first body - null rest body and - (atom stmt or first stmt = "SEQ" or not CONTAINED("EXIT",stmt)) => + body is [stmt] and + (atom stmt or stmt.op = "SEQ" or not CONTAINED("EXIT",stmt)) => body [simplifySEQ ["SEQ",:body]] $FluidVars := removeDuplicates nreverse $FluidVars @@ -1632,6 +1631,8 @@ transformToBackendCode x == fluids ~= nil => lvars ~= nil or needsPROG? body => [["PROG",lvars,declareGlobalVariables fluids, ["RETURN",:body]]] + body is [[op,bindings,:body']] and op in '(LET LET_*) => + [[op,bindings,declareGlobalVariables fluids,:body']] [declareGlobalVariables fluids,:body] lvars ~= nil or needsPROG? body => [["PROG",lvars,["RETURN",:body]]] |
