Changeset 12924 for src/Pugs/Val

Show
Ignore:
Timestamp:
09/01/06 15:11:03 (2 years ago)
Author:
gaal
Message:

* Basic support for parsing Signatures with :().

Only named parameters are parsed, and optionals (incorrectly)
require a '?' even if they have a default value. No parameter
decoration (type constraints, access traits, etc.) is supported
yet. The following forms do work:

:($x:)
:($x)
:($x: $y, $z)
:($x: $y, $z? = 42)
:($x: $y?, $z) # correctly raises a parse error

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Val/Code.hs

    r12721 r12924  
    9797values. 
    9898-} 
    99 data Param = MkParam 
     99data SigParam = MkParam 
    100100    { p_variable    :: ID            -- ^ E.g. $m above 
    101101    , p_types       :: [Types.Type]  -- ^ Static pieces of inferencer-food 
     
    113113    } 
    114114    deriving (Show, Eq, Ord, Typeable) {-!derive: YAML_Pos, Perl6Class, MooseClass!-} 
     115 
     116type Param = SigParam -- to get around name clashes in Pugs.AST :( 
    115117 
    116118newtype CodeBody = MkCodeBody [Stmt]