Changeset 12179 for src/Pugs/Val
- Timestamp:
- 08/13/06 06:53:47 (2 years ago)
- Files:
-
- 1 modified
-
src/Pugs/Val/Code.hs (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Pugs/Val/Code.hs
r12153 r12179 62 62 -- | AST for function signature. Separated to method and function variants 63 63 -- for ease of pattern matching. 64 type Sig = PureSig 65 data PureSig 64 data Sig 66 65 = SigMethSingle 67 66 { s_invocant :: Param … … 89 88 deriving (Show, Eq, Ord, Data, Typeable) {-!derive: YAML_Pos, Perl6Class, MooseClass!-} 90 89 90 type PureSig = Sig 91 91 92 92 -- | Single parameter for a function/method, e.g.: … … 122 122 -------------------------------------------------------------------------------------- 123 123 124 -- | Capture.125 data Cap 124 -- | a Capture is a frozen version of the arguments to an application. 125 data Capt a 126 126 = CaptMeth 127 { c_invocant :: Exp128 , c_argstack :: [Arglist ]127 { c_invocant :: a 128 , c_argstack :: [Arglist a] 129 129 } 130 130 | CaptSub 131 { c_argstack :: [Arglist ]131 { c_argstack :: [Arglist a] 132 132 } 133 133 deriving (Show, Eq, Ord, Data, Typeable) {-!derive: YAML_Pos, Perl6Class, MooseClass!-} 134 134 135 data Arglist = MkArglist 136 { a_positional :: [Exp] 137 , a_named :: Map Ident [Exp] 135 -- | non-invocant arguments. 136 data Arglist a = MkArglist 137 { a_positional :: [a] 138 , a_named :: Map Ident [a] -- ^ maps to [a] and not a since if the Sig stipulates 139 -- @x, "x => 1, x => 2" constructs @x = (1, 2). 138 140 } 139 141 deriving (Show, Eq, Ord, Data, Typeable) {-!derive: YAML_Pos, Perl6Class, MooseClass!-} 140 142 143 144 -- | Runtime Capture with dynamic Exp for leaves 145 type ExpCapt = Capt Exp 146 -- | Static Capture with Val for leaves 147 type ValCapt = Capt Val 148 141 149 type Exp = () -- XXX bogus
