Changeset 7949
- Timestamp:
- 11/13/05 17:31:09 (3 years ago)
- svk:copy_cache_prev:
- 10363
- Files:
-
- 3 modified
-
src/Pugs/Lexer.hs (modified) (2 diffs)
-
src/Pugs/Parser.hs (modified) (1 diff)
-
t/syntax/interpolation/strings.t (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/Pugs/Lexer.hs
r7943 r7949 61 61 maybeParens :: CharParser st a -> CharParser st a 62 62 maybeParens p = choice [ parens p, p ] 63 maybeBrackets :: CharParser st a -> CharParser st a 64 maybeBrackets p = choice [ brackets p, p ] 63 64 maybeVerbatimBrackets :: CharParser st a -> CharParser st a 65 maybeVerbatimBrackets p = choice [ verbatimBrackets p, p ] 65 66 66 67 parens :: CharParser st a -> CharParser st a … … 205 206 206 207 charNum :: GenParser Char st Char 207 charNum = do{ code <- decimal 208 <|> do{ char 'o'; maybeBrackets $ number 8 octDigit } 209 <|> do{ char 'x'; maybeBrackets $ number 16 hexDigit } 210 <|> do{ char 'd'; maybeBrackets $ number 10 digit } 211 ; return (toEnum (fromInteger code)) 212 } 208 charNum = do 209 code <- choice 210 [ decimal 211 , based 'o' 8 octDigit 212 , based 'x' 16 hexDigit 213 , based 'd' 10 digit 214 ] 215 return . toEnum $ fromInteger code 216 where 217 based ch num p = do 218 char ch 219 let p' = number num p 220 choice [ verbatimBrackets p', p' ] 213 221 214 222 number :: Integer -> GenParser tok st Char -> GenParser tok st Integer -
src/Pugs/Parser.hs
r7946 r7949 1660 1660 ruleCodeSubscript :: RuleParser (Exp -> Exp) 1661 1661 ruleCodeSubscript = tryVerbatimRule "code subscript" $ do 1662 (invs, args) <- parens $parseParamList1662 (invs, args) <- verbatimParens parseParamList 1663 1663 -- FAILED PARSER PATCH 1664 1664 --(invs, args) <- parseHasParenParamList -- XXX doesn't handle trailing -
t/syntax/interpolation/strings.t
r7771 r7949 12 12 =cut 13 13 14 plan 2 5;14 plan 26; 15 15 16 16 my $world = "World"; … … 28 28 is("Wont you take me to &func()", 'Wont you take me to func-y town', 'closure interpolation'); 29 29 is("2 + 2 = { 2+2 }", '2 + 2 = 4', 'double quoted closure interpolation works'); 30 is("&func() is where I live", 'func-y town is where I live', "make sure function interpolation doesn't eat all trailing whitespace" , :todo<bug>);30 is("&func() is where I live", 'func-y town is where I live', "make sure function interpolation doesn't eat all trailing whitespace"); 31 31 32 32 # L<S02/Names and Variables /except when interpolating/> … … 59 59 is(qb"$world \\\"\n\t", "\$world \\\"\n\t", "only interpolate backslash"); 60 60 is('$world \qq[@list[]] %hash{}', '$world 1 2 %hash{}', "interpolate quoting constructs in ''"); 61 62 is(" \d[111] \d[107] ", ' o k ', "\\d[] respects whitespaces around it")
