asm

package
v0.0.0-...-2d23280 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 16, 2024 License: LGPL-3.0 Imports: 20 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Compiler

type Compiler struct {
	// contains filtered or unexported fields
}

Compiler performs the assembling.

func NewCompiler

func NewCompiler(fsys fs.FS) *Compiler

NewCompiler creates a compiler. The passed file system is used to resolve import file names.

func (*Compiler) CompileFile

func (c *Compiler) CompileFile(filename string) []byte

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

func (c *Compiler) CompileString(input string) []byte

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) Errors

func (c *Compiler) Errors() []error

Errors returns errors that have accumulated during compilation.

func (*Compiler) SetDebugLexer

func (c *Compiler) SetDebugLexer(on bool)

SetDebugLexer enables/disables printing of the token stream to stdout.

func (*Compiler) SetIncludeDepthLimit

func (c *Compiler) SetIncludeDepthLimit(limit int)

SetDebugLexer enables/disables printing of the token stream to stdout.

func (*Compiler) SetMaxErrors

func (c *Compiler) SetMaxErrors(limit int)

SetMaxErrors sets the limit on the number of errors that can happen before the compiler gives up.

func (*Compiler) SetUsePush0

func (c *Compiler) SetUsePush0(on bool)

SetUsePush0 enables/disables use of the PUSH0 instruction. It's on by default.

type Position

type Position struct {
	File string
	Line int
}

Position represents the position of an error in a file.

func (Position) String

func (p Position) String() string

type PositionError

type PositionError interface {
	error
	Position() Position
}

PositionError is an error containing a file position.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL