diff --git a/compiler/parser/Lexer.x b/compiler/parser/Lexer.x
index 43be73f..d61cc75 100644
|
a
|
b
|
|
| 110 | 110 | $unigraphic = \x06 -- Trick Alex into handling Unicode. See alexGetChar. |
| 111 | 111 | $graphic = [$small $large $symbol $digit $special $unigraphic \:\"\'] |
| 112 | 112 | |
| | 113 | $mdash = \x07 -- Trick Alex into handling Unicode. See alexGetChar. |
| | 114 | |
| 113 | 115 | $octit = 0-7 |
| 114 | 116 | $hexit = [$decdigit A-F a-f] |
| 115 | 117 | $symchar = [$symbol \:] |
| … |
… |
|
| 172 | 174 | "-- " ~[$docsym \#] .* { lineCommentToken } |
| 173 | 175 | "--" [^$symbol : \ ] .* { lineCommentToken } |
| 174 | 176 | |
| | 177 | -- Ditto, for unicode syntax: |
| | 178 | |
| | 179 | $mdash " " ~[$docsym \#] .* / { ifExtension unicodeSyntaxEnabled } { lineCommentToken } |
| | 180 | $mdash [^$symbol : \ ] .* / { ifExtension unicodeSyntaxEnabled } { lineCommentToken } |
| | 181 | |
| 175 | 182 | -- Next, match Haddock comments if no -haddock flag |
| 176 | 183 | |
| 177 | 184 | "-- " [$docsym \#] .* / { ifExtension (not . haddockEnabled) } { lineCommentToken } |
| | 185 | $mdash " " [$docsym \#] .* / { ifExtension (not . haddockEnabled) `aapAnd` ifExtension unicodeSyntaxEnabled } { lineCommentToken } |
| 178 | 186 | |
| 179 | 187 | -- Now, when we've matched comments that begin with 2 dashes and continue |
| 180 | 188 | -- with a different character, we need to match comments that begin with three |
| … |
… |
|
| 188 | 196 | -- character, we also need to match a whole line filled with just dashes. |
| 189 | 197 | |
| 190 | 198 | "--"\-* / { atEOL } { lineCommentToken } |
| | 199 | $mdash $mdash* / { atEOL `aapAnd` ifExtension unicodeSyntaxEnabled } { lineCommentToken } |
| 191 | 200 | |
| 192 | 201 | -- We need this rule since none of the other single line comment rules |
| 193 | 202 | -- actually match this case. |
| 194 | 203 | |
| 195 | 204 | "-- " / { atEOL } { lineCommentToken } |
| | 205 | $mdash " " / { atEOL `aapAnd` ifExtension unicodeSyntaxEnabled } { lineCommentToken } |
| 196 | 206 | |
| 197 | 207 | -- 'bol' state: beginning of a line. Slurp up all the whitespace (including |
| 198 | 208 | -- blank lines) until we find a non-whitespace character, then do layout |
| … |
… |
|
| 270 | 280 | { dispatch_pragmas fileHeaderPrags } |
| 271 | 281 | |
| 272 | 282 | "-- #" { multiline_doc_comment } |
| | 283 | $mdash " #" / { ifExtension unicodeSyntaxEnabled } { multiline_doc_comment } |
| 273 | 284 | } |
| 274 | 285 | |
| 275 | 286 | <0> { |
| … |
… |
|
| 280 | 291 | |
| 281 | 292 | <0> { |
| 282 | 293 | "-- #" .* { lineCommentToken } |
| | 294 | $mdash " #" .* / { ifExtension unicodeSyntaxEnabled } { lineCommentToken } |
| 283 | 295 | } |
| 284 | 296 | |
| 285 | 297 | <0,option_prags> { |
| … |
… |
|
| 293 | 305 | |
| 294 | 306 | <0,option_prags> { |
| 295 | 307 | "-- " $docsym / { ifExtension haddockEnabled } { multiline_doc_comment } |
| | 308 | $mdash " " $docsym / { ifExtension haddockEnabled `aapAnd` ifExtension unicodeSyntaxEnabled } { multiline_doc_comment } |
| 296 | 309 | "{-" \ ? $docsym / { ifExtension haddockEnabled } { nested_doc_comment } |
| 297 | 310 | } |
| 298 | 311 | |
| … |
… |
|
| 783 | 796 | ifExtension :: (Int -> Bool) -> AlexAccPred Int |
| 784 | 797 | ifExtension pred bits _ _ _ = pred bits |
| 785 | 798 | |
| | 799 | aapAnd :: AlexAccPred Int -> AlexAccPred Int -> AlexAccPred Int |
| | 800 | aapAnd a b x y z w = a x y z w && b x y z w |
| | 801 | |
| 786 | 802 | multiline_doc_comment :: Action |
| 787 | 803 | multiline_doc_comment span buf _len = withLexedDocType (worker "") |
| 788 | 804 | where |
| … |
… |
|
| 1610 | 1626 | symbol = '\x4' |
| 1611 | 1627 | space = '\x5' |
| 1612 | 1628 | other_graphic = '\x6' |
| | 1629 | mdash_char = '\x7' |
| 1613 | 1630 | |
| 1614 | 1631 | adj_c |
| 1615 | | | c <= '\x06' = non_graphic |
| | 1632 | | c <= '\x07' = non_graphic |
| 1616 | 1633 | | c <= '\x7f' = c |
| | 1634 | | c == 'â' = mdash_char |
| 1617 | 1635 | -- Alex doesn't handle Unicode, so when Unicode |
| 1618 | 1636 | -- character is encountered we output these values |
| 1619 | 1637 | -- with the actual character value hidden in the state. |
diff --git a/compiler/rename/RnEnv.lhs b/compiler/rename/RnEnv.lhs
index 9771ab1..37f0a61 100644
|
a
|
b
|
|
| 1085 | 1085 | ; return (mkUnboundName rdr_name) } |
| 1086 | 1086 | |
| 1087 | 1087 | unknownNameErr :: RdrName -> SDoc |
| 1088 | | unknownNameErr rdr_name |
| 1089 | | = vcat [ hang (ptext (sLit "Not in scope:")) |
| 1090 | | 2 (pprNonVarNameSpace (occNameSpace (rdrNameOcc rdr_name)) |
| 1091 | | <+> quotes (ppr rdr_name)) |
| 1092 | | , extra ] |
| | 1088 | unknownNameErr rdr_name = |
| | 1089 | vcat [ hang (ptext (sLit "Not in scope:")) |
| | 1090 | 2 (pprNonVarNameSpace (occNameSpace (rdrNameOcc rdr_name)) |
| | 1091 | <+> quotes (ppr rdr_name)) |
| | 1092 | , extra ] |
| 1093 | 1093 | where |
| 1094 | 1094 | extra | rdr_name == forall_tv_RDR = perhapsForallMsg |
| | 1095 | | rdr_name == mkUnqual varName (fsLit "â") = perhapsUnicodeMsg |
| 1095 | 1096 | | otherwise = empty |
| 1096 | 1097 | |
| 1097 | 1098 | type HowInScope = Either SrcSpan ImpDeclSpec |
| … |
… |
|
| 1339 | 1340 | = vcat [ ptext (sLit "Perhaps you intended to use -XExplicitForAll or similar flag") |
| 1340 | 1341 | , ptext (sLit "to enable explicit-forall syntax: forall <tvs>. <type>")] |
| 1341 | 1342 | |
| | 1343 | perhapsUnicodeMsg :: SDoc |
| | 1344 | perhapsUnicodeMsg |
| | 1345 | = ptext (sLit "Perhaps you intended to use -XUnicodeSyntax?") |
| | 1346 | |
| 1342 | 1347 | unknownSubordinateErr :: SDoc -> RdrName -> SDoc |
| 1343 | 1348 | unknownSubordinateErr doc op -- Doc is "method of class" or |
| 1344 | 1349 | -- "field of constructor" |