Changeset 10060 for src/Pugs/Lexer.hs

Show
Ignore:
Timestamp:
04/23/06 18:38:04 (3 years ago)
Author:
audreyt
Message:

* Switch Pugs.Parser to Commit-by-default "ratchet" parser.

* Caveat: This is currently broken:

if %h{'x'} {...}

because our whitespace rule is backwards. I'll fix soon.

For now, use this workaround:

if %h.{'x'} {...}

(the "correct" fix is for "lexeme" to not swallow post-term
whitespace; rather, let operators swalloe pre-term whitespace
if they choose to do so. takers welcome :))

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Lexer.hs

    r10059 r10060  
    276276 
    277277tryRule :: String -> GenParser Char st a -> GenParser Char st a 
    278 tryRule name action = (<?> name) $ lexeme $ try action 
     278tryRule name action = (<?> name) $ lexeme $ action 
    279279 
    280280tryVerbatimRule :: String -> GenParser tok st a -> GenParser tok st a 
    281 tryVerbatimRule name action = (<?> name) $ try action 
     281tryVerbatimRule name action = (<?> name) $ action 
    282282 
    283283ruleScope :: RuleParser Scope 
     
    349349tryChoice :: [GenParser tok st a] -- ^ List of candidate parsers 
    350350          -> GenParser tok st a 
    351 tryChoice = choice . map try 
     351tryChoice = choice 
    352352 
    353353{-|