diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/ChangeLog | 5 | ||||
-rw-r--r-- | src/doc/msgs/s2-us.msgs | 2 | ||||
-rw-r--r-- | src/interp/i-analy.boot | 6 | ||||
-rw-r--r-- | src/interp/i-spec2.boot | 14 |
4 files changed, 20 insertions, 7 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 0f026bb1..cfbfbc30 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,10 @@ 2008-12-20 Gabriel Dos Reis <gdr@cs.tamu.edu> + * interp/i-analy.boot (elaborateForm): New. + * interp/i-spec2.boot (uphas): Use it. Evaluate first operand. + +2008-12-20 Gabriel Dos Reis <gdr@cs.tamu.edu> + * interp/define.boot (checkRepresentation): Take a second argument. For domain extensions, warn about useless assignment to Rep, and syntactically conflicting assignment to Rep. diff --git a/src/doc/msgs/s2-us.msgs b/src/doc/msgs/s2-us.msgs index c47c0854..e02d5667 100644 --- a/src/doc/msgs/s2-us.msgs +++ b/src/doc/msgs/s2-us.msgs @@ -169,6 +169,8 @@ S2IE0014 package-call context. S2IE0020 Only identifiers can be used as Record of Union field names. +S2IE0021 + %1b as first argument to %b has %d does not evaluate to a type. S2IF0001 A $-expression must have a fully specified domain or package on the right-hand side. diff --git a/src/interp/i-analy.boot b/src/interp/i-analy.boot index 84518d51..1541fbc7 100644 --- a/src/interp/i-analy.boot +++ b/src/interp/i-analy.boot @@ -207,6 +207,12 @@ pushDownOp?(op,n) == -- Also see I-SPEC BOOT for special handlers and I-MAP BOOT for -- user function processing. +++ Take a parse form and return the VAT for its elaboration. +elaborateForm pf == + t := mkAtree1 pf + bottomUp t + t + bottomUp t == -- bottomUp takes an attributed tree, and returns the modeSet for it. -- As a side-effect it also evaluates the tree. diff --git a/src/interp/i-spec2.boot b/src/interp/i-spec2.boot index 43be7dd2..5b3742ee 100644 --- a/src/interp/i-spec2.boot +++ b/src/interp/i-spec2.boot @@ -210,19 +210,19 @@ uphas t == t isnt [op,type,prop] => nil -- handler for category and attribute queries type := - isLocalVar(type) => - $genValue => ["evaluateType", ["unabbrev", type]] - -- At this point, type will have already been reduced to - -- its object representation. - ["devaluate", type] - MKQ unabbrev type + x := elaborateForm type + getModeSet x is [m] and (conceptualType m = $Type or categoryForm? m) => + val := objValUnwrap getValue x + $genValue => MKQ val + ["devaluate",val] + throwKeyedMsg("S2IE0021",[type]) catCode := -- FIXME: when we come to support category valued variable -- this code needs to be adapted. prop := unabbrev prop evaluateType0 prop => ["evaluateType", MKQ prop] MKQ prop - code:=["newHasTest",type, catCode] + code := ["NOT",["NULL",["newHasTest",type, catCode]]] if $genValue then code := wrap timedEVALFUN code putValue(op,objNew(code,$Boolean)) putModeSet(op,[$Boolean]) |