diff --git a/xml-hamlet/Text/Hamlet/XMLParse.hs b/xml-hamlet/Text/Hamlet/XMLParse.hs index afab6e65..c0630f3c 100644 --- a/xml-hamlet/Text/Hamlet/XMLParse.hs +++ b/xml-hamlet/Text/Hamlet/XMLParse.hs @@ -1,6 +1,5 @@ {-# LANGUAGE DeriveDataTypeable #-} {-# LANGUAGE FlexibleContexts #-} -{-# LANGUAGE CPP #-} module Text.Hamlet.XMLParse ( Result (..) , Content (..) @@ -15,7 +14,7 @@ module Text.Hamlet.XMLParse import Text.Shakespeare.Base import Control.Applicative ((<$>), Applicative (..)) import Control.Monad -import Data.Char (isUpper) +import Data.Char (GeneralCategory(..), generalCategory, isUpper) import Data.Data import Text.ParserCombinators.Parsec hiding (Line) @@ -223,7 +222,8 @@ parseLine = do ident :: Parser Ident ident = do - i <- many1 (alphaNum <|> char '_' <|> char '\'') + i <- many1 (alphaNum <|> char '_' <|> char '\'') <|> + (char '(' *> many1 (satisfy (\c -> generalCategory c == OtherPunctuation)) <* char ')') white return (Ident i) "identifier" @@ -247,7 +247,7 @@ parseLine = do isVariable (Ident (x:_)) = not (isUpper x) isVariable (Ident []) = error "isVariable: bad identifier" - isConstructor (Ident (x:_)) = isUpper x + isConstructor (Ident (x:_)) = isUpper x || generalCategory x == OtherPunctuation isConstructor (Ident []) = error "isConstructor: bad identifier" identPattern :: Parser Binding diff --git a/xml-hamlet/xml-hamlet.cabal b/xml-hamlet/xml-hamlet.cabal index 012073d2..e9774ee4 100644 --- a/xml-hamlet/xml-hamlet.cabal +++ b/xml-hamlet/xml-hamlet.cabal @@ -1,5 +1,5 @@ Name: xml-hamlet -Version: 0.5.0 +Version: 0.5.1 Synopsis: Hamlet-style quasiquoter for XML content Homepage: http://www.yesodweb.com/ License: BSD3