aboutsummaryrefslogtreecommitdiffstats
path: root/docs/layout-of-source-files.rst
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-09-26 02:03:53 +0800
committerchriseth <chris@ethereum.org>2018-09-26 02:04:10 +0800
commit3cec3f13e5e88e8c94ca738f539a6a96c86f2a0b (patch)
tree7d0c153cb88789b6e1f5889ae17f07c111e8df1d /docs/layout-of-source-files.rst
parentb08d49338e2472ea579cbf8fcfb06a31bf517c1e (diff)
downloaddexon-solidity-3cec3f13e5e88e8c94ca738f539a6a96c86f2a0b.tar
dexon-solidity-3cec3f13e5e88e8c94ca738f539a6a96c86f2a0b.tar.gz
dexon-solidity-3cec3f13e5e88e8c94ca738f539a6a96c86f2a0b.tar.bz2
dexon-solidity-3cec3f13e5e88e8c94ca738f539a6a96c86f2a0b.tar.lz
dexon-solidity-3cec3f13e5e88e8c94ca738f539a6a96c86f2a0b.tar.xz
dexon-solidity-3cec3f13e5e88e8c94ca738f539a6a96c86f2a0b.tar.zst
dexon-solidity-3cec3f13e5e88e8c94ca738f539a6a96c86f2a0b.zip
[DOCS] Some more explanation about pragmas.
Diffstat (limited to 'docs/layout-of-source-files.rst')
-rw-r--r--docs/layout-of-source-files.rst13
1 files changed, 13 insertions, 0 deletions
diff --git a/docs/layout-of-source-files.rst b/docs/layout-of-source-files.rst
index 11f85aac..727c92e2 100644
--- a/docs/layout-of-source-files.rst
+++ b/docs/layout-of-source-files.rst
@@ -13,6 +13,12 @@ and :ref:`pragma directives<pragma>`.
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<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 <https://docs.npmjs.com/misc/semver>`_.
+.. 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: