-- single-line line pragmas, of the form
-- # <line> "<file>" <extra-stuff> \n
-- single-line line pragmas, of the form
-- # <line> "<file>" <extra-stuff> \n
- "{-#" $whitechar* (RULES|rules) { rulePrag }
- "{-#" $whitechar* (INLINE|inline) { token (ITinline_prag True) }
- "{-#" $whitechar* (NO(T?)INLINE|no(t?)inline)
+ "{-#" $whitechar* (RULES|rules) / { notFollowedByPragmaChar } { rulePrag }
+ "{-#" $whitechar* (INLINE|inline) / { notFollowedByPragmaChar }
+ { token (ITinline_prag True) }
+ "{-#" $whitechar* (NO(T?)INLINE|no(t?)inline) / { notFollowedByPragmaChar }
- "{-#" $whitechar* (SOURCE|source) { token ITsource_prag }
- "{-#" $whitechar* (WARNING|warning)
+ "{-#" $whitechar* (SOURCE|source) / { notFollowedByPragmaChar }
+ { token ITsource_prag }
+ "{-#" $whitechar* (WARNING|warning) / { notFollowedByPragmaChar }
- "{-#" $whitechar* (SCC|scc) { token ITscc_prag }
- "{-#" $whitechar* (GENERATED|generated)
+ "{-#" $whitechar* (SCC|scc) / { notFollowedByPragmaChar }
+ { token ITscc_prag }
+ "{-#" $whitechar* (GENERATED|generated) / { notFollowedByPragmaChar }
- "{-#" $whitechar* (CORE|core) { token ITcore_prag }
- "{-#" $whitechar* (UNPACK|unpack) { token ITunpack_prag }
+ "{-#" $whitechar* (CORE|core) / { notFollowedByPragmaChar }
+ { token ITcore_prag }
+ "{-#" $whitechar* (UNPACK|unpack) / { notFollowedByPragmaChar }
+ { token ITunpack_prag }
+ "{-#" $whitechar* (ANN|ann) / { notFollowedByPragmaChar }
+ { token ITann_prag }
-- We ignore all these pragmas, but don't generate a warning for them
-- CFILES is a hugs-only thing.
-- We ignore all these pragmas, but don't generate a warning for them
-- CFILES is a hugs-only thing.
- "{-#" $whitechar* (OPTIONS|options) { lex_string_prag IToptions_prag }
- "{-#" $whitechar* (OPTIONS_GHC|options_ghc)
+ "{-#" $whitechar* (OPTIONS|options) / { notFollowedByPragmaChar }
+ { lex_string_prag IToptions_prag }
+ "{-#" $whitechar* (OPTIONS_GHC|options_ghc) / { notFollowedByPragmaChar }
- "{-#" $whitechar* (LANGUAGE|language) { token ITlanguage_prag }
- "{-#" $whitechar* (INCLUDE|include) { lex_string_prag ITinclude_prag }
+ "{-#" $whitechar* (LANGUAGE|language) / { notFollowedByPragmaChar }
+ { token ITlanguage_prag }
+ "{-#" $whitechar* (INCLUDE|include) / { notFollowedByPragmaChar }
+ { lex_string_prag ITinclude_prag }
,("-<<", ITLarrowtail, arrowsEnabled)
,(">>-", ITRarrowtail, arrowsEnabled)
,("-<<", ITLarrowtail, arrowsEnabled)
,(">>-", ITRarrowtail, arrowsEnabled)
,("∷", ITdcolon, unicodeSyntaxEnabled)
,("⇒", ITdarrow, unicodeSyntaxEnabled)
,("∀", ITforall, \i -> unicodeSyntaxEnabled i &&
,("∷", ITdcolon, unicodeSyntaxEnabled)
,("⇒", ITdarrow, unicodeSyntaxEnabled)
,("∀", ITforall, \i -> unicodeSyntaxEnabled i &&
-- ToDo: ideally, → and ∷ should be "specials", so that they cannot
-- form part of a large operator. This would let us have a better
-- syntax for kinds: ɑ∷*→* would be a legal kind signature. (maybe).
-- ToDo: ideally, → and ∷ should be "specials", so that they cannot
-- form part of a large operator. This would let us have a better
-- syntax for kinds: ɑ∷*→* would be a legal kind signature. (maybe).
-- We must reject doc comments as being ordinary comments everywhere.
-- In some cases the doc comment will be selected as the lexeme due to
-- maximal munch, but not always, because the nested comment rule is
-- We must reject doc comments as being ordinary comments everywhere.
-- In some cases the doc comment will be selected as the lexeme due to
-- maximal munch, but not always, because the nested comment rule is
-- We've seen 'x, where x is a valid character
-- (i.e. not newline etc) but not a quote or backslash
case alexGetChar' i2 of -- Look ahead one more character
-- We've seen 'x, where x is a valid character
-- (i.e. not newline etc) but not a quote or backslash
case alexGetChar' i2 of -- Look ahead one more character
Just ('\'', i3) -> do -- We've seen 'x'
setInput i3
finish_char_tok loc c
_other -> do -- We've seen 'x not followed by quote
Just ('\'', i3) -> do -- We've seen 'x'
setInput i3
finish_char_tok loc c
_other -> do -- We've seen 'x not followed by quote
-- If TH is on, just parse the quote only
th_exts <- extension thEnabled
let (AI end _ _) = i1
-- If TH is on, just parse the quote only
th_exts <- extension thEnabled
let (AI end _ _) = i1
OpenPunctuation -> other_graphic
ClosePunctuation -> other_graphic
InitialQuote -> other_graphic
FinalQuote -> other_graphic
OpenPunctuation -> other_graphic
ClosePunctuation -> other_graphic
InitialQuote -> other_graphic
FinalQuote -> other_graphic