preprocessor

package
v0.0.0-...-169fbab Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Preprocess

func Preprocess(filename string, sources *[]string, arguments *[]string) string

func ReadFile

func ReadFile(filename string, errorLocation print.TextSpan) []rune

ReadFile reads the file and returns a byte array ([]byte) // nah fam we usin runes only handles NotExist and Permission error btw

Types

type PreProcStatement

type PreProcStatement struct {
	Keyword string
	Content string
	Span    print.TextSpan
}

type Preprocessor

type Preprocessor struct {
	Code       string
	Filename   string
	Index      int
	Tokens     []lexer.Token
	Statements []PreProcStatement

	// has any statement in here changed this files code?
	ChangedFile bool

	// reference to the source file list
	Sources *[]string

	// reference to the list of arguments
	Args *[]string
}

func (*Preprocessor) PreprocessString

func (ppc *Preprocessor) PreprocessString()

func (*Preprocessor) ProcessArgStatement

func (ppc *Preprocessor) ProcessArgStatement(stmt PreProcStatement)

func (*Preprocessor) ProcessAttachStatement

func (ppc *Preprocessor) ProcessAttachStatement(stmt PreProcStatement)

func (*Preprocessor) ProcessSourceStatement

func (ppc *Preprocessor) ProcessSourceStatement(stmt PreProcStatement)

func (*Preprocessor) ProcessStatement

func (ppc *Preprocessor) ProcessStatement(stmt PreProcStatement)

func (*Preprocessor) ReplaceSpan

func (ppc *Preprocessor) ReplaceSpan(text string, span print.TextSpan)

Jump to

Keyboard shortcuts

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