projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Big tidy-up of deriving code
[ghc-hetmet.git]
/
compiler
/
parser
/
Lexer.x
diff --git
a/compiler/parser/Lexer.x
b/compiler/parser/Lexer.x
index
56d036e
..
316f21f
100644
(file)
--- a/
compiler/parser/Lexer.x
+++ b/
compiler/parser/Lexer.x
@@
-233,6
+233,8
@@
$white_no_nl+ ;
"{-#" $whitechar* (DEPRECATED|deprecated)
{ token ITdeprecated_prag }
"{-#" $whitechar* (SCC|scc) { token ITscc_prag }
"{-#" $whitechar* (DEPRECATED|deprecated)
{ token ITdeprecated_prag }
"{-#" $whitechar* (SCC|scc) { token ITscc_prag }
+ "{-#" $whitechar* (GENERATED|generated)
+ { token ITgenerated_prag }
"{-#" $whitechar* (CORE|core) { token ITcore_prag }
"{-#" $whitechar* (UNPACK|unpack) { token ITunpack_prag }
"{-#" $whitechar* (CORE|core) { token ITcore_prag }
"{-#" $whitechar* (UNPACK|unpack) { token ITunpack_prag }
@@
-387,9
+389,9
@@
data Token
| ITdata
| ITdefault
| ITderiving
| ITdata
| ITdefault
| ITderiving
+ | ITderived
| ITdo
| ITelse
| ITdo
| ITelse
- | ITfor
| IThiding
| ITif
| ITimport
| IThiding
| ITif
| ITimport
@@
-432,6
+434,7
@@
data Token
| ITdeprecated_prag
| ITline_prag
| ITscc_prag
| ITdeprecated_prag
| ITline_prag
| ITscc_prag
+ | ITgenerated_prag
| ITcore_prag -- hdaume: core annotations
| ITunpack_prag
| ITclose_prag
| ITcore_prag -- hdaume: core annotations
| ITunpack_prag
| ITclose_prag
@@
-541,7
+544,7
@@
isSpecial :: Token -> Bool
-- not as a keyword.
isSpecial ITas = True
isSpecial IThiding = True
-- not as a keyword.
isSpecial ITas = True
isSpecial IThiding = True
-isSpecial ITfor = True
+isSpecial ITderived = True
isSpecial ITqualified = True
isSpecial ITforall = True
isSpecial ITexport = True
isSpecial ITqualified = True
isSpecial ITforall = True
isSpecial ITexport = True
@@
-573,9
+576,9
@@
reservedWordsFM = listToUFM $
( "data", ITdata, 0 ),
( "default", ITdefault, 0 ),
( "deriving", ITderiving, 0 ),
( "data", ITdata, 0 ),
( "default", ITdefault, 0 ),
( "deriving", ITderiving, 0 ),
+ ( "derived", ITderived, 0 ),
( "do", ITdo, 0 ),
( "else", ITelse, 0 ),
( "do", ITdo, 0 ),
( "else", ITelse, 0 ),
- ( "for", ITfor, 0 ),
( "hiding", IThiding, 0 ),
( "if", ITif, 0 ),
( "import", ITimport, 0 ),
( "hiding", IThiding, 0 ),
( "if", ITif, 0 ),
( "import", ITimport, 0 ),