Documentation
¶
Overview ¶
Package asm implements the Good Ethereum Assembler (geas).
For a description of the geas language, see the README.md file in the project root.
Index ¶
- func IsWarning(err error) bool
- type Compiler
- func (c *Compiler) ClearGlobals()
- func (c *Compiler) CompileFile(filename string) []byte
- func (c *Compiler) CompileString(input string) []byte
- func (c *Compiler) Errors() []error
- func (c *Compiler) ErrorsAndWarnings() []error
- func (c *Compiler) Failed() bool
- func (c *Compiler) SetDebugLexer(on bool)
- func (c *Compiler) SetDefaultFork(f string)
- func (c *Compiler) SetFilesystem(fsys fs.FS)
- func (c *Compiler) SetGlobal(name string, value *big.Int)
- func (c *Compiler) SetIncludeDepthLimit(limit int)
- func (c *Compiler) SetMaxErrors(limit int)
- func (c *Compiler) Warnings() []error
- type PositionError
- type Warning
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Compiler ¶
type Compiler struct {
// contains filtered or unexported fields
}
Compiler turns assembly source into bytecode.
func New ¶ added in v0.2.1
New creates a compiler. The file system is used to resolve import file names. If a nil FS is given, #import cannot be used.
func NewCompiler ¶
NewCompiler creates a compiler. Deprecated: use New.
func (*Compiler) ClearGlobals ¶ added in v0.2.2
func (c *Compiler) ClearGlobals()
ClearGlobals removes all definitions created by SetGlobal.
func (*Compiler) CompileFile ¶
CompileString compiles the given program text and returns the corresponding bytecode. If compilation fails, the returned slice is nil. Use the Errors method to get parsing/compilation errors.
func (*Compiler) CompileString ¶
CompileString compiles the given program text and returns the corresponding bytecode. If compilation fails, the returned slice is nil. Use the Errors method to get parsing/compilation errors.
func (*Compiler) ErrorsAndWarnings ¶ added in v0.2.0
ErrorsAndWarnings returns all errors and warnings which have accumulated during compilation.
func (*Compiler) SetDebugLexer ¶
SetDebugLexer enables/disables printing of the token stream to stdout.
func (*Compiler) SetDefaultFork ¶ added in v0.2.0
SetDefaultFork sets the EVM instruction set used by default.
func (*Compiler) SetFilesystem ¶ added in v0.2.1
SetFilesystem sets the file system used for resolving #include files. Note: if set to a nil FS, #include is not allowed.
func (*Compiler) SetGlobal ¶ added in v0.2.2
SetGlobal sets the value of a global expression macro. Note the name must start with an uppercase letter to make it global.
func (*Compiler) SetIncludeDepthLimit ¶
SetDebugLexer enables/disables printing of the token stream to stdout.
func (*Compiler) SetMaxErrors ¶
SetMaxErrors sets the limit on the number of errors that can happen before the compiler gives up.
type PositionError ¶
PositionError is an error containing a file position.