diff options
author | chriseth <c@ethdev.com> | 2015-12-08 04:16:25 +0800 |
---|---|---|
committer | chriseth <c@ethdev.com> | 2015-12-08 05:35:51 +0800 |
commit | 64fa9ca478b95970825e3b783275ee66cf848358 (patch) | |
tree | 0e968e61d604d86197151a69ad38d0d2b07daa80 /docs/layout-of-source-files.rst | |
parent | ba8bc4565aa0e5c41be107a7bbae3b51c74679c6 (diff) | |
download | dexon-solidity-64fa9ca478b95970825e3b783275ee66cf848358.tar.gz dexon-solidity-64fa9ca478b95970825e3b783275ee66cf848358.tar.zst dexon-solidity-64fa9ca478b95970825e3b783275ee66cf848358.zip |
Imported documentation.
Diffstat (limited to 'docs/layout-of-source-files.rst')
-rw-r--r-- | docs/layout-of-source-files.rst | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/docs/layout-of-source-files.rst b/docs/layout-of-source-files.rst new file mode 100644 index 00000000..445162f5 --- /dev/null +++ b/docs/layout-of-source-files.rst @@ -0,0 +1,44 @@ +******************************** +Layout of a Solidity Source File +******************************** + +Source files can contain an arbitrary number of contract definitions and include directives. + +.. index:: source file, ! import + +Importing other Source Files +============================ + + +Other source files can be referenced using `import "filename";` and the symbols +defined there will also be available in the current source file. + +.. warning:: + + Import will not work automatically for the commandline-compiler. + Furthermore, this system of importing other files is not completely fleshed out + yet, so please expect changes. + +The `browser-based compiler <https://chriseth.github.io/browser-solidity>`_ +has quite advanced support for multiple files and can even import files +directly from github, by using e.g. +```import "github.com/ethereum/dapp-bin/library/iterable_mapping.sol";``` + +If you want to use multiple source files with the (commandline compiler)[../commandline-compiler/] solc, +you have to specify all files you will use as arguments to solc, +the compiler will not yet search your filesystem on its own. + +.. index:: ! comment, natspec + +Comments +======== + +Single-line comments (`//`) and multi-line comments (`/*...*/`) are possible. + +There are special types of comments called natspec comments +(documentation yet to be written). These are introduced by +triple-slash comments (`///`) or using double asterisks (`/** ... */`). +Right in front of function declarations or statements, +you can use doxygen-style tags inside them to document functions, annotate conditions for formal +verification and provide a **confirmation text** that is shown to users if they want to +invoke a function. |