diff options
author | simonmar <unknown> | 2005-01-04 16:15:51 +0000 |
---|---|---|
committer | simonmar <unknown> | 2005-01-04 16:15:51 +0000 |
commit | 05f70f6e4d5d413e6fc128fa9de65ac3ac141840 (patch) | |
tree | 0e4fdc621881247b3ee62e4533a3301e2afe68b4 | |
parent | 92d9753ef9a0e070b78a3b2fe2e2de469c7529dc (diff) |
[haddock @ 2005-01-04 16:15:51 by simonmar]
parser fix: allow qualified specialids.
-rw-r--r-- | src/HsLexer.lhs | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/HsLexer.lhs b/src/HsLexer.lhs index d3776bbe..96e80c73 100644 --- a/src/HsLexer.lhs +++ b/src/HsLexer.lhs @@ -1,5 +1,5 @@ ----------------------------------------------------------------------------- --- $Id: HsLexer.lhs,v 1.16 2004/05/09 14:39:53 panne Exp $ +-- $Id: HsLexer.lhs,v 1.17 2005/01/04 16:15:51 simonmar Exp $ -- -- (c) The GHC Team, 1997-2000 -- @@ -182,6 +182,19 @@ reserved_ids = [ ( "stdcall", KW_StdCall ) ] +specialIds = [ + KW_As, + KW_Unsafe, + KW_Safe, + KW_ThreadSafe, + KW_Qualified, + KW_Hiding, + KW_Export, + KW_StdCall, + KW_CCall, + KW_DotNet + ] + isIdent, isSymbol, isWhite :: Char -> Bool isIdent c = isAlpha c || isDigit c || c == '\'' || c == '_' isSymbol c = elem c ":!#$%&*+./<=>?@\\^|-~" @@ -463,8 +476,8 @@ lexCon qual cont s0 loc y x = in case lookup id0 reserved_ids of -- cannot qualify a reserved word - Just _ -> just_a_conid - Nothing -> forward (l_con+1+l_id) (QVarId (qual', id0)) rest1 + Just id | id `notElem` specialIds -> just_a_conid + _ -> forward (l_con+1+l_id) (QVarId (qual', id0)) rest1 | isUpper c1 -> -- qualified conid? lexCon qual' cont (c1:s1) loc y (x+l_con+1) |