... |
... |
@@ -273,7 +273,7 @@ $tab { warnTab } |
273
|
273
|
-- set.
|
274
|
274
|
|
275
|
275
|
"{-" / { isNormalComment } { nested_comment }
|
276
|
|
-"/*" / { ifExtension GhcCppBit } { cpp_comment }
|
|
276
|
+-- "/*" / { ifExtension GhcCppBit } { cpp_comment }
|
277
|
277
|
|
278
|
278
|
-- Single-line comments are a bit tricky. Haskell 98 says that two or
|
279
|
279
|
-- more dashes followed by a symbol should be parsed as a varsym, so we
|
... |
... |
@@ -333,11 +333,16 @@ $unigraphic / { isSmartQuote } { smart_quote_error } |
333
|
333
|
^\# line { begin line_prag1 }
|
334
|
334
|
^\# / { followedByDigit } { begin line_prag1 }
|
335
|
335
|
|
336
|
|
- ^\#.*\n / { ifExtensionGhcCppNotComment } { cppSkip }
|
|
336
|
+ ^\ *\# \ * $idchar+ .*\n / { ifExtensionGhcCppNotComment } { cppSkip }
|
|
337
|
+
|
|
338
|
+ ^\# pragma .* \n / { ifExtensionGhcCppNotComment } { cppSkip } -- GCC 3.3 CPP generated, apparently
|
|
339
|
+ ^\# \! .* \n / { ifExtensionGhcCppNotComment } { cppSkip } -- #!, for scripts -- gcc
|
|
340
|
+ ^\ \# \! .* \n / { ifExtensionGhcCppNotComment } { cppSkip } -- #!, for scripts -- clang; See #6132
|
337
|
341
|
|
338
|
342
|
^\# pragma .* \n ; -- GCC 3.3 CPP generated, apparently
|
339
|
343
|
^\# \! .* \n ; -- #!, for scripts -- gcc
|
340
|
344
|
^\ \# \! .* \n ; -- #!, for scripts -- clang; See #6132
|
|
345
|
+
|
341
|
346
|
() { do_bol }
|
342
|
347
|
}
|
343
|
348
|
|
... |
... |
@@ -1771,8 +1776,9 @@ linePrag span buf len buf2 = do |
1771
|
1776
|
usePosPrags <- getBit UsePosPragsBit
|
1772
|
1777
|
if usePosPrags
|
1773
|
1778
|
then begin line_prag2 span buf len buf2
|
1774
|
|
- else let !src = lexemeToFastString buf len
|
1775
|
|
- in return (L span (ITline_prag (SourceText src)))
|
|
1779
|
+ -- else let !src = lexemeToFastString buf len
|
|
1780
|
+ -- in return (L span (ITline_prag (SourceText src)))
|
|
1781
|
+ else nested_comment span buf len buf2
|
1776
|
1782
|
|
1777
|
1783
|
-- When 'UsePosPragsBit' is not set, it is expected that we emit a token instead
|
1778
|
1784
|
-- of updating the position in 'PState'
|
... |
... |
@@ -3736,6 +3742,7 @@ lexToken = do |
3736
|
3742
|
let span = mkPsSpan loc1 end
|
3737
|
3743
|
let bytes = byteDiff buf buf2
|
3738
|
3744
|
span `seq` setLastToken buf span bytes
|
|
3745
|
+ -- function t is `Action p`
|
3739
|
3746
|
lt <- t span buf bytes buf2
|
3740
|
3747
|
let lt' = unLoc lt
|
3741
|
3748
|
if (isComment lt') then setLastComment lt else setLastTk lt
|