diff options
author | dos-reis <gdr@axiomatics.org> | 2008-02-02 18:29:40 +0000 |
---|---|---|
committer | dos-reis <gdr@axiomatics.org> | 2008-02-02 18:29:40 +0000 |
commit | 98246580bde4dcf9c5dcbf58f3e882bf7f969ddd (patch) | |
tree | dca6300171ca56d5ff567a6e1f9df480a440d249 /src/interp | |
parent | 82a303c752601bf7bae50a4a919380cfd1872e96 (diff) | |
download | open-axiom-98246580bde4dcf9c5dcbf58f3e882bf7f969ddd.tar.gz |
Diffstat (limited to 'src/interp')
-rw-r--r-- | src/interp/apply.boot | 17 | ||||
-rw-r--r-- | src/interp/serror.boot | 10 |
2 files changed, 21 insertions, 6 deletions
diff --git a/src/interp/apply.boot b/src/interp/apply.boot index 1faf163b..f1000b5b 100644 --- a/src/interp/apply.boot +++ b/src/interp/apply.boot @@ -35,8 +35,7 @@ import '"compiler" )package "BOOT" -oldCompilerAutoloadOnceTrigger() == nil - +compAtomWithModemap: (%Thing,%Thing,%List,%Thing) -> %List compAtomWithModemap(x,m,e,v) == Tl := [[transImplementation(x,map,fn),target,e] @@ -47,12 +46,13 @@ compAtomWithModemap(x,m,e,v) == 0<#Tl and m=$NoValueMode => first Tl nil +transImplementation: (%Thing,%Thing,%Thing) -> %List transImplementation(op,map,fn) == ---+ fn := genDeltaEntry [op,:map] fn is ["XLAM",:.] => [fn] ["call",fn] +compApply: (%List,%List,%Thing,%List,%Thing,%List) -> %List compApply(sig,varl,body,argl,m,e) == argTl:= [[.,.,e]:= comp(x,$EmptyMode,e) for x in argl] contour:= @@ -63,12 +63,14 @@ compApply(sig,varl,body,argl,m,e) == body':= (comp(body,m',addContour(contour,e))).expr [code,m',e] +compToApply: (%Thing,%List,%Thing,%List) -> %List compToApply(op,argl,m,e) == T:= compNoStacking(op,$EmptyMode,e) or return nil m1:= T.mode T.expr is ["QUOTE", =m1] => nil compApplication(op,argl,m,T.env,T) +compApplication: (%Thing,%List,%Thing,%List,%List) -> %List compApplication(op,argl,m,e,T) == T.mode is ['Mapping, retm, :argml] => #argl ^= #argml => nil @@ -90,6 +92,7 @@ compApplication(op,argl,m,e,T) == eltForm := ['elt, op, :argl] comp(eltForm, m, e) +compFormWithModemap: (%List,%Thing,%List,%List) -> %List compFormWithModemap(form is [op,:argl],m,e,modemap) == [map:= [.,target,:.],[pred,impl]]:= modemap -- this fails if the subsuming modemap is conditional @@ -153,6 +156,7 @@ compFormWithModemap(form is [op,:argl],m,e,modemap) == -- pairlis:= [[v,:a] for a in argl' for v in $FormalMapVariableList] -- convert([form,SUBLIS(pairlis,first ml),e],m) +applyMapping: (%List,%Thing,%List,%List) -> %List applyMapping([op,:argl],m,e,ml) == #argl^=#ml-1 => nil isCategoryForm(first ml,e) => @@ -182,6 +186,7 @@ applyMapping([op,:argl],m,e,ml) == --% APPLY MODEMAPS +compApplyModemap: (%List,%List,%List,%List) -> %List compApplyModemap(form,modemap,$e,sl) == [op,:argl] := form --form to be compiled [[mc,mr,:margl],:fnsel] := modemap --modemap we are testing @@ -224,13 +229,16 @@ compApplyModemap(form,modemap,$e,sl) == [genDeltaEntry [op,:modemap],lt',$bindings] [f,lt',$bindings] +compMapCond: (%List,%Thing,%List,%List) -> %List compMapCond(op,mc,$bindings,fnsel) == or/[compMapCond'(u,op,mc,$bindings) for u in fnsel] +compMapCond': (%List,%Thing,%Thing,%Thing) -> %List compMapCond'([cexpr,fnexpr],op,dc,bindings) == compMapCond''(cexpr,dc) => compMapCondFun(fnexpr,op,dc,bindings) stackMessage ["not known that",'%b,dc,'%d,"has",'%b,cexpr,'%d] +compMapCond'': (%Thing,%Thing) -> %Boolean compMapCond''(cexpr,dc) == cexpr=true => true --cexpr = "true" => true @@ -248,5 +256,6 @@ compMapCond''(cexpr,dc) == stackMessage ["not known that",'%b,dc,'%d,"has",'%b,cexpr,'%d] false -compMapCondFun(fnexpr,op,dc,bindings) == [fnexpr,bindings] +compMapCondFun(fnexpr,op,dc,bindings) == + [fnexpr,bindings] diff --git a/src/interp/serror.boot b/src/interp/serror.boot index 0435e7ac..9d7dabe7 100644 --- a/src/interp/serror.boot +++ b/src/interp/serror.boot @@ -37,16 +37,20 @@ import '"posit" )package "BOOT" +syGeneralErrorHere: () -> %Thing syGeneralErrorHere() == sySpecificErrorHere('S2CY0002, []) -sySpecificErrorHere(key, args) == +sySpecificErrorHere: (%Symbol,%List) -> %Thing +sySpecificErrorHere(key,args) == sySpecificErrorAtToken($stok, key, args) -sySpecificErrorAtToken(tok, key, args) == +sySpecificErrorAtToken: (%Thing,%Symbol,%List) -> %Thing +sySpecificErrorAtToken(tok,key,args) == pos := tokPosn tok ncSoftError(pos, key, args) +syIgnoredFromTo: (%List,%List) -> %Thing syIgnoredFromTo(pos1, pos2) == if pfGlobalLinePosn pos1 = pfGlobalLinePosn pos2 then ncSoftError(FromTo(pos1,pos2), 'S2CY0005, []) @@ -54,6 +58,7 @@ syIgnoredFromTo(pos1, pos2) == ncSoftError(From pos1, 'S2CY0003, []) ncSoftError(To pos2, 'S2CY0004, []) +npTrapForm: %Thing -> %Thing npTrapForm(x)== a:=pfSourceStok x EQ(a,'NoToken)=> @@ -62,6 +67,7 @@ npTrapForm(x)== ncSoftError(tokPosn a, 'S2CY0002, []) THROW("TRAPPOINT","TRAPPED") +npTrap: () -> %Thing npTrap()== ncSoftError(tokPosn $stok,'S2CY0002,[]) THROW("TRAPPOINT","TRAPPED") |