sophia/docs/aeso_compiler.md
Radosław Rowicki 0af45dfd19
Deprecate AEVM (#375)
* Deprecate AEVM

* Fix test, changelog

* Restore old rebar

* rebar lock fix

* undo export

Co-authored-by: Gaith Hallak <gaithhallak@gmail.com>

* undo export

Co-authored-by: Gaith Hallak <gaithhallak@gmail.com>

* Solve GH suggestions

* Fix the docs

* update docs

* Remove unused tests

* undo weird change

Co-authored-by: Gaith Hallak <gaithhallak@gmail.com>
2022-05-10 15:33:59 +02:00

1.5 KiB

aeso_compiler

Module

aeso_compiler

The Sophia compiler

Description

This module provides the interface to the standard Sophia compiler. It returns the compiled module in a map which can then be loaded.

Types

contract_string() = string() | binary()
contract_map() = #{bytecode => binary(),
                   compiler_version => binary(),
                   contract_souce => string(),
                   type_info => type_info()}
type_info()
errorstring() = binary()

Exports

file(File)

file(File, Options) -> CompRet

from_string(ContractString, Options) -> CompRet

Types

ContractString = contract_string()
Options = [Option]
CompRet = {ok,ContractMap} | {error,ErrorString}
ContractMap = contract_map()
ErrorString = errorstring()

Compile a contract defined in a file or in a string.

The pp_ options all print to standard output the following:

pp_sophia_code - print the input Sophia code.

pp_ast - print the AST of the code

pp_types - print information about the types

pp_typed_ast - print the AST with type information at each node

pp_assembler - print the generated assembler code

check_call(ContractString, Options) -> CheckRet

Types

ContractString = string() | binary()
CheckRet = {ok,string(),{Types,Type | any()},Terms} | {error,Term}
Types = [Type]
Type = term()

Check a call in contract through the __call function.

version() -> {ok, Version} | {error, term()}

Types

Version = binary()

Get the current version of the Sophia compiler.