compiler

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package compiler

Index

Constants

View Source
const (
	LogFieldSourceCodeLen    = "sourceCodeLen"
	LogFieldInsertPosition   = "insertPosition"
	LogFieldCode             = "code"
	LogFieldLength           = "length"
	LogFieldSourceCodeLoaded = "sourceCodeLoaded"
)

Variables

This section is empty.

Functions

func IsBashFrameworkFunction

func IsBashFrameworkFunction(line []byte) bool

func IsCommentLine

func IsCommentLine(line []byte) bool

func IsFunctionDirective

func IsFunctionDirective(line []byte) bool

Types

type AnnotationProcessorInterface

type AnnotationProcessorInterface interface {
	GetTitle() string
	Init(compileContextData *CompileContextData) error
	Reset()
	ParseFunction(compileContextData *CompileContextData, functionStruct *functionInfoStruct) error
	Process(compileContextData *CompileContextData) error
	PostProcess(compileContextData *CompileContextData, code string) (newCode string, err error)
}

func NewEmbedAnnotationProcessor

func NewEmbedAnnotationProcessor() AnnotationProcessorInterface

func NewRequireAnnotationProcessor

func NewRequireAnnotationProcessor() AnnotationProcessorInterface

type CompileContext

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

func NewCompiler

func NewCompiler(
	templateContext render.TemplateContextInterface,
	annotationProcessors []AnnotationProcessorInterface,
) CompileContext

Compile generates code from given model

func (CompileContext) Compile

func (context CompileContext) Compile(
	compileContextData *CompileContextData, code string,
) (codeCompiled string, err error)

func (CompileContext) Init

func (context CompileContext) Init(
	templateContextData *render.TemplateContextData,
	config *model.CompilerConfig,
) (*CompileContextData, error)

type CompileContextData

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

func (CompileContextData) Validate

func (context CompileContextData) Validate() error

type InsertPosition

type InsertPosition int8
const (
	InsertPositionFirst  InsertPosition = 0
	InsertPositionMiddle InsertPosition = 1
	InsertPositionLast   InsertPosition = 2
)

Jump to

Keyboard shortcuts

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