Changeset 7952
- Timestamp:
- 11/14/05 03:15:26 (3 years ago)
- svk:copy_cache_prev:
- 10363
- Location:
- src/Pugs
- Files:
-
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
src/Pugs/Lexer.hs
r7949 r7952 13 13 module Pugs.Lexer ( 14 14 wordAlpha, wordAny, isWordAlpha, isWordAny, 15 maybeParens, parens, whiteSpace, lexeme, identifier,15 maybeParens, parens, whiteSpace, mandatoryWhiteSpace, lexeme, identifier, 16 16 braces, brackets, angles, balanced, balancedDelim, decimal, 17 17 … … 69 69 whiteSpace :: CharParser st () 70 70 whiteSpace = P.whiteSpace perl6Lexer 71 mandatoryWhiteSpace :: CharParser st () 72 mandatoryWhiteSpace = skipMany1 (oneOf " \t\n") -- XXX unicode and whatnot 71 73 lexeme :: CharParser st a -> CharParser st a 72 74 lexeme = P.lexeme perl6Lexer … … 200 202 201 203 charControl :: GenParser Char st Char 202 charControl = do{ char ' ^'204 charControl = do{ char 'c' 203 205 ; code <- upper 204 ; return (toEnum (fromEnum code - fromEnum ' A'))206 ; return (toEnum (fromEnum code - fromEnum '@')) 205 207 } 206 208 -
src/Pugs/Parser.hs
r7949 r7952 1633 1633 (invs,args) <- if mustHaveParens 1634 1634 then parseHasParenParamList 1635 else option (Nothing,[]) $ parseParenParamList 1635 else do -- $obj.foo: arg1, arg2 # listop method call 1636 -- we require whitespace after the colon (but not before) 1637 -- so that @list.map:{...} doesn't get interpreted the 1638 -- wrong way. 1639 listcolon <- option False $ try $ do { char ':'; mandatoryWhiteSpace; return True } 1640 if listcolon 1641 then parseNoParenParamList 1642 else option (Nothing,[]) $ parseParenParamList 1636 1643 when (isJust invs) $ fail "Only one invocant allowed" 1637 1644 return $ \x -> if hasEqual -
src/Pugs/Pretty.hs
r7943 r7952 191 191 quoted '%' = "\\%" 192 192 quoted '&' = "\\&" 193 quoted '^' = "\\^" 193 194 quoted x | x < ' ' || x > '~' = "\\d[" ++ show (ord x) ++ "]" 194 195 quoted x = [x]
