preprocessor

package
v0.8.7 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2019 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRealApplicationDir added in v0.6.0

func GetRealApplicationDir(dir string) (string, error)

GetRealApplicationDir return application dir path

func GetRealContractsNames added in v0.3.0

func GetRealContractsNames() ([]string, error)

GetRealContractsNames returns names of all real smart contracts

Types

type ParsedFile

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

ParsedFile struct with prepared info we extract from source code

func ParseFile

func ParseFile(fileName string) (*ParsedFile, error)

ParseFile parses a file as Go source code of a smart contract and returns it as `ParsedFile`

func (*ParsedFile) ChangePackageToMain added in v0.4.0

func (pf *ParsedFile) ChangePackageToMain()

ChangePackageToMain changes package of the parsed code to "main"

func (*ParsedFile) ContractName added in v0.4.0

func (pf *ParsedFile) ContractName() string

ContractName returns name of the contract

func (*ParsedFile) ProxyPackageName added in v0.4.0

func (pf *ParsedFile) ProxyPackageName() (string, error)

ProxyPackageName guesses user friendly contract "name" from file name and/or package in the file

func (*ParsedFile) Write added in v0.4.0

func (pf *ParsedFile) Write(out io.Writer) error

Write prints `out` contract's code, it could be changed with a few methods

func (*ParsedFile) WriteProxy added in v0.4.0

func (pf *ParsedFile) WriteProxy(classReference string, out io.Writer) error

WriteProxy generates and writes into `out` source code of contract's proxy

func (*ParsedFile) WriteWrapper added in v0.4.0

func (pf *ParsedFile) WriteWrapper(out io.Writer) error

WriteWrapper generates and writes into `out` source code of wrapper for the contract

Jump to

Keyboard shortcuts

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