[Git][ghc/ghc][master] Fix #22300 Document GHC's extensions to valid whitespace

Marge Bot (@marge-bot) gitlab at gitlab.haskell.org
Fri Dec 9 14:43:13 UTC 2022



Marge Bot pushed to branch master at Glasgow Haskell Compiler / GHC


Commits:
1023b432 by Mike Pilgrem at 2022-12-09T09:42:56-05:00
Fix #22300 Document GHC's extensions to valid whitespace

- - - - -


2 changed files:

- docs/users_guide/exts/misc.rst
- + docs/users_guide/exts/whitespace.rst


Changes:

=====================================
docs/users_guide/exts/misc.rst
=====================================
@@ -9,3 +9,4 @@ Miscellaneous
     generics
     assert
     callstack
+    whitespace


=====================================
docs/users_guide/exts/whitespace.rst
=====================================
@@ -0,0 +1,29 @@
+.. _whitespace:
+
+Whitespace
+==========
+
+.. index::
+   single: Whitespace
+
+As in the Haskell Language Report, Haskell comments are valid whitespace. In
+addition, lines (which must end with a line feed character) that begin as
+follows are valid whitespace in source code, except immediately after a
+``where``, ``let``, ``do`` or ``of`` keyword:
+
+-  ``#!``. This accommodates 'shebang' interpreter directives in scripts on
+   Unix-like operating systems.
+
+-  ``<space>#!``, where ``<space>`` is an initial space character before the
+   'shebang'.
+
+-  ``#pragma``. This accommodates the use of a directive that passes additional
+   information to a compiler.
+
+-  ``#line <line> "<file>"``, where ``<line>`` is a positive integer and
+   ``<file>`` can comprise zero or more characters. This accommodates a compiler
+   directive that resets the numbering of lines of source code, and the
+   identification of the source code file name, in compiler messages.
+
+-  ``#<line> "<file>"``, where ``<line>`` is a positive integer and ``<file>``
+   can comprise zero or more characters.



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1023b432d0befd9675dcfcfb44c548b06b2fae8c

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1023b432d0befd9675dcfcfb44c548b06b2fae8c
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20221209/39b01cc0/attachment-0001.html>


More information about the ghc-commits mailing list