File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change 11{-# LANGUAGE DeriveDataTypeable #-}
22{-# LANGUAGE FlexibleContexts #-}
3- {-# LANGUAGE CPP #-}
43module Text.Hamlet.XMLParse
54 ( Result (.. )
65 , Content (.. )
@@ -15,7 +14,7 @@ module Text.Hamlet.XMLParse
1514import Text.Shakespeare.Base
1615import Control.Applicative ((<$>) , Applicative (.. ))
1716import Control.Monad
18- import Data.Char (isUpper )
17+ import Data.Char (GeneralCategory ( .. ), generalCategory , isUpper )
1918import Data.Data
2019import Text.ParserCombinators.Parsec hiding (Line )
2120
@@ -223,7 +222,8 @@ parseLine = do
223222
224223 ident :: Parser Ident
225224 ident = do
226- i <- many1 (alphaNum <|> char ' _' <|> char ' \' ' )
225+ i <- many1 (alphaNum <|> char ' _' <|> char ' \' ' ) <|>
226+ (char ' (' *> many1 (satisfy (\ c -> generalCategory c == OtherPunctuation )) <* char ' )' )
227227 white
228228 return (Ident i)
229229 <?> " identifier"
@@ -247,7 +247,7 @@ parseLine = do
247247 isVariable (Ident (x: _)) = not (isUpper x)
248248 isVariable (Ident [] ) = error " isVariable: bad identifier"
249249
250- isConstructor (Ident (x: _)) = isUpper x
250+ isConstructor (Ident (x: _)) = isUpper x || generalCategory x == OtherPunctuation
251251 isConstructor (Ident [] ) = error " isConstructor: bad identifier"
252252
253253 identPattern :: Parser Binding
Original file line number Diff line number Diff line change 11Name : xml-hamlet
2- Version : 0.5.0
2+ Version : 0.5.1
33Synopsis : Hamlet-style quasiquoter for XML content
44Homepage : http://www.yesodweb.com/
55License : BSD3
You can’t perform that action at this time.
0 commit comments