X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=compiler%2Fparser%2FLexer.x;h=26f7e485bb4e25abce69fe88ae9c3fc176a9c513;hb=ce2ea8274f72199ac32d5219fcadb0aaeb968707;hp=5e6535678e11299986f21103223fd053b566e23c;hpb=4edbeb14e25f71824c53c524028d12440928707e;p=ghc-hetmet.git diff --git a/compiler/parser/Lexer.x b/compiler/parser/Lexer.x index 5e65356..26f7e48 100644 --- a/compiler/parser/Lexer.x +++ b/compiler/parser/Lexer.x @@ -431,6 +431,7 @@ data Token | ITderiving | ITdo | ITelse + | ITgeneric | IThiding | ITif | ITimport @@ -485,6 +486,8 @@ data Token | IToptions_prag String | ITinclude_prag String | ITlanguage_prag + | ITvect_prag + | ITvect_scalar_prag | ITdotdot -- reserved symbols | ITcolon @@ -633,6 +636,7 @@ reservedWordsFM = listToUFM $ ( "deriving", ITderiving, 0 ), ( "do", ITdo, 0 ), ( "else", ITelse, 0 ), + ( "generic", ITgeneric, bit genericsBit ), ( "hiding", IThiding, 0 ), ( "if", ITif, 0 ), ( "import", ITimport, 0 ), @@ -1750,7 +1754,7 @@ setAlrExpectingOCurly b = P $ \s -> POk (s {alr_expecting_ocurly = b}) () -- integer genericsBit :: Int -genericsBit = 0 -- {| and |} +genericsBit = 0 -- {|, |} and "generic" ffiBit :: Int ffiBit = 1 parrBit :: Int @@ -2275,13 +2279,14 @@ oneWordPrags = Map.fromList([("rules", rulePrag), ("generated", token ITgenerated_prag), ("core", token ITcore_prag), ("unpack", token ITunpack_prag), - ("ann", token ITann_prag)]) + ("ann", token ITann_prag), + ("vectorize", token ITvect_prag)]) twoWordPrags = Map.fromList([("inline conlike", token (ITinline_prag Inline ConLike)), ("notinline conlike", token (ITinline_prag NoInline ConLike)), ("specialize inline", token (ITspec_inline_prag True)), - ("specialize notinline", token (ITspec_inline_prag False))]) - + ("specialize notinline", token (ITspec_inline_prag False)), + ("vectorize scalar", token ITvect_scalar_prag)]) dispatch_pragmas :: Map String Action -> Action dispatch_pragmas prags span buf len = case Map.lookup (clean_pragma (lexemeToString buf len)) prags of @@ -2300,6 +2305,7 @@ clean_pragma prag = canon_ws (map toLower (unprefix prag)) canonical prag' = case prag' of "noinline" -> "notinline" "specialise" -> "specialize" + "vectorise" -> "vectorize" "constructorlike" -> "conlike" _ -> prag' canon_ws s = unwords (map canonical (words s))