Changeset 6067

Show
Ignore:
Timestamp:
08/04/05 15:41:44 (3 years ago)
Author:
scook0
svk:copy_cache_prev:
8204
Message:

* Initial stab at some Haddock docs for Parser.hs
* Formatted CodeGen?.hs' poem for Haddock :-)

Location:
src/Pugs
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/AST/Internals.hs

    r6061 r6067  
    12731273readVar _ = return undef 
    12741274 
     1275{-| 
     1276The \'empty expression\' is just a no-op ('Noop'). 
     1277-} 
    12751278emptyExp :: Exp 
    12761279emptyExp = Noop 
  • src/Pugs/CodeGen.hs

    r5393 r6067  
    44    Code generation interface. 
    55 
    6     I sit beside the fire and think 
    7     of all that I have seen, 
    8     of meadow-flowers and butterflies 
    9     in summers that have been... 
     6>   I sit beside the fire and think 
     7>   of all that I have seen, 
     8>   of meadow-flowers and butterflies 
     9>   in summers that have been... 
    1010-} 
    1111 
  • src/Pugs/Lexer.hs

    r5539 r6067  
    9494    return (c:cs) 
    9595 
     96{-| 
     97Match any amount of whitespace (not including newlines), followed by a newline 
     98(as matched by 'ruleEndOfLine'). 
     99-} 
    96100ruleWhiteSpaceLine :: GenParser Char st () 
    97101ruleWhiteSpaceLine = do 
     
    99103    ruleEndOfLine 
    100104 
     105{-| 
     106Match either a single newline, or EOF (which constitutes the termination of a 
     107line anyway). 
     108-} 
    101109ruleEndOfLine :: GenParser Char st () 
    102110ruleEndOfLine = choice [ do { char '\n'; return () }, eof ] 
  • src/Pugs/Parser.hs

    r6035 r6067  
    5757    return $ Pos (mkPos pos1 pos2) (unwrap exp) 
    5858 
    59 mkPos :: SourcePos -> SourcePos -> Pos 
     59{-| 
     60Create a Pugs 'Pugs.AST.Pos' (for storing in the AST) from two Parsec 
     61@SourcePos@ positions, being the start and end respectively of the current 
     62region. 
     63-} 
     64mkPos :: SourcePos -- ^ Starting position of the region 
     65      -> SourcePos -- ^ Ending position of the region 
     66      -> Pos 
    6067mkPos pos1 pos2 = MkPos 
    6168    { posName         = sourceName pos1  
     
    123130        rest exp 
    124131 
     132{-| 
     133Assert that we're at the beginning of a line, but consume no input (and produce 
     134no result). 
     135 
     136Used by 'ruleDocIntroducer', because POD-style regions must have their \'@=@\' 
     137at the beginning of a line. 
     138-} 
    125139ruleBeginOfLine :: RuleParser () 
    126140ruleBeginOfLine = do 
     
    129143    return () 
    130144 
     145{-| 
     146Match a single \'@=@\', but only if it occurs as the first character of a line. 
     147-} 
    131148ruleDocIntroducer :: RuleParser Char 
    132149ruleDocIntroducer = (<?> "intro") $ do 
     
    134151    char '=' 
    135152 
     153{-| 
     154Match \'@=cut@\', followed by a newline (see 'ruleWhiteSpaceLine'). 
     155 
     156The \'@=@\' must be the first character of the line ('ruleDocIntroducer'). 
     157-} 
    136158ruleDocCut :: RuleParser () 
    137159ruleDocCut = (<?> "cut") $ do