spec

package
v0.6.18 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2022 License: MPL-2.0 Imports: 0 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block []Statement

Block is the AST representation of a block of statements.

type Command

type Command struct {
	Name           string          `json:"name"`
	Args           []string        `json:"args"`
	ExecMode       bool            `json:"execMode,omitempty"`
	SourceLocation *SourceLocation `json:"sourceLocation,omitempty"`
}

Command is the AST representation of an Earthfile command.

type Earthfile

type Earthfile struct {
	Version        *Version        `json:"version,omitempty"`
	BaseRecipe     Block           `json:"baseRecipe"`
	Targets        []Target        `json:"targets,omitempty"`
	UserCommands   []UserCommand   `json:"userCommands,omitempty"`
	SourceLocation *SourceLocation `json:"sourceLocation,omitempty"`
}

Earthfile is the AST representation of an Earthfile.

type ElseIf

type ElseIf struct {
	Expression     []string        `json:"expression"`
	ExecMode       bool            `json:"execMode,omitempty"`
	Body           Block           `json:"body"`
	SourceLocation *SourceLocation `json:"sourceLocation,omitempty"`
}

ElseIf is the AST representation of an else if clause.

type ForStatement

type ForStatement struct {
	Args           []string        `json:"args"`
	Body           Block           `json:"body"`
	SourceLocation *SourceLocation `json:"sourceLocation,omitempty"`
}

ForStatement is the AST representation of a for statement.

type IfStatement

type IfStatement struct {
	Expression     []string        `json:"expression"`
	ExecMode       bool            `json:"execMode,omitempty"`
	IfBody         Block           `json:"ifBody"`
	ElseIf         []ElseIf        `json:"elseIf,omitempty"`
	ElseBody       *Block          `json:"elseBody,omitempty"`
	SourceLocation *SourceLocation `json:"sourceLocation,omitempty"`
}

IfStatement is the AST representation of an if statement.

type SourceLocation

type SourceLocation struct {
	File        string `json:"file,omitempty"`
	StartLine   int    `json:"startLine"`
	StartColumn int    `json:"startColumn"`
	EndLine     int    `json:"endLine"`
	EndColumn   int    `json:"endColumn"`
}

SourceLocation is an optional reference to the original source code location.

type Statement

type Statement struct {
	Command        *Command        `json:"command,omitempty"`
	With           *WithStatement  `json:"with,omitempty"`
	If             *IfStatement    `json:"if,omitempty"`
	For            *ForStatement   `json:"for,omitempty"`
	Wait           *WaitStatement  `json:"wait,omitempty"`
	SourceLocation *SourceLocation `json:"sourceLocation,omitempty"`
}

Statement is the AST representation of an Earthfile statement. Only one field may be filled at one time.

type Target

type Target struct {
	Name           string          `json:"name"`
	Recipe         Block           `json:"recipe"`
	SourceLocation *SourceLocation `json:"sourceLocation,omitempty"`
}

Target is the AST representation of an Earthfile target.

type UserCommand

type UserCommand struct {
	Name           string          `json:"name"`
	Recipe         Block           `json:"recipe"`
	SourceLocation *SourceLocation `json:"sourceLocation,omitempty"`
}

UserCommand is the AST representation of an Earthfile user command definition.

type Version

type Version struct {
	Args           []string        `json:"args"`
	SourceLocation *SourceLocation `json:"sourceLocation,omitempty"`
}

Version is the AST representation of an Earthfile version definition.

type WaitStatement

type WaitStatement struct {
	Args           []string        `json:"args"`
	Body           Block           `json:"body"`
	SourceLocation *SourceLocation `json:"sourceLocation,omitempty"`
}

WaitStatement is the AST representation of a for statement.

type WithStatement

type WithStatement struct {
	Command        Command         `json:"command"`
	Body           Block           `json:"body"`
	SourceLocation *SourceLocation `json:"sourceLocation,omitempty"`
}

WithStatement is the AST representation of a with statement.

Jump to

Keyboard shortcuts

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