Crate sway_core[−][src]
Re-exports
pub use crate::parse_tree::*;
pub use crate::parse_tree::Declaration;
pub use error::CompileError;
pub use error::CompileResult;
pub use error::CompileWarning;
pub use semantic_analysis::TypedDeclaration;
Modules
Configurable yet nonchanging constants for the compiler.
Tools related to handling/recovering from Sway compile errors and reporting them to the user.
Contains all the code related to parsing Sway source code.
Type checking for Sway.
Contains post-type-engine resolved types.
Structs
An AbstractInstructionSet is a set of instructions that use entirely virtual registers and excessive moves, with the intention of later optimizing it.
Configuration for the overall build and compilation process.
Represents a parsed, but not yet type-checked, Sway program. A Sway program can be either a contract, script, predicate, or it can be a library to be imported into one of the aforementioned program types.
Represents some exportable information that results from compiling some Sway source code.
Enums
Represents the various structures that constitute a Sway program.
Represents the result of compiling Sway code via compile_to_bytecode
.
Contains the compiled bytecode in byte form, or, resulting errors, and any warnings generated.
Represents the result of compiling Sway code via compile_to_asm
.
Contains the compiled assets or resulting errors, and any warnings generated.
Represents an ASM set which has had register allocation, jump elimination, and optimization applied to it
The HllAsmSet contains either a contract ABI and corresponding ASM, a script’s main function’s ASM, or a predicate’s main function’s ASM. ASM is never generated for libraries, as that happens when the library itself is imported.
Type information without an associated value, used for type inferencing and definition.
Functions
Given input Sway source code, compile to a CompilationResult which contains the asm in opcode form (not raw bytes/bytecode).
Given input Sway source code, compile to a BytecodeCompilationResult which contains the asm in bytecode form.
If a given Rule exists in the input text, return
that string trimmed. Otherwise, return None
. This is typically used to find keywords.
Given an input str
and an optional BuildConfig, parse the input into a HllParseTree.