Commit d333188e authored by Björn Peemöller 's avatar Björn Peemöller
Browse files

Parsing of (:) works again

parent 54dcdba2
......@@ -128,6 +128,9 @@ options =
(ReqArg (\ arg opts -> opts { optVerbosity =
classifyVerbosity arg }) "<n>")
"set verbosity level to <n>"
, Option "" ["no-verb"]
(NoArg (\ opts -> opts { optVerbosity = Quiet } ))
"set verbosity level to quiet"
-- compilation
, Option "f" ["force"]
(NoArg (\ opts -> opts { optForce = True }))
......
......@@ -105,6 +105,7 @@ In this section a lexer for Curry is implemented.
> -- reserved operators
> | At -- @
> | Colon -- :
> | DotDot -- ..
> | DoubleColon -- ::
> | Equals -- =
......@@ -126,7 +127,6 @@ In this section a lexer for Curry is implemented.
> | Id_qualified
> -- special operators
> | SymColon -- :
> | SymDot -- .
> | SymMinus -- -
> | SymMinusDot -- -.
......@@ -278,6 +278,7 @@ all tokens in their source representation.
> showsPrec _ (Token VRightBrace _) = showsEscaped "}"
> . showString " (inserted due to layout)"
> showsPrec _ (Token At _) = showsEscaped "@"
> showsPrec _ (Token Colon _) = showsEscaped ":"
> showsPrec _ (Token DotDot _) = showsEscaped ".."
> showsPrec _ (Token DoubleColon _) = showsEscaped "::"
> showsPrec _ (Token Equals _) = showsEscaped "="
......@@ -287,7 +288,6 @@ all tokens in their source representation.
> showsPrec _ (Token RightArrow _) = showsEscaped "->"
> showsPrec _ (Token Tilde _) = showsEscaped "~"
> showsPrec _ (Token Binds _) = showsEscaped ":="
> showsPrec _ (Token SymColon _) = showsSpecialOperator ":"
> showsPrec _ (Token SymDot _) = showsSpecialOperator "."
> showsPrec _ (Token SymMinus _) = showsSpecialOperator "-"
> showsPrec _ (Token SymMinusDot _) = showsSpecialOperator "-."
......@@ -332,7 +332,8 @@ Maps for reserved operators and identifiers
> -- |Map of reserved operators
> reservedOps:: Map.Map String Category
> reservedOps = Map.fromList
> [ ("@", At )
> [ ("@" , At )
> , (":" , Colon )
> , ("::", DoubleColon)
> , ("..", DotDot )
> , ("=" , Equals )
......@@ -347,8 +348,7 @@ Maps for reserved operators and identifiers
> -- |Map of reserved and special operators
> reservedSpecialOps :: Map.Map String Category
> reservedSpecialOps = Map.union reservedOps $ Map.fromList
> [ (":" , SymColon )
> , ("." , SymDot )
> [ ("." , SymDot )
> , ("-" , SymMinus )
> , ("-.", SymMinusDot)
> ]
......
......@@ -726,7 +726,7 @@ qconop = qConSym <|> backquotes (qConId <?> "operator name expected")
> sym :: Parser Token Ident a
> sym = (\ pos -> mkIdentPosition pos . sval) <$> position <*>
> tokens [Sym, SymColon, SymDot, SymMinus, SymMinusDot]
> tokens [Sym, SymDot, SymMinus, SymMinusDot]
> qSym :: Parser Token QualIdent a
> qSym = qualify <$> sym <|> mkQIdent <$> position <*> token QSym
......@@ -735,7 +735,7 @@ qconop = qConSym <|> backquotes (qConId <?> "operator name expected")
> colon :: Parser Token QualIdent a
> colon = (\ p _ -> qualify $ addPositionIdent p consId) <$>
> position <*> token SymColon
> position <*> token Colon
> minus :: Parser Token Ident a
> minus = (\ p _ -> addPositionIdent p minusId) <$>
......
......@@ -427,7 +427,7 @@ token2code tok@(Token cat _)
= Keyword (token2string tok)
| elem cat [LeftParen,RightParen,Semicolon,LeftBrace,RightBrace,LeftBracket,
RightBracket,Comma,Underscore,Backquote,
At,DotDot,DoubleColon,Equals,Backslash,Bar,LeftArrow,RightArrow,
At,Colon,DotDot,DoubleColon,Equals,Backslash,Bar,LeftArrow,RightArrow,
Tilde]
= Symbol (token2string tok)
| elem cat [LineComment, NestedComment]
......@@ -443,7 +443,7 @@ token2code tok@(Token cat _)
isTokenIdentifier :: Token -> Bool
isTokenIdentifier (Token cat _) =
elem cat [Id, QId, Sym, QSym, SymColon, SymDot, SymMinus, SymMinusDot]
elem cat [Id, QId, Sym, QSym, SymDot, SymMinus, SymMinusDot]
-- DECL Position
......@@ -714,6 +714,7 @@ token2string (Token Backquote _) = "`"
token2string (Token VSemicolon _) = ""
token2string (Token VRightBrace _) = ""
token2string (Token At _) = "@"
token2string (Token Colon _) = ":"
token2string (Token DotDot _) = ".."
token2string (Token DoubleColon _) = "::"
token2string (Token Equals _) = "="
......@@ -722,7 +723,6 @@ token2string (Token Bar _) = "|"
token2string (Token LeftArrow _) = "<-"
token2string (Token RightArrow _) = "->"
token2string (Token Tilde _) = "~"
token2string (Token SymColon _) = ":"
token2string (Token SymDot _) = "."
token2string (Token SymMinus _) = "-"
token2string (Token SymMinusDot _) = "-."
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment