aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Beregszaszi <alex@rtfs.hu>2017-02-03 05:10:19 +0800
committerAlex Beregszaszi <alex@rtfs.hu>2017-02-09 07:41:47 +0800
commit21a022848540dc488b312f94b62d62fce66aafc7 (patch)
treedd576053112399af55dd6db3ba4dade0d4c33124
parentd46ec20f88feac1326381e5ac67a02086c5f4516 (diff)
downloaddexon-solidity-21a022848540dc488b312f94b62d62fce66aafc7.tar.gz
dexon-solidity-21a022848540dc488b312f94b62d62fce66aafc7.tar.zst
dexon-solidity-21a022848540dc488b312f94b62d62fce66aafc7.zip
Include pseudo-code of compiler API
-rw-r--r--docs/using-the-compiler.rst14
1 files changed, 13 insertions, 1 deletions
diff --git a/docs/using-the-compiler.rst b/docs/using-the-compiler.rst
index b89af912..703a1c57 100644
--- a/docs/using-the-compiler.rst
+++ b/docs/using-the-compiler.rst
@@ -42,7 +42,18 @@ Using the Compiler API
The compiler API expects a JSON formatted input and outputs the compilations result in a JSON formatted output.
-TBD
+See the following pseudo-code:
+
+.. code-block:: none
+
+ // defined by the consumer of the API
+ importCallback(url:string) -> content:string
+
+ // invoking the compiler
+ solc.compile(inputJSON:string, importCallback:function) -> outputJSON:string
+
+The compiler will ask the ``importCallback`` for each URL defined for a source file and will stop when it succeeds.
+If all URLs failed, the compilation results in a failure.
Compiler Input and Output JSON Description
******************************************
@@ -66,6 +77,7 @@ Input Description
"myFile.sol":
{
// Optional: keccak256 hash of the source file
+ // It is used to verify the retrieved content if imported via URLs.
"keccak256": "0x123...",
// Required (unless "content" is used, see below): URL(s) to the source file.
// URL(s) should be imported in this order and the result checked against the