Changeset 12460 for src/Pugs/Exp.hs

Show
Ignore:
Timestamp:
08/19/06 15:27:26 (2 years ago)
Author:
audreyt
Message:

* Pugs.AST now imports Pugs.Exp.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Exp.hs

    r12458 r12460  
    77module Pugs.Exp where 
    88 
    9 import Data.Generics.Basics hiding (cast) 
    10 import qualified Data.Typeable as Typeable 
    119import Pugs.Internals 
    12 import qualified Pugs.AST as OldAST 
     10import {-# SOURCE #-} qualified Pugs.AST.Internals as OldAST 
    1311import Pugs.Val 
     12import Pugs.Types (Var) 
    1413 
    1514 
     
    1716type ExpVal = Val 
    1817type ExpCapt = Capt Exp 
     18 
     19newtype ExpEmeritus = MkExpEmeritus { ee :: OldAST.Exp } 
     20 
     21instance Eq ExpEmeritus where _ == _ = True 
     22instance Ord ExpEmeritus where compare _ _ = EQ 
     23instance Show ExpEmeritus where show _ = "<Exp.Emeritus>" 
    1924 
    2025-- | AST for an expression. 
     
    2934    | EFlatten  [Exp]                  -- ^ Wrapper for expressions forced into 
    3035                                       --   slurpy context 
    31     | EE OldAST.Exp 
    32     deriving (Show, Eq, Ord, Data, Typeable) {-!derive: YAML_Pos, Perl6Class, MooseClass!-} 
     36    | EE ExpEmeritus 
     37    deriving (Show, Eq, Ord, Typeable) {-!derive: YAML_Pos, Perl6Class, MooseClass!-} 
    3338 
    3439 
     
    4853    | CWhen        Exp  Code            -- ^ when 
    4954    | CForeign                          -- ^ &statement_control:<mycontrol> 
    50     deriving (Show, Eq, Ord, Data, Typeable) {-!derive: YAML_Pos, Perl6Class, MooseClass!-} 
     55    deriving (Show, Eq, Ord, Typeable) {-!derive: YAML_Pos, Perl6Class, MooseClass!-} 
     56 
     57-- | General purpose mapping from identifiers to values. 
     58type Table = Map ID Val 
    5159 
    5260-- | AST for a statement. The top level of an AST is a list of Stmt. 
     
    5563    , pragmas    :: Table 
    5664    , expression :: Exp 
    57     } deriving (Show, Eq, Ord, Data, Typeable) {-!derive: YAML_Pos, Perl6Class, MooseClass!-} 
     65    } deriving (Show, Eq, Ord, Typeable) {-!derive: YAML_Pos, Perl6Class, MooseClass!-} 
    5866 
    5967-- | Carry over last pragmas and create a new statement out of an expression