Changeset 7952 for src/Pugs/Lexer.hs

Show
Ignore:
Timestamp:
11/14/05 03:15:26 (3 years ago)
Author:
luqui
svk:copy_cache_prev:
10363
Message:

Added mandatoryWhiteSpace combinator (needs cleanup).
Changed \X control char to \cX, as per spec. Also fixed math so that
\cA refers to char 1 rather than 0 (where \c@ refers to 0).
Implemented method-call listop form: $obj.method: arg1, arg2.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • src/Pugs/Lexer.hs

    r7949 r7952  
    1313module Pugs.Lexer ( 
    1414    wordAlpha, wordAny, isWordAlpha, isWordAny, 
    15     maybeParens, parens, whiteSpace, lexeme, identifier, 
     15    maybeParens, parens, whiteSpace, mandatoryWhiteSpace, lexeme, identifier, 
    1616    braces, brackets, angles, balanced, balancedDelim, decimal, 
    1717 
     
    6969whiteSpace :: CharParser st () 
    7070whiteSpace = P.whiteSpace perl6Lexer 
     71mandatoryWhiteSpace :: CharParser st () 
     72mandatoryWhiteSpace = skipMany1 (oneOf " \t\n")  -- XXX unicode and whatnot 
    7173lexeme     :: CharParser st a -> CharParser st a 
    7274lexeme     = P.lexeme     perl6Lexer 
     
    200202 
    201203charControl :: GenParser Char st Char 
    202 charControl     = do{ char '^' 
     204charControl     = do{ char 'c' 
    203205                    ; code <- upper 
    204                     ; return (toEnum (fromEnum code - fromEnum 'A')) 
     206                    ; return (toEnum (fromEnum code - fromEnum '@')) 
    205207                    } 
    206208