diff options
| author | aarne <aarne@cs.chalmers.se> | 2007-03-27 16:40:54 +0000 |
|---|---|---|
| committer | aarne <aarne@cs.chalmers.se> | 2007-03-27 16:40:54 +0000 |
| commit | 7c30d211c3eda504668c0eab51e99d6e52db2127 (patch) | |
| tree | 90cd0aa1f5d079a58d080da0174b90a5bdb09b96 | |
| parent | 1c1acf1b971d13a496a92b9d8d6b14fde85e28f3 (diff) | |
distinct form for opers that have no value
| -rw-r--r-- | devel/compiler/Eval.hs | 10 | ||||
| -rw-r--r-- | devel/compiler/Src.cf | 3 | ||||
| -rw-r--r-- | devel/compiler/ex.src | 6 |
3 files changed, 9 insertions, 10 deletions
diff --git a/devel/compiler/Eval.hs b/devel/compiler/Eval.hs index 8c5966bb8..cc1b22467 100644 --- a/devel/compiler/Eval.hs +++ b/devel/compiler/Eval.hs @@ -18,17 +18,15 @@ eval e = case e of let (f,xs) = apps e xs' <- mapM eval xs case f of - ECon c -> checks [ - do + ECon c -> do v <- lookEnv values c return $ appVal v xs' - , - do + EOpr c -> do e <- lookEnv opers c - v <- eval e + v <- eval e ---- not possible in general return $ appVal v xs' - ] ECon c -> lookEnv values c + EOpr c -> lookEnv opers c >>= eval ---- not possible in general EVar x -> lookEnv vars x ECst _ _ -> lookEnv parvals e EStr s -> return $ VTok s diff --git a/devel/compiler/Src.cf b/devel/compiler/Src.cf index 2d1e3ae39..ccf9ec04b 100644 --- a/devel/compiler/Src.cf +++ b/devel/compiler/Src.cf @@ -25,9 +25,11 @@ FTyp. Typing ::= Ident ":" Type ; separator Typing ";" ; EVar. Exp2 ::= "$" Ident ; +EOpr. Exp2 ::= "&" Ident ; ECon. Exp2 ::= Ident ; EVal. Exp2 ::= Integer ; EStr. Exp2 ::= String ; +ECst. Exp2 ::= "(" Ident "@" [Exp] ")" ; ERec. Exp2 ::= "{" [Assign] "}" ; EApp. Exp1 ::= Exp1 Exp2 ; ESel. Exp1 ::= Exp1 "!" Exp2 ; @@ -36,7 +38,6 @@ ETab. Exp1 ::= "table" "{" [Case] "}" ; ETbv. Exp1 ::= "table" "(" Type ")" "{" [Exp] "}" ; ECat. Exp ::= Exp "++" Exp1 ; EAbs. Exp ::= "\\" Ident "->" Exp ; -ECst. Exp2 ::= "(" Ident "@" [Exp] ")" ; coercions Exp 2 ; diff --git a/devel/compiler/ex.src b/devel/compiler/ex.src index f7b381548..e8f0c6374 100644 --- a/devel/compiler/ex.src +++ b/devel/compiler/ex.src @@ -22,15 +22,15 @@ lin Voiture : CN = { g = (Fem@) } ; -{- + lin Bus : CN = { s = table {$x => "bus"} ; g = (Masc@) } ; - +{- lin Def : CN -> NP = \cn -> { - s = artDef $cn.g ++ $cn.s ! (Sg@) ; + s = &artDef $cn.g ++ $cn.s ! (Sg@) ; a = {g = $cn.g ; n = (Sg@)} } ; -}
\ No newline at end of file |
