From 3cec3f13e5e88e8c94ca738f539a6a96c86f2a0b Mon Sep 17 00:00:00 2001 From: chriseth Date: Tue, 25 Sep 2018 20:03:53 +0200 Subject: [PATCH] [DOCS] Some more explanation about pragmas. --- docs/layout-of-source-files.rst | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docs/layout-of-source-files.rst b/docs/layout-of-source-files.rst index 11f85aaca..727c92e28 100644 --- a/docs/layout-of-source-files.rst +++ b/docs/layout-of-source-files.rst @@ -13,6 +13,12 @@ and :ref:`pragma directives`. Pragmas ======= +The ``pragma`` keyword can be used to enable certain compiler features +or checks. A pragma directive is always local to a source file, so +you have to add the pragma to all your files if you want enable it +in all of your project. If you :ref:`import` another file, the pragma +from that file will not automatically apply to the importing file. + .. index:: ! pragma, version .. _version_pragma: @@ -43,6 +49,13 @@ the exact version of the compiler, so that bugfix releases are still possible. It is possible to specify much more complex rules for the compiler version, the expression follows those used by `npm `_. +.. note:: + Using the version pragma will *not* change the version of the compiler. + It will also *not* enable or disable features of the compiler. It will just + instruct the compiler to check whether its version matches the one + required by the pragma. If it does not match, the compiler will issue + an error. + .. index:: ! pragma, experimental .. _experimental_pragma: