lsl

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2025 License: MIT Imports: 8 Imported by: 2

Documentation

Overview

Package lsl provides a simple interface to the Lacking Shader Language.

Index

Constants

View Source
const (
	// TypeNameBool is the name of the boolean type.
	TypeNameBool = "bool"

	// TypeNameInt is the name of the signed 32bit integer type.
	TypeNameInt = "int"

	// TypeNameUint is the name of the unsigned 32bit integer type.
	TypeNameUint = "uint"

	// TypeNameFloat is the name of the 32bit floating point type.
	TypeNameFloat = "float"

	// TypeNameVec2 is the name of the 32bit floating point 2D vector type.
	TypeNameVec2 = "vec2"

	// TypeNameVec3 is the name of the 32bit floating point 3D vector type.
	TypeNameVec3 = "vec3"

	// TypeNameVec4 is the name of the 32bit floating point 4D vector type.
	TypeNameVec4 = "vec4"

	// TypeNameBVec2 is the name of the boolean 2D vector type.
	TypeNameBVec2 = "bvec2"

	// TypeNameBVec3 is the name of the boolean 3D vector type.
	TypeNameBVec3 = "bvec3"

	// TypeNameBVec4 is the name of the boolean 4D vector type.
	TypeNameBVec4 = "bvec4"

	// TypeNameIVec2 is the name of the signed 32bit integer 2D vector type.
	TypeNameIVec2 = "ivec2"

	// TypeNameIVec3 is the name of the signed 32bit integer 3D vector type.
	TypeNameIVec3 = "ivec3"

	// TypeNameIVec4 is the name of the signed 32bit integer 4D vector type.
	TypeNameIVec4 = "ivec4"

	// TypeNameUVec2 is the name of the unsigned 32bit integer 2D vector type.
	TypeNameUVec2 = "uvec2"

	// TypeNameUVec3 is the name of the unsigned 32bit integer 3D vector type.
	TypeNameUVec3 = "uvec3"

	// TypeNameUVec4 is the name of the unsigned 32bit integer 4D vector type.
	TypeNameUVec4 = "uvec4"

	// TypeNameMat2 is the name of the 2x2 matrix type.
	TypeNameMat2 = "mat2"

	// TypeNameMat3 is the name of the 3x3 matrix type.
	TypeNameMat3 = "mat3"

	// TypeNameMat4 is the name of the 4x4 matrix type.
	TypeNameMat4 = "mat4"

	// TypeNameSampler2D is the name of the 2D sampler type.
	TypeNameSampler2D = "sampler2D"

	// TypeNameSamplerCube is the name of the cube sampler type.
	TypeNameSamplerCube = "samplerCube"
)
View Source
const (
	// BlockStart is the character that starts a block of code.
	BlockStart = "{"

	// BlockEnd is the character that ends a block of code.
	BlockEnd = "}"
)
View Source
const (
	// GroupStart is the character that starts an expression group or a parameter
	// list.
	GroupStart = "("

	// GroupEnd is the character that ends an expression group or a parameter
	// list.
	GroupEnd = ")"
)
View Source
const (
	// KeywordDiscard is the keyword "discard". It is used to stop the execution
	// of a fragment shader.
	KeywordDiscard = "discard"

	// KeywordTexture is the keyword "texture". It is used to declare a block of
	// textures in a shader.
	KeywordTexture = "texture"

	// KeywordUniform is the keyword "uniform". It is used to declare a block of
	// uniforms in a shader.
	KeywordUniform = "uniform"

	// KeywordVarying is the keyword "varying". It is used to declare a block of
	// variables in a shader that can cross from the vertex shader stage to the
	// fragment shader stage.
	KeywordVarying = "varying"

	// KeywordTrue is the keyword "true". It is used to represent the boolean
	// literal true.
	KeywordTrue = "true"

	// KeywordFalse is the keyword "false". It is used to represent the boolean
	// literal false.
	KeywordFalse = "false"

	// KeywordType is the keyword "type". It is used to declare a new type.
	KeywordType = "type"

	// KeywordStruct is the keyword "struct". It is used to declare a new struct
	// type.
	KeywordStruct = "struct"

	// KeywordFunc is the keyword "func". It is used to declare a new function.
	KeywordFunc = "func"

	// KeywordVar is the keyword "var". It is used to declare a variable.
	KeywordVar = "var"

	// KeywordIf is the keyword "if". It is used to start a conditional statement.
	KeywordIf = "if"

	// KeywordElse is the keyword "else". It is used to start an alternative
	// branch of a conditional statement.
	KeywordElse = "else"

	// KeywordReturn is the keyword "return". It is used to return a value from a
	// function.
	KeywordReturn = "return"
)
View Source
const (
	// AssignmentOperatorEq is the assignment operator "=". It assigns the
	// value to the variable.
	AssignmentOperatorEq = "="

	// AssignmentOperatorAuto is the assignment operator ":=", where the type
	// of the variable is inferred from the value.
	AssignmentOperatorAuto = ":="

	// AssignmentOperatorAdd is the assignment operator "+=". It adds the value
	// to the variable.
	AssignmentOperatorAdd = "+="

	// AssignmentOperatorSub is the assignment operator "-=". It subtracts the
	// value from the variable.
	AssignmentOperatorSub = "-="

	// AssignmentOperatorMul is the assignment operator "*=". It multiplies the
	// variable by the value.
	AssignmentOperatorMul = "*="

	// AssignmentOperatorDiv is the assignment operator "/=". It divides the
	// variable by the value.
	AssignmentOperatorDiv = "/="

	// AssignmentOperatorMod is the assignment operator "%=". It takes the
	// modulo of the variable and the value.
	AssignmentOperatorMod = "%="

	// AssignmentOperatorShl is the assignment operator "<<=". It shifts the
	// variable to the left by the value.
	AssignmentOperatorShl = "<<="

	// AssignmentOperatorShr is the assignment operator ">>=". It shifts the
	// variable to the right by the value.
	AssignmentOperatorShr = ">>="

	// AssignmentOperatorAnd is the assignment operator "&=". It performs a
	// bitwise AND operation on the variable and the value.
	AssignmentOperatorAnd = "&="

	// AssignmentOperatorOr is the assignment operator "|=". It performs a
	// bitwise OR operation on the variable and the value.
	AssignmentOperatorOr = "|="

	// AssignmentOperatorXor is the assignment operator "^=". It performs a
	// bitwise XOR operation on the variable and the value.
	AssignmentOperatorXor = "^="
)
View Source
const (
	// UnaryOperatorNot is the unary operator "!". It inverts the value.
	UnaryOperatorNot = "!"

	// UnaryOperatorNeg is the unary operator "-". It negates the value.
	UnaryOperatorNeg = "-"

	// UnaryOperatorPos is the unary operator "+". It is a no-op.
	UnaryOperatorPos = "+"

	// UnaryOperatorBitNot is the unary operator "^". It performs a bitwise
	// NOT operation on the value.
	UnaryOperatorBitNot = "^"
)
View Source
const (
	// BinaryOperatorAdd is the binary operator "+". It adds two values.
	BinaryOperatorAdd = "+"

	// BinaryOperatorSub is the binary operator "-". It subtracts two values.
	BinaryOperatorSub = "-"

	// BinaryOperatorMul is the binary operator "*". It multiplies two values.
	BinaryOperatorMul = "*"

	// BinaryOperatorDiv is the binary operator "/". It divides two values.
	BinaryOperatorDiv = "/"

	// BinaryOperatorMod is the binary operator "%". It takes the modulo of two
	// values.
	BinaryOperatorMod = "%"

	// BinaryOperatorShl is the binary operator "<<". It shifts the first value
	// to the left by the second value.
	BinaryOperatorShl = "<<"

	// BinaryOperatorShr is the binary operator ">>". It shifts the first value
	// to the right by the second value.
	BinaryOperatorShr = ">>"

	// BinaryOperatorEq is the binary operator "==". It checks if two values are
	// equal.
	BinaryOperatorEq = "=="

	// BinaryOperatorNotEq is the binary operator "!=". It checks if two values
	// are not equal.
	BinaryOperatorNotEq = "!="

	// BinaryOperatorLess is the binary operator "<". It checks if the first
	// value is less than the second value.
	BinaryOperatorLess = "<"

	// BinaryOperatorGreater is the binary operator ">". It checks if the first
	// value is greater than the second value.
	BinaryOperatorGreater = ">"

	// BinaryOperatorLessEq is the binary operator "<=". It checks if the first
	// value is less than or equal to the second value.
	BinaryOperatorLessEq = "<="

	// BinaryOperatorGreaterEq is the binary operator ">=". It checks if the
	// first value is greater than or equal to the second value.
	BinaryOperatorGreaterEq = ">="

	// BinaryOperatorBitAnd is the binary operator "&". It performs a bitwise
	// AND operation on two values.
	BinaryOperatorBitAnd = "&"

	// BinaryOperatorBitOr is the binary operator "|". It performs a bitwise OR
	// operation on two values.
	BinaryOperatorBitOr = "|"

	// BinaryOperatorBitXor is the binary operator "^". It performs a bitwise
	// XOR operation on two values.
	BinaryOperatorBitXor = "^"

	// BinaryOperatorAnd is the binary operator "&&". It performs a logical AND
	// operation on two values.
	BinaryOperatorAnd = "&&"

	// BinaryOperatorOr is the binary operator "||". It performs a logical OR
	// operation on two values.
	BinaryOperatorOr = "||"
)
View Source
const (
	// AccessOperatorDot is the character ".". It is used to access a member of a
	// struct variable.
	AccessOperatorDot = "."
)
View Source
const (
	// SeparatorComma is the character ",". It is used to separate items in a
	// list.
	SeparatorComma = ","
)

Variables

This section is empty.

Functions

func Tokenize added in v0.22.0

func Tokenize(source string) iter.Seq[Token]

Tokenize is a helper function that creates a new iterator that yields tokens from the given source code. Internally it creates a new Tokenizer and uses it to generate tokens.

func Validate

func Validate(shader *Shader, schema Schema) error

Validate validates the provided shader against the provided schema.

Types

type Assignment

type Assignment struct {
	Target     Expression
	Expression Expression
	Operator   string
}

Assignment represents an assignment statement.

func (*Assignment) GetPos added in v0.23.0

func (a *Assignment) GetPos() Position

type BinaryExpression

type BinaryExpression struct {
	Operator string
	Left     Expression
	Right    Expression
}

BinaryExpression represents a binary operation.

func (*BinaryExpression) GetPos added in v0.23.0

func (b *BinaryExpression) GetPos() Position

type BoolLiteral added in v0.23.0

type BoolLiteral struct {
	Pos   Position
	Value bool
}

BoolLiteral represents a boolean literal.

func (*BoolLiteral) GetPos added in v0.23.0

func (b *BoolLiteral) GetPos() Position

type Conditional

type Conditional struct {
	Pos       Position
	Condition Expression
	Then      StatementList
	Else      Statement
}

Conditional represents a conditional statement.

func (*Conditional) GetPos added in v0.23.0

func (c *Conditional) GetPos() Position

type Declaration

type Declaration interface {

	// GetPos returns the position of the declaration in the source code.
	GetPos() Position
	// contains filtered or unexported methods
}

Declaration represents a top-level construct in a shader.

Example:

func hello() {
}

type Discard

type Discard struct {
	Pos Position
}

Discard represents a statement that does nothing.

func (*Discard) GetPos added in v0.23.0

func (d *Discard) GetPos() Position

type Expression

type Expression interface {

	// GetPos returns the position of the expression in the source code.
	GetPos() Position
	// contains filtered or unexported methods
}

Expression represents a sequence of tokens that can be evaluated to a value.

Example:

1 + sin(10)

type Field

type Field struct {
	Pos  Position
	Name string
	Type string
}

Field represents a field in a block or in a parameter list.

type FieldIdentifier

type FieldIdentifier struct {
	Owner Expression
	Field Identifier
}

FieldIdentifier represents a reference to a field of a structure.

func (*FieldIdentifier) GetPos added in v0.23.0

func (f *FieldIdentifier) GetPos() Position

type FloatLiteral

type FloatLiteral struct {
	Pos   Position
	Value float64
}

FloatLiteral represents a floating point literal.

func (*FloatLiteral) GetPos added in v0.23.0

func (f *FloatLiteral) GetPos() Position

type FunctionCall

type FunctionCall struct {
	Owner     Expression
	Arguments []Expression
}

FunctionCall represents a function call.

func (*FunctionCall) GetPos added in v0.23.0

func (f *FunctionCall) GetPos() Position

type FunctionDeclaration

type FunctionDeclaration struct {
	Pos        Position
	Name       string
	Inputs     []Field
	OutputType string
	Body       StatementList
}

FunctionDeclaration represents a function declaration.

func (*FunctionDeclaration) GetPos added in v0.23.0

func (f *FunctionDeclaration) GetPos() Position

type Identifier

type Identifier struct {
	Pos  Position
	Name string
}

Identifier represents a reference to a variable or a function.

func (*Identifier) GetPos added in v0.23.0

func (i *Identifier) GetPos() Position

type IntLiteral

type IntLiteral struct {
	Pos   Position
	Value int64
}

IntLiteral represents an integer literal.

func (*IntLiteral) GetPos added in v0.23.0

func (i *IntLiteral) GetPos() Position

type ParseError added in v0.22.0

type ParseError struct {

	// Pos is the position in the source code where the error occurred.
	Pos Position

	// Message is the error message.
	Message string
}

ParseError is an error that occurs during parsing.

func (*ParseError) Error added in v0.22.0

func (e *ParseError) Error() string

Error returns the error message.

type Parser

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

Parser is responsible for parsing LSL source code into a shader AST object.

func NewParser

func NewParser(source string) *Parser

NewParser creates a new LSL parser for the given source code.

func (*Parser) ParseArgumentBlock added in v0.23.0

func (p *Parser) ParseArgumentBlock() ([]Expression, error)

ParseArgumentBlock parses a block containing argument declarations such as one used in function invocations.

Example:

(10.5, ^66, 2+3)

func (*Parser) ParseExpression

func (p *Parser) ParseExpression() (Expression, error)

ParseExpression uses the Shunting Yard algorithm to parse an expression and return its AST form.

Example:

1 + 2 * 3

func (*Parser) ParseFieldGroup added in v0.23.0

func (p *Parser) ParseFieldGroup(opening, closing string) ([]Field, error)

ParseFieldGroup parses a block containing field declarations such as one used in textures/uniforms/varyings blocks or struct declarations.

Example:

(
	color vec3
)

func (*Parser) ParseFunction

func (p *Parser) ParseFunction() (*FunctionDeclaration, error)

ParseFunction parses a function declaration.

Example:

func myFunction(a int, b float) {
	// function body
}

func (*Parser) ParseShader

func (p *Parser) ParseShader() (*Shader, error)

ParseShader parses the LSL source code and returns a shader AST object. If the source code is invalid, an error is returned.

func (*Parser) ParseStatement

func (p *Parser) ParseStatement() (Statement, error)

ParseStatement parses a single imperative statement from the source code.

func (*Parser) ParseStatementList

func (p *Parser) ParseStatementList() (StatementList, error)

ParseStatementList parses a list of statements from the source code.

func (*Parser) ParseTextureBlock

func (p *Parser) ParseTextureBlock() (*TextureBlockDeclaration, error)

ParseTextureBlock parses a block containing texture fields.

Example:

texture (
	color sampler2D
)

func (*Parser) ParseTypeDeclaration added in v0.23.0

func (p *Parser) ParseTypeDeclaration() (Declaration, error)

ParseTypeDeclaration parses a type declaration.

Example:

type MyType struct {
	color vec3
}

func (*Parser) ParseUniformBlock

func (p *Parser) ParseUniformBlock() (*UniformBlockDeclaration, error)

ParseUniformBlock parses a block containing uniform fields.

Example:

uniform (
	color vec4
)

func (*Parser) ParseVaryingBlock

func (p *Parser) ParseVaryingBlock() (*VaryingBlockDeclaration, error)

ParseVaryingBlock parses a block containing varying fields.

Example:

varying (
	color vec3
)

type Position added in v0.22.0

type Position struct {

	// Line is the line number, starting from 1.
	Line uint32

	// Column is the column number, starting from 1.
	Column uint32
}

Position represents a position of interest in the source code.

func At added in v0.22.0

func At(line, column uint32) Position

At creates a new Position with the given line and column numbers.

func (Position) String added in v0.22.0

func (p Position) String() string

String returns a string representation of the position.

type ResolvedFunctionType added in v0.23.0

type ResolvedFunctionType struct {
	Name  string
	Scope UsageScope
}

type ResolvedType added in v0.23.0

type ResolvedType struct {
	Name     string
	Scope    UsageScope
	ReadOnly bool
	NonCopy  bool
}

func BuiltInResolvedType added in v0.23.0

func BuiltInResolvedType(name string, scope UsageScope) ResolvedType

type Return added in v0.23.0

type Return struct {
	Pos        Position
	Expression Expression
}

Return represents a return statement.

func (*Return) GetPos added in v0.23.0

func (r *Return) GetPos() Position

type Schema

type Schema interface {
	// IsAllowedTextureType returns whether the provided type name is
	// allowed to be used in a texture block.
	IsAllowedTextureType(typeName string) bool

	// IsAllowedUniformType returns whether the provided type name is
	// allowed to be used in a uniform block.
	IsAllowedUniformType(typeName string) bool

	// IsAllowedVaryingType returns whether the provided type name is
	// allowed to be used in a varying block.
	IsAllowedVaryingType(typeName string) bool

	// IsAllowedVariableType returns whether the provided type name is
	// allowed to be used in a variable declaration.
	IsAllowedVariableType(typeName string) bool
}

func DefaultSchema

func DefaultSchema() Schema

DefaultSchema returns the default schema implementation.

func ForwardSchema

func ForwardSchema() Schema

func GeometrySchema

func GeometrySchema() Schema

func PostprocessSchema

func PostprocessSchema() Schema

func ShadowSchema

func ShadowSchema() Schema

func SkySchema

func SkySchema() Schema

type Shader

type Shader struct {
	Declarations []Declaration
}

Shader represents a complete shader program.

func Parse

func Parse(source string) (*Shader, error)

Parse parses the given LSL source code and returns a shader AST object.

func (*Shader) FindFunction

func (s *Shader) FindFunction(name string) (*FunctionDeclaration, bool)

func (*Shader) Functions

func (s *Shader) Functions() []*FunctionDeclaration

func (*Shader) Textures added in v0.23.0

func (s *Shader) Textures() []Field

Textures returns all the fields in all texture blocks.

func (*Shader) Uniforms added in v0.23.0

func (s *Shader) Uniforms() []Field

Uniforms returns all the fields in all uniform blocks.

func (*Shader) Varyings added in v0.23.0

func (s *Shader) Varyings() []Field

Varyings returns all the fields in all varying blocks.

type Statement

type Statement interface {

	// GetPos returns the position of the statement in the source code.
	GetPos() Position
	// contains filtered or unexported methods
}

Statement represents a code line in a function.

Example:

a := 5.0

type StatementList added in v0.23.0

type StatementList []Statement

StatementList represents a list of statements.

func (StatementList) GetPos added in v0.23.0

func (l StatementList) GetPos() Position

type StructTypeDeclaration added in v0.23.0

type StructTypeDeclaration struct {
	Pos    Position
	Name   string
	Fields []Field
}

StructTypeDeclaration represents a structure type declaration.

func (*StructTypeDeclaration) GetPos added in v0.23.0

func (s *StructTypeDeclaration) GetPos() Position

type TextureBlockDeclaration

type TextureBlockDeclaration struct {
	Pos    Position
	Fields []Field
}

TextureBlockDeclaration represents a texture block declaration.

func (*TextureBlockDeclaration) GetPos added in v0.23.0

func (t *TextureBlockDeclaration) GetPos() Position

type Token added in v0.22.0

type Token struct {

	// Type is the type of token.
	Type TokenType

	// Value is the value of the token.
	Value string

	// Pos is the position of the token in the source code.
	Pos Position
}

Token represents a single item of interest in the LSL source code. A Tokenizer will convert a string of LSL source code into a sequence of tokens.

func (Token) IsAssignmentOperator added in v0.22.0

func (t Token) IsAssignmentOperator() bool

IsAssignmentOperator returns true if the token is an assignment operator token.

func (Token) IsBinaryOperator added in v0.22.0

func (t Token) IsBinaryOperator() bool

IsBinaryOperator returns true if the token is a binary operator token.

func (Token) IsComment added in v0.22.0

func (t Token) IsComment() bool

IsComment returns true if the token is a comment token.

func (Token) IsEOF added in v0.22.0

func (t Token) IsEOF() bool

IsEOF returns true if the token is an EOF token.

func (Token) IsError added in v0.22.0

func (t Token) IsError() bool

IsError returns true if the token is an error token.

func (Token) IsIdentifier added in v0.22.0

func (t Token) IsIdentifier() bool

IsIdentifier returns true if the token is an identifier token.

func (Token) IsNewLine added in v0.22.0

func (t Token) IsNewLine() bool

IsNewLine returns true if the token is a new line token.

func (Token) IsNumber added in v0.22.0

func (t Token) IsNumber() bool

IsNumber returns true if the token is a numeric token.

func (Token) IsOperator added in v0.22.0

func (t Token) IsOperator() bool

IsOperator returns true if the token is an operator token.

func (Token) IsSpecificIdentifier added in v0.22.0

func (t Token) IsSpecificIdentifier(value string) bool

IsSpecificIdentifier returns true if the token is an identifier token with the specified value.

func (Token) IsSpecificOperator added in v0.22.0

func (t Token) IsSpecificOperator(value string) bool

IsSpecificOperator returns true if the token is an operator token with the specified value.

func (Token) IsTerminal added in v0.22.0

func (t Token) IsTerminal() bool

IsTerminal returns true if the token is a final token and no subsequent tokens will be returned.

func (Token) IsUnaryOperator added in v0.22.0

func (t Token) IsUnaryOperator() bool

IsUnaryOperator returns true if the token is a unary operator token.

func (Token) String added in v0.22.0

func (t Token) String() string

String returns a string representation of the token.

type TokenType added in v0.22.0

type TokenType uint8

TokenType represents the type of a token.

const (
	// TokenTypeEOF represents the end of the input.
	TokenTypeEOF TokenType = iota

	// TokenTypeError represents an error during tokenization.
	TokenTypeError

	// TokenTypeNewLine represents a new line.
	TokenTypeNewLine

	// TokenTypeComment represents a comment.
	TokenTypeComment

	// TokenTypeIdentifier represents an identifier (e.g. variable name,
	// type name, field, function name, etc).
	TokenTypeIdentifier

	// TokenTypeOperator represents an operator (e.g. assignment, braces, etc).
	TokenTypeOperator

	// TokenTypeNumber represents a numeric value.
	TokenTypeNumber
)

func (TokenType) String added in v0.22.0

func (t TokenType) String() string

String returns a string representation of the token type.

type Tokenizer added in v0.22.0

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

Tokenizer is a mechanism to split an LSL source code into key pieces of information, called tokens. Each token represents a single element of the source code, such as an identifier, a number, an operator, etc.

One would normally use the Parser to process LSL source code, since the Tokenizer provides low-level information about the source code.

func NewTokenizer added in v0.22.0

func NewTokenizer(source string) *Tokenizer

NewTokenizer creates a new Tokenizer for the given source code. The source code is expected to be a valid UTF-8 string. If the source code is not a valid UTF-8 string, the tokenizer will return an error token.

func (*Tokenizer) Next added in v0.22.0

func (t *Tokenizer) Next() Token

Next returns the next token in the source code. If there are no more tokens to return, it returns a token with the type TokenTypeEOF.

type UnaryExpression

type UnaryExpression struct {
	Pos      Position
	Operator string
	Operand  Expression
}

UnaryExpression represents a unary operation.

func (*UnaryExpression) GetPos added in v0.23.0

func (u *UnaryExpression) GetPos() Position

type UniformBlockDeclaration

type UniformBlockDeclaration struct {
	Pos    Position
	Fields []Field
}

UniformBlockDeclaration represents a uniform block declaration.

func (*UniformBlockDeclaration) GetPos added in v0.23.0

func (u *UniformBlockDeclaration) GetPos() Position

type UsageScope

type UsageScope uint8
const (
	UsageScopeVertexShader UsageScope = 1 << iota
	UsageScopeFragmentShader

	UsageScopeNone UsageScope = 0
	UsageScopeAll             = UsageScopeVertexShader | UsageScopeFragmentShader
)

type VariableDeclaration

type VariableDeclaration struct {
	Pos        Position
	Name       string
	Type       string
	Assignment Expression
}

VariableDeclaration represents a variable declaration.

func (*VariableDeclaration) GetPos added in v0.23.0

func (v *VariableDeclaration) GetPos() Position

type VaryingBlockDeclaration

type VaryingBlockDeclaration struct {
	Pos    Position
	Fields []Field
}

VaryingBlockDeclaration represents a varying block declaration.

func (*VaryingBlockDeclaration) GetPos added in v0.23.0

func (v *VaryingBlockDeclaration) GetPos() Position

Jump to

Keyboard shortcuts

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