module CommonLogic.Lexer_CLIF where
import CommonLogic.AS_CommonLogic
import Common.Id as Id
import qualified Common.Lexer as Lexer
import Common.Parsec
import Common.Keywords
import Text.ParserCombinators.Parsec as Parsec
import Data.Char (ord)
pToken :: CharParser st String -> CharParser st Token
pToken :: CharParser st String -> CharParser st Token
pToken p :: CharParser st String
p = CharParser st String -> CharParser st Token
forall st. CharParser st String -> CharParser st Token
Lexer.pToken CharParser st String
p CharParser st Token
-> ParsecT String st Identity [String] -> CharParser st Token
forall (m :: * -> *) a b. Monad m => m a -> m b -> m a
<< CharParser st String -> ParsecT String st Identity [String]
forall s u (m :: * -> *) a. ParsecT s u m a -> ParsecT s u m [a]
many CharParser st String
forall st. CharParser st String
white
oParenT :: CharParser st Token
oParenT :: CharParser st Token
oParenT = CharParser st Token
forall st. CharParser st Token
Lexer.oParenT CharParser st Token
-> ParsecT String st Identity [String] -> CharParser st Token
forall (m :: * -> *) a b. Monad m => m a -> m b -> m a
<< ParsecT String st Identity String
-> ParsecT String st Identity [String]
forall s u (m :: * -> *) a. ParsecT s u m a -> ParsecT s u m [a]
many ParsecT String st Identity String
forall st. CharParser st String
white
cParenT :: CharParser st Token
cParenT :: CharParser st Token
cParenT = CharParser st Token
forall st. CharParser st Token
Lexer.cParenT CharParser st Token
-> ParsecT String st Identity [String] -> CharParser st Token
forall (m :: * -> *) a b. Monad m => m a -> m b -> m a
<< ParsecT String st Identity String
-> ParsecT String st Identity [String]
forall s u (m :: * -> *) a. ParsecT s u m a -> ParsecT s u m [a]
many ParsecT String st Identity String
forall st. CharParser st String
white
quotedstring :: CharParser st String
quotedstring :: CharParser st String
quotedstring = do
Char
c1 <- Char -> ParsecT String st Identity Char
forall s (m :: * -> *) u.
Stream s m Char =>
Char -> ParsecT s u m Char
char '\''
String
s <- ParsecT String st Identity Char -> CharParser st String
forall s u (m :: * -> *) a. ParsecT s u m a -> ParsecT s u m [a]
many ((Char -> Bool) -> ParsecT String st Identity Char
forall s (m :: * -> *) u.
Stream s m Char =>
(Char -> Bool) -> ParsecT s u m Char
satisfy Char -> Bool
clLetters2 ParsecT String st Identity Char
-> ParsecT String st Identity Char
-> ParsecT String st Identity Char
forall s u (m :: * -> *) a.
ParsecT s u m a -> ParsecT s u m a -> ParsecT s u m a
<|> String -> ParsecT String st Identity Char
forall s (m :: * -> *) u.
Stream s m Char =>
String -> ParsecT s u m Char
oneOf (String
whitec String -> String -> String
forall a. [a] -> [a] -> [a]
++ "()\""))
CharParser st String -> String -> CharParser st String
forall s u (m :: * -> *) a.
ParsecT s u m a -> String -> ParsecT s u m a
<?> "quotedstring: word"
Char
c2 <- Char -> ParsecT String st Identity Char
forall s (m :: * -> *) u.
Stream s m Char =>
Char -> ParsecT s u m Char
char '\''
CharParser st String -> ParsecT String st Identity [String]
forall s u (m :: * -> *) a. ParsecT s u m a -> ParsecT s u m [a]
many CharParser st String
forall st. CharParser st String
white
String -> CharParser st String
forall (m :: * -> *) a. Monad m => a -> m a
return (String -> CharParser st String) -> String -> CharParser st String
forall a b. (a -> b) -> a -> b
$ Char
c1 Char -> String -> String
forall a. a -> [a] -> [a]
: String
s String -> String -> String
forall a. [a] -> [a] -> [a]
++ [Char
c2]
enclosedname :: CharParser st String
enclosedname :: CharParser st String
enclosedname = do
Char
c1 <- Char -> ParsecT String st Identity Char
forall s (m :: * -> *) u.
Stream s m Char =>
Char -> ParsecT s u m Char
char '\"'
String
s <- ParsecT String st Identity Char -> CharParser st String
forall s u (m :: * -> *) a. ParsecT s u m a -> ParsecT s u m [a]
many ((Char -> Bool) -> ParsecT String st Identity Char
forall s (m :: * -> *) u.
Stream s m Char =>
(Char -> Bool) -> ParsecT s u m Char
satisfy Char -> Bool
clLetters2 ParsecT String st Identity Char
-> ParsecT String st Identity Char
-> ParsecT String st Identity Char
forall s u (m :: * -> *) a.
ParsecT s u m a -> ParsecT s u m a -> ParsecT s u m a
<|> String -> ParsecT String st Identity Char
forall s (m :: * -> *) u.
Stream s m Char =>
String -> ParsecT s u m Char
oneOf (String
whitec String -> String -> String
forall a. [a] -> [a] -> [a]
++ "@()'"))
CharParser st String -> String -> CharParser st String
forall s u (m :: * -> *) a.
ParsecT s u m a -> String -> ParsecT s u m a
<?> "word"
Char
c2 <- Char -> ParsecT String st Identity Char
forall s (m :: * -> *) u.
Stream s m Char =>
Char -> ParsecT s u m Char
char '\"' ParsecT String st Identity Char
-> String -> ParsecT String st Identity Char
forall s u (m :: * -> *) a.
ParsecT s u m a -> String -> ParsecT s u m a
<?> "\""
CharParser st String -> ParsecT String st Identity [String]
forall s u (m :: * -> *) a. ParsecT s u m a -> ParsecT s u m [a]
many CharParser st String
forall st. CharParser st String
white
String -> CharParser st String
forall (m :: * -> *) a. Monad m => a -> m a
return (String -> CharParser st String) -> String -> CharParser st String
forall a b. (a -> b) -> a -> b
$ Char
c1 Char -> String -> String
forall a. a -> [a] -> [a]
: String
s String -> String -> String
forall a. [a] -> [a] -> [a]
++ [Char
c2]
parens :: CharParser st a -> CharParser st a
parens :: CharParser st a -> CharParser st a
parens p :: CharParser st a
p = CharParser st Token
forall st. CharParser st Token
oParenT CharParser st Token -> CharParser st a -> CharParser st a
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> CharParser st a
p CharParser st a -> CharParser st Token -> CharParser st a
forall (m :: * -> *) a b. Monad m => m a -> m b -> m a
<< CharParser st Token
forall st. CharParser st Token
cParenT
andKey :: CharParser st Id.Token
andKey :: CharParser st Token
andKey = CharParser st String -> CharParser st Token
forall st. CharParser st String -> CharParser st Token
pToken (String -> CharParser st String
forall s (m :: * -> *) u.
Stream s m Char =>
String -> ParsecT s u m String
string String
andS) CharParser st Token -> String -> CharParser st Token
forall s u (m :: * -> *) a.
ParsecT s u m a -> String -> ParsecT s u m a
<?> "conjunction"
notKey :: CharParser st Id.Token
notKey :: CharParser st Token
notKey = CharParser st String -> CharParser st Token
forall st. CharParser st String -> CharParser st Token
pToken (String -> CharParser st String
forall s (m :: * -> *) u.
Stream s m Char =>
String -> ParsecT s u m String
string String
notS) CharParser st Token -> String -> CharParser st Token
forall s u (m :: * -> *) a.
ParsecT s u m a -> String -> ParsecT s u m a
<?> "negation"
orKey :: CharParser st Id.Token
orKey :: CharParser st Token
orKey = CharParser st String -> CharParser st Token
forall st. CharParser st String -> CharParser st Token
pToken (String -> CharParser st String
forall s (m :: * -> *) u.
Stream s m Char =>
String -> ParsecT s u m String
string String
orS) CharParser st Token -> String -> CharParser st Token
forall s u (m :: * -> *) a.
ParsecT s u m a -> String -> ParsecT s u m a
<?> "disjunction"
ifKey :: CharParser st Id.Token
ifKey :: CharParser st Token
ifKey = CharParser st String -> CharParser st Token
forall st. CharParser st String -> CharParser st Token
pToken (String -> CharParser st String
forall s (m :: * -> *) u.
Stream s m Char =>
String -> ParsecT s u m String
string String
ifS) CharParser st Token -> String -> CharParser st Token
forall s u (m :: * -> *) a.
ParsecT s u m a -> String -> ParsecT s u m a
<?> "implication"
iffKey :: CharParser st Id.Token
iffKey :: CharParser st Token
iffKey = CharParser st String -> CharParser st Token
forall st. CharParser st String -> CharParser st Token
pToken (String -> CharParser st String
forall s (m :: * -> *) u.
Stream s m Char =>
String -> ParsecT s u m String
string String
iffS) CharParser st Token -> String -> CharParser st Token
forall s u (m :: * -> *) a.
ParsecT s u m a -> String -> ParsecT s u m a
<?> "equivalence"
forallKey :: CharParser st Id.Token
forallKey :: CharParser st Token
forallKey = CharParser st String -> CharParser st Token
forall st. CharParser st String -> CharParser st Token
pToken (String -> CharParser st String
forall s (m :: * -> *) u.
Stream s m Char =>
String -> ParsecT s u m String
string String
forallS) CharParser st Token -> String -> CharParser st Token
forall s u (m :: * -> *) a.
ParsecT s u m a -> String -> ParsecT s u m a
<?> "universal quantification"
existsKey :: CharParser st Id.Token
existsKey :: CharParser st Token
existsKey = CharParser st String -> CharParser st Token
forall st. CharParser st String -> CharParser st Token
pToken (String -> CharParser st String
forall s (m :: * -> *) u.
Stream s m Char =>
String -> ParsecT s u m String
string String
existsS) CharParser st Token -> String -> CharParser st Token
forall s u (m :: * -> *) a.
ParsecT s u m a -> String -> ParsecT s u m a
<?> "existential quantification"
thatKey :: CharParser st Id.Token
thatKey :: CharParser st Token
thatKey = CharParser st String -> CharParser st Token
forall st. CharParser st String -> CharParser st Token
pToken (String -> CharParser st String
forall s (m :: * -> *) u.
Stream s m Char =>
String -> ParsecT s u m String
string "that") CharParser st Token -> String -> CharParser st Token
forall s u (m :: * -> *) a.
ParsecT s u m a -> String -> ParsecT s u m a
<?> "\"that\" term"
clTextKey :: CharParser st Id.Token
clTextKey :: CharParser st Token
clTextKey = CharParser st String -> CharParser st Token
forall st. CharParser st String -> CharParser st Token
pToken (CharParser st String -> CharParser st String
forall tok st a. GenParser tok st a -> GenParser tok st a
try (String -> CharParser st String
forall s (m :: * -> *) u.
Stream s m Char =>
String -> ParsecT s u m String
string "cl-text") CharParser st String
-> CharParser st String -> CharParser st String
forall s u (m :: * -> *) a.
ParsecT s u m a -> ParsecT s u m a -> ParsecT s u m a
<|> String -> CharParser st String
forall s (m :: * -> *) u.
Stream s m Char =>
String -> ParsecT s u m String
string "cl:text") CharParser st Token -> String -> CharParser st Token
forall s u (m :: * -> *) a.
ParsecT s u m a -> String -> ParsecT s u m a
<?> "text"
clModuleKey :: CharParser st Id.Token
clModuleKey :: CharParser st Token
clModuleKey = CharParser st String -> CharParser st Token
forall st. CharParser st String -> CharParser st Token
pToken (CharParser st String -> CharParser st String
forall tok st a. GenParser tok st a -> GenParser tok st a
try (String -> CharParser st String
forall s (m :: * -> *) u.
Stream s m Char =>
String -> ParsecT s u m String
string "cl-module") CharParser st String
-> CharParser st String -> CharParser st String
forall s u (m :: * -> *) a.
ParsecT s u m a -> ParsecT s u m a -> ParsecT s u m a
<|> String -> CharParser st String
forall s (m :: * -> *) u.
Stream s m Char =>
String -> ParsecT s u m String
string "cl:module")
CharParser st Token -> String -> CharParser st Token
forall s u (m :: * -> *) a.
ParsecT s u m a -> String -> ParsecT s u m a
<?> "module"
clImportsKey :: CharParser st Id.Token
clImportsKey :: CharParser st Token
clImportsKey = CharParser st String -> CharParser st Token
forall st. CharParser st String -> CharParser st Token
pToken (CharParser st String -> CharParser st String
forall tok st a. GenParser tok st a -> GenParser tok st a
try (String -> CharParser st String
forall s (m :: * -> *) u.
Stream s m Char =>
String -> ParsecT s u m String
string "cl-imports") CharParser st String
-> CharParser st String -> CharParser st String
forall s u (m :: * -> *) a.
ParsecT s u m a -> ParsecT s u m a -> ParsecT s u m a
<|> String -> CharParser st String
forall s (m :: * -> *) u.
Stream s m Char =>
String -> ParsecT s u m String
string "cl:imports")
CharParser st Token -> String -> CharParser st Token
forall s u (m :: * -> *) a.
ParsecT s u m a -> String -> ParsecT s u m a
<?> "importation"
clExcludesKey :: CharParser st Id.Token
clExcludesKey :: CharParser st Token
clExcludesKey = CharParser st String -> CharParser st Token
forall st. CharParser st String -> CharParser st Token
pToken (CharParser st String -> CharParser st String
forall tok st a. GenParser tok st a -> GenParser tok st a
try (String -> CharParser st String
forall s (m :: * -> *) u.
Stream s m Char =>
String -> ParsecT s u m String
string "cl-excludes") CharParser st String
-> CharParser st String -> CharParser st String
forall s u (m :: * -> *) a.
ParsecT s u m a -> ParsecT s u m a -> ParsecT s u m a
<|> String -> CharParser st String
forall s (m :: * -> *) u.
Stream s m Char =>
String -> ParsecT s u m String
string "cl:excludes")
CharParser st Token -> String -> CharParser st Token
forall s u (m :: * -> *) a.
ParsecT s u m a -> String -> ParsecT s u m a
<?> "exclusion list"
clEqualsKey :: CharParser st Id.Token
clEqualsKey :: CharParser st Token
clEqualsKey = CharParser st String -> CharParser st Token
forall st. CharParser st String -> CharParser st Token
pToken (String -> CharParser st String
forall s (m :: * -> *) u.
Stream s m Char =>
String -> ParsecT s u m String
string "=") CharParser st Token -> String -> CharParser st Token
forall s u (m :: * -> *) a.
ParsecT s u m a -> String -> ParsecT s u m a
<?> "equation"
clCommentKey :: CharParser st Id.Token
= CharParser st String -> CharParser st Token
forall st. CharParser st String -> CharParser st Token
pToken (CharParser st String -> CharParser st String
forall tok st a. GenParser tok st a -> GenParser tok st a
try (String -> CharParser st String
forall s (m :: * -> *) u.
Stream s m Char =>
String -> ParsecT s u m String
string "cl-comment") CharParser st String
-> CharParser st String -> CharParser st String
forall s u (m :: * -> *) a.
ParsecT s u m a -> ParsecT s u m a -> ParsecT s u m a
<|> String -> CharParser st String
forall s (m :: * -> *) u.
Stream s m Char =>
String -> ParsecT s u m String
string "cl:comment")
CharParser st Token -> String -> CharParser st Token
forall s u (m :: * -> *) a.
ParsecT s u m a -> String -> ParsecT s u m a
<?> "comment"
clRolesetKey :: CharParser st Id.Token
clRolesetKey :: CharParser st Token
clRolesetKey = CharParser st String -> CharParser st Token
forall st. CharParser st String -> CharParser st Token
pToken (String -> CharParser st String
forall s (m :: * -> *) u.
Stream s m Char =>
String -> ParsecT s u m String
string "cl-roleset" CharParser st String
-> CharParser st String -> CharParser st String
forall s u (m :: * -> *) a.
ParsecT s u m a -> ParsecT s u m a -> ParsecT s u m a
<|> String -> CharParser st String
forall s (m :: * -> *) u.
Stream s m Char =>
String -> ParsecT s u m String
string "roleset:") CharParser st Token -> String -> CharParser st Token
forall s u (m :: * -> *) a.
ParsecT s u m a -> String -> ParsecT s u m a
<?> "roleset"
clPrefixKey :: CharParser st Id.Token
clPrefixKey :: CharParser st Token
clPrefixKey = CharParser st String -> CharParser st Token
forall st. CharParser st String -> CharParser st Token
pToken (String -> CharParser st String
forall s (m :: * -> *) u.
Stream s m Char =>
String -> ParsecT s u m String
string "cl-prefix") CharParser st Token -> String -> CharParser st Token
forall s u (m :: * -> *) a.
ParsecT s u m a -> String -> ParsecT s u m a
<?> "prefix"
seqmark :: CharParser st Id.Token
seqmark :: CharParser st Token
seqmark = CharParser st String -> CharParser st Token
forall st. CharParser st String -> CharParser st Token
pToken ([String] -> CharParser st String -> CharParser st String
forall st. [String] -> CharParser st String -> CharParser st String
reserved [String]
reservedelement2 CharParser st String
forall st. CharParser st String
scanSeqMark) CharParser st Token -> String -> CharParser st Token
forall s u (m :: * -> *) a.
ParsecT s u m a -> String -> ParsecT s u m a
<?> "sequence marker"
identifier :: CharParser st Id.Token
identifier :: CharParser st Token
identifier = CharParser st String -> CharParser st Token
forall st. CharParser st String -> CharParser st Token
pToken ([String] -> CharParser st String -> CharParser st String
forall st. [String] -> CharParser st String -> CharParser st String
reserved [String]
reservedelement CharParser st String
forall st. CharParser st String
scanClWord) CharParser st Token -> String -> CharParser st Token
forall s u (m :: * -> *) a.
ParsecT s u m a -> String -> ParsecT s u m a
<?> "name"
scanSeqMark :: CharParser st String
scanSeqMark :: CharParser st String
scanSeqMark = do
String
sq <- String -> CharParser st String
forall s (m :: * -> *) u.
Stream s m Char =>
String -> ParsecT s u m String
string "..."
String
w <- ParsecT String st Identity Char -> CharParser st String
forall s u (m :: * -> *) a. ParsecT s u m a -> ParsecT s u m [a]
many ParsecT String st Identity Char
forall st. CharParser st Char
clLetter CharParser st String -> String -> CharParser st String
forall s u (m :: * -> *) a.
ParsecT s u m a -> String -> ParsecT s u m a
<?> "sequence marker"
String -> CharParser st String
forall (m :: * -> *) a. Monad m => a -> m a
return (String -> CharParser st String) -> String -> CharParser st String
forall a b. (a -> b) -> a -> b
$ String
sq String -> String -> String
forall a. [a] -> [a] -> [a]
++ String
w
scanClWord :: CharParser st String
scanClWord :: CharParser st String
scanClWord = CharParser st String
forall st. CharParser st String
quotedstring CharParser st String
-> CharParser st String -> CharParser st String
forall s u (m :: * -> *) a.
ParsecT s u m a -> ParsecT s u m a -> ParsecT s u m a
<|> CharParser st String
forall st. CharParser st String
enclosedname CharParser st String
-> CharParser st String -> CharParser st String
forall s u (m :: * -> *) a.
ParsecT s u m a -> ParsecT s u m a -> ParsecT s u m a
<|> (ParsecT String st Identity Char -> CharParser st String
forall s (m :: * -> *) t u a.
Stream s m t =>
ParsecT s u m a -> ParsecT s u m [a]
many1 ParsecT String st Identity Char
forall st. CharParser st Char
clLetter CharParser st String -> String -> CharParser st String
forall s u (m :: * -> *) a.
ParsecT s u m a -> String -> ParsecT s u m a
<?> "words")
clLetters :: Char -> Bool
clLetters :: Char -> Bool
clLetters ch :: Char
ch = let c :: Int
c = Char -> Int
ord Char
ch in
Int
c Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>= 33 Bool -> Bool -> Bool
&& Int
c Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
<= 126 Bool -> Bool -> Bool
&& (Int
c Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
<= 38 Bool -> Bool -> Bool
&& Int
c Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
/= 34
Bool -> Bool -> Bool
|| Int
c Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>= 42 Bool -> Bool -> Bool
&& Int
c Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
/= 64 Bool -> Bool -> Bool
&& Int
c Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
/= 92)
clLetters2 :: Char -> Bool
clLetters2 :: Char -> Bool
clLetters2 ch :: Char
ch = let c :: Int
c = Char -> Int
ord Char
ch in
(Int
c Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>= 32 Bool -> Bool -> Bool
&& Int
c Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
<= 126 Bool -> Bool -> Bool
&& (Int
c Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
<= 38 Bool -> Bool -> Bool
&& Int
c Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
/= 34
Bool -> Bool -> Bool
|| Int
c Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>= 42 Bool -> Bool -> Bool
&& Int
c Int -> Int -> Bool
forall a. Eq a => a -> a -> Bool
/= 64)) Bool -> Bool -> Bool
|| Int
c Int -> Int -> Bool
forall a. Ord a => a -> a -> Bool
>= 128
clLetter :: CharParser st Char
clLetter :: CharParser st Char
clLetter = (Char -> Bool) -> CharParser st Char
forall s (m :: * -> *) u.
Stream s m Char =>
(Char -> Bool) -> ParsecT s u m Char
satisfy Char -> Bool
clLetters CharParser st Char -> String -> CharParser st Char
forall s u (m :: * -> *) a.
ParsecT s u m a -> String -> ParsecT s u m a
<?> "cl letter"
reservedelement :: [String]
reservedelement :: [String]
reservedelement = ["=", "and", "or", "iff", "if", "forall", "exists", "not"
, "that", "...", "cl:text", "cl:imports", "cl:excludes"
, "cl:module", "cl:comment", "roleset:"] [String] -> [String] -> [String]
forall a. [a] -> [a] -> [a]
++ [String]
reservedcl
reservedcl :: [String]
reservedcl :: [String]
reservedcl = ["cl-text", "cl-imports", "cl-excludes", "cl-module"
, "cl-comment", "cl-roleset"]
reservedelement2 :: [String]
reservedelement2 :: [String]
reservedelement2 = ["=", "and", "or", "iff", "if", "forall", "exists", "not"
, "that", "cl:text", "cl:imports", "cl:excludes", "cl:module"
, "cl:comment", "roleset:"]
commentBlockOpen :: String
= "/*"
commentBlockClose :: String
= "*/"
commentLineStart :: String
= "//"
newLinec :: String
newLinec :: String
newLinec = "\n\r"
whitec :: String
whitec :: String
whitec = String
newLinec String -> String -> String
forall a. [a] -> [a] -> [a]
++ "\t\v\f "
whiteSpace :: CharParser st String
whiteSpace :: CharParser st String
whiteSpace = ParsecT String st Identity Char -> CharParser st String
forall s (m :: * -> *) t u a.
Stream s m t =>
ParsecT s u m a -> ParsecT s u m [a]
many1 (ParsecT String st Identity Char -> CharParser st String)
-> ParsecT String st Identity Char -> CharParser st String
forall a b. (a -> b) -> a -> b
$ String -> ParsecT String st Identity Char
forall s (m :: * -> *) u.
Stream s m Char =>
String -> ParsecT s u m Char
oneOf String
whitec
commentBlock :: CharParser st String
=
String -> CharParser st String
forall s (m :: * -> *) u.
Stream s m Char =>
String -> ParsecT s u m String
string String
commentBlockOpen CharParser st String
-> CharParser st String -> CharParser st String
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> ParsecT String st Identity Char
-> CharParser st String -> CharParser st String
forall s (m :: * -> *) t u a end.
Stream s m t =>
ParsecT s u m a -> ParsecT s u m end -> ParsecT s u m [a]
manyTill ParsecT String st Identity Char
forall s (m :: * -> *) u. Stream s m Char => ParsecT s u m Char
anyChar (CharParser st String -> CharParser st String
forall tok st a. GenParser tok st a -> GenParser tok st a
try (CharParser st String -> CharParser st String)
-> CharParser st String -> CharParser st String
forall a b. (a -> b) -> a -> b
$ String -> CharParser st String
forall s (m :: * -> *) u.
Stream s m Char =>
String -> ParsecT s u m String
string String
commentBlockClose)
CharParser st String -> String -> CharParser st String
forall s u (m :: * -> *) a.
ParsecT s u m a -> String -> ParsecT s u m a
<?> ""
commentLine :: CharParser st String
=
String -> CharParser st String
forall s (m :: * -> *) u.
Stream s m Char =>
String -> ParsecT s u m String
string String
commentLineStart CharParser st String
-> CharParser st String -> CharParser st String
forall (m :: * -> *) a b. Monad m => m a -> m b -> m b
>> ParsecT String st Identity Char -> CharParser st String
forall s u (m :: * -> *) a. ParsecT s u m a -> ParsecT s u m [a]
many (String -> ParsecT String st Identity Char
forall s (m :: * -> *) u.
Stream s m Char =>
String -> ParsecT s u m Char
noneOf String
newLinec) CharParser st String -> String -> CharParser st String
forall s u (m :: * -> *) a.
ParsecT s u m a -> String -> ParsecT s u m a
<?> ""
white :: CharParser st String
white :: CharParser st String
white =
CharParser st String
forall st. CharParser st String
whiteSpace
CharParser st String
-> CharParser st String -> CharParser st String
forall s u (m :: * -> *) a.
ParsecT s u m a -> ParsecT s u m a -> ParsecT s u m a
<|>
CharParser st String -> CharParser st String
forall tok st a. GenParser tok st a -> GenParser tok st a
try CharParser st String
forall st. CharParser st String
commentLine
CharParser st String
-> CharParser st String -> CharParser st String
forall s u (m :: * -> *) a.
ParsecT s u m a -> ParsecT s u m a -> ParsecT s u m a
<|>
CharParser st String
forall st. CharParser st String
commentBlock