parser

package
v1.7.0-preview.1 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2025 License: Apache-2.0 Imports: 15 Imported by: 10

Documentation

Index

Constants

View Source
const (
	KeywordIf          = "if"
	KeywordElse        = "else"
	KeywordWhile       = "while"
	KeywordBreak       = "break"
	KeywordContinue    = "continue"
	KeywordReturn      = "return"
	KeywordTrue        = "true"
	KeywordFalse       = "false"
	KeywordNil         = "nil"
	KeywordLet         = "let"
	KeywordVar         = "var"
	KeywordFun         = "fun"
	KeywordAs          = "as"
	KeywordCreate      = "create"
	KeywordDestroy     = "destroy"
	KeywordFor         = "for"
	KeywordIn          = "in"
	KeywordEmit        = "emit"
	KeywordAuth        = "auth"
	KeywordAccess      = "access"
	KeywordAll         = "all"
	KeywordSelf        = "self"
	KeywordInit        = "init"
	KeywordContract    = "contract"
	KeywordAccount     = "account"
	KeywordImport      = "import"
	KeywordFrom        = "from"
	KeywordPre         = "pre"
	KeywordPost        = "post"
	KeywordEvent       = "event"
	KeywordStruct      = "struct"
	KeywordResource    = "resource"
	KeywordInterface   = "interface"
	KeywordEntitlement = "entitlement"
	KeywordMapping     = "mapping"
	KeywordTransaction = "transaction"
	KeywordPrepare     = "prepare"
	KeywordExecute     = "execute"
	KeywordCase        = "case"
	KeywordSwitch      = "switch"
	KeywordDefault     = "default"
	KeywordEnum        = "enum"
	KeywordView        = "view"
	KeywordAttachment  = "attachment"
	KeywordAttach      = "attach"
	KeywordRemove      = "remove"
	KeywordTo          = "to"
	KeywordRequire     = "require"
	KeywordStatic      = "static"
	KeywordNative      = "native"
	KeywordPub         = "pub"
	KeywordPriv        = "priv"
	KeywordInclude     = "include"
	KeywordTry         = "try"
	KeywordCatch       = "catch"
	KeywordFinally     = "finally"
	KeywordGoto        = "goto"
	KeywordConst       = "const"
	KeywordExport      = "export"
	KeywordThrow       = "throw"
	KeywordThrows      = "throws"
	KeywordRequires    = "requires"
	KeywordWhere       = "where"
	KeywordFinal       = "final"
	KeywordInternal    = "internal"
	KeywordTypealias   = "typealias"
	KeywordType        = "type"
	KeywordRepeat      = "repeat"
	KeywordGuard       = "guard"
	KeywordIs          = "is"
)

NOTE: ensure to update allKeywords when adding a new keyword

Variables

View Source
var HardKeywords = filter(
	allKeywords,
	func(keyword string) bool {
		_, ok := softKeywordsTable.Lookup(keyword)
		return !ok
	},
)

HardKeywords are restricted from being used as identifiers in certain places. i.e: places where ambiguity can exist, such as composite declaration names, function names, etc. However, they are not restricted to be used as fields names, and many other places.

SoftKeywords are keywords that can be used as identifiers anywhere, without any restriction or ambiguity.

Functions

func IsHardKeyword

func IsHardKeyword(identifier string) bool

func Parse

func Parse[T any](
	memoryGauge common.MemoryGauge,
	input []byte,
	parse func(*parser) (T, error),
	config Config,
) (result T, errors []error)

Parse creates a lexer to scan the given input string, and uses the given `parse` function to parse tokens into a result.

It can be composed with different parse functions to parse the input string into different results. See "ParseExpression", "ParseStatements" as examples.

func ParseArgumentList

func ParseArgumentList(
	memoryGauge common.MemoryGauge,
	input []byte,
	config Config,
) (
	arguments ast.Arguments,
	errs []error,
)

func ParseDeclarations

func ParseDeclarations(
	memoryGauge common.MemoryGauge,
	input []byte,
	config Config,
) (
	declarations []ast.Declaration,
	errs []error,
)

func ParseDocstringPragmaArguments

func ParseDocstringPragmaArguments(docString string) []string

ParseDocstringPragmaArguments parses the docstring and returns the values of all pragma arguments declarations.

A pragma arguments declaration has the form `pragma arguments <argument-list>`, where <argument-list> is a Cadence argument list.

The validity of the argument list is NOT checked by this function.

func ParseDocstringPragmaSigners

func ParseDocstringPragmaSigners(docString string) []string

ParseDocstringPragmaSigners parses the docstring and returns the values of all pragma signers declarations.

A pragma signers declaration has the form `pragma signers <signers-list>`, where <signers-list> is a list of strings.

The validity of the argument list is NOT checked by this function.

func ParseExpression

func ParseExpression(
	memoryGauge common.MemoryGauge,
	input []byte,
	config Config,
) (
	expression ast.Expression,
	errs []error,
)

func ParseProgram

func ParseProgram(memoryGauge common.MemoryGauge, code []byte, config Config) (program *ast.Program, err error)

func ParseProgramFromFile

func ParseProgramFromFile(
	memoryGauge common.MemoryGauge,
	filename string,
	config Config,
) (
	program *ast.Program,
	code []byte,
	err error,
)

func ParseProgramFromTokenStream

func ParseProgramFromTokenStream(
	memoryGauge common.MemoryGauge,
	input lexer.TokenStream,
	config Config,
) (
	program *ast.Program,
	err error,
)

func ParseStatements

func ParseStatements(
	memoryGauge common.MemoryGauge,
	input []byte,
	config Config,
) (
	statements []ast.Statement,
	errs []error,
)

func ParseStatementsFromTokenStream

func ParseStatementsFromTokenStream(
	memoryGauge common.MemoryGauge,
	tokens lexer.TokenStream,
	config Config,
) (
	statements []ast.Statement,
	errs []error,
)

func ParseTokenStream

func ParseTokenStream[T any](
	memoryGauge common.MemoryGauge,
	tokens lexer.TokenStream,
	parse func(*parser) (T, error),
	config Config,
) (
	result T,
	errs []error,
)

func ParseType

func ParseType(memoryGauge common.MemoryGauge, input []byte, config Config) (ty ast.Type, errs []error)

Types

type AccessKeywordEntitlementNameError added in v1.7.0

type AccessKeywordEntitlementNameError struct {
	Keyword string
	ast.Range
}

AccessKeywordEntitlementNameError is reported when an access keyword (e.g. `all`, `self`) is used as an entitlement name.

func (*AccessKeywordEntitlementNameError) DocumentationLink() string

func (*AccessKeywordEntitlementNameError) Error added in v1.7.0

func (*AccessKeywordEntitlementNameError) IsUserError added in v1.7.0

func (*AccessKeywordEntitlementNameError) IsUserError()

func (*AccessKeywordEntitlementNameError) SecondaryError added in v1.7.0

func (*AccessKeywordEntitlementNameError) SecondaryError() string

type Config

type Config struct {
	// StaticModifierEnabled determines if the static modifier is enabled
	StaticModifierEnabled bool
	// NativeModifierEnabled determines if the native modifier is enabled
	NativeModifierEnabled bool
	// Deprecated: IgnoreLeadingIdentifierEnabled determines
	// if leading identifiers are ignored.
	//
	// Pre-Stable Cadence, identifiers preceding keywords were (incorrectly) ignored,
	// instead of being reported as invalid, e.g. `foo let bar: Int` was valid.
	// The new default behaviour is to report an error, e.g. for `foo` in the example above.
	//
	// This option exists so the old behaviour can be enabled to allow developers to update their code.
	IgnoreLeadingIdentifierEnabled bool
	// TypeParametersEnabled determines if type parameters are enabled
	TypeParametersEnabled bool
}

type CustomDestructorError

type CustomDestructorError struct {
	Pos             ast.Position
	DestructorRange ast.Range
}
func (*CustomDestructorError) DocumentationLink() string

func (*CustomDestructorError) EndPosition

func (*CustomDestructorError) Error

func (*CustomDestructorError) Error() string

func (*CustomDestructorError) IsUserError

func (*CustomDestructorError) IsUserError()

func (*CustomDestructorError) MigrationNote added in v1.7.0

func (*CustomDestructorError) MigrationNote() string

func (*CustomDestructorError) SecondaryError

func (*CustomDestructorError) SecondaryError() string

func (*CustomDestructorError) StartPosition

func (e *CustomDestructorError) StartPosition() ast.Position

func (*CustomDestructorError) SuggestFixes added in v1.7.0

type DuplicateAccessModifierError added in v1.7.0

type DuplicateAccessModifierError struct {
	ast.Range
}
func (*DuplicateAccessModifierError) DocumentationLink() string

func (*DuplicateAccessModifierError) Error added in v1.7.0

func (*DuplicateAccessModifierError) IsUserError added in v1.7.0

func (*DuplicateAccessModifierError) IsUserError()

func (*DuplicateAccessModifierError) SecondaryError added in v1.7.0

func (*DuplicateAccessModifierError) SecondaryError() string

func (*DuplicateAccessModifierError) SuggestFixes added in v1.7.0

type DuplicateViewModifierError added in v1.7.0

type DuplicateViewModifierError struct {
	ast.Range
}
func (*DuplicateViewModifierError) DocumentationLink() string

func (*DuplicateViewModifierError) Error added in v1.7.0

func (*DuplicateViewModifierError) IsUserError added in v1.7.0

func (*DuplicateViewModifierError) IsUserError()

func (*DuplicateViewModifierError) SecondaryError added in v1.7.0

func (*DuplicateViewModifierError) SecondaryError() string

func (*DuplicateViewModifierError) SuggestFixes added in v1.7.0

type Error

type Error struct {
	Code   []byte
	Errors []error
}

func (Error) ChildErrors

func (e Error) ChildErrors() []error

func (Error) Error

func (e Error) Error() string

func (Error) Unwrap

func (e Error) Unwrap() []error

type ExpressionDepthLimitReachedError

type ExpressionDepthLimitReachedError struct {
	Pos ast.Position
}

ExpressionDepthLimitReachedError is reported when the expression depth limit was reached

func (ExpressionDepthLimitReachedError) EndPosition

func (ExpressionDepthLimitReachedError) Error

func (ExpressionDepthLimitReachedError) IsUserError

func (ExpressionDepthLimitReachedError) IsUserError()

func (ExpressionDepthLimitReachedError) SecondaryError added in v1.7.0

func (ExpressionDepthLimitReachedError) SecondaryError() string

func (ExpressionDepthLimitReachedError) StartPosition

func (e ExpressionDepthLimitReachedError) StartPosition() ast.Position

type InvalidAccessModifierError added in v1.7.0

type InvalidAccessModifierError struct {
	Pos             ast.Position
	DeclarationKind common.DeclarationKind
}
func (*InvalidAccessModifierError) DocumentationLink() string

func (*InvalidAccessModifierError) EndPosition added in v1.7.0

func (*InvalidAccessModifierError) Error added in v1.7.0

func (*InvalidAccessModifierError) IsUserError added in v1.7.0

func (*InvalidAccessModifierError) IsUserError()

func (*InvalidAccessModifierError) SecondaryError added in v1.7.0

func (e *InvalidAccessModifierError) SecondaryError() string

func (*InvalidAccessModifierError) StartPosition added in v1.7.0

func (e *InvalidAccessModifierError) StartPosition() ast.Position

type InvalidEntitlementSeparatorError added in v1.7.0

type InvalidEntitlementSeparatorError struct {
	Token lexer.Token
}

InvalidEntitlementSeparatorError is reported when an invalid token is used as an entitlement separator.

func (*InvalidEntitlementSeparatorError) DocumentationLink() string

func (*InvalidEntitlementSeparatorError) EndPosition added in v1.7.0

func (*InvalidEntitlementSeparatorError) Error added in v1.7.0

func (*InvalidEntitlementSeparatorError) IsUserError added in v1.7.0

func (*InvalidEntitlementSeparatorError) IsUserError()

func (*InvalidEntitlementSeparatorError) SecondaryError added in v1.7.0

func (*InvalidEntitlementSeparatorError) SecondaryError() string

func (*InvalidEntitlementSeparatorError) StartPosition added in v1.7.0

func (e *InvalidEntitlementSeparatorError) StartPosition() ast.Position

type InvalidIntegerLiteralError

type InvalidIntegerLiteralError struct {
	Literal                   string
	IntegerLiteralKind        common.IntegerLiteralKind
	InvalidIntegerLiteralKind InvalidNumberLiteralKind
	ast.Range
}
func (*InvalidIntegerLiteralError) DocumentationLink() string

func (*InvalidIntegerLiteralError) Error

func (*InvalidIntegerLiteralError) IsUserError

func (*InvalidIntegerLiteralError) IsUserError()

func (*InvalidIntegerLiteralError) SecondaryError

func (e *InvalidIntegerLiteralError) SecondaryError() string

type InvalidNativeModifierError added in v1.7.0

type InvalidNativeModifierError struct {
	Pos             ast.Position
	DeclarationKind common.DeclarationKind
}

func (*InvalidNativeModifierError) EndPosition added in v1.7.0

func (e *InvalidNativeModifierError) EndPosition(memoryGauge common.MemoryGauge) ast.Position

func (*InvalidNativeModifierError) Error added in v1.7.0

func (*InvalidNativeModifierError) IsUserError added in v1.7.0

func (*InvalidNativeModifierError) IsUserError()

func (*InvalidNativeModifierError) SecondaryError added in v1.7.0

func (e *InvalidNativeModifierError) SecondaryError() string

func (*InvalidNativeModifierError) StartPosition added in v1.7.0

func (e *InvalidNativeModifierError) StartPosition() ast.Position

func (*InvalidNativeModifierError) SuggestFixes added in v1.7.0

type InvalidNumberLiteralKind

type InvalidNumberLiteralKind uint
const (
	InvalidNumberLiteralKindUnknown InvalidNumberLiteralKind = iota
	InvalidNumberLiteralKindLeadingUnderscore
	InvalidNumberLiteralKindTrailingUnderscore
	InvalidNumberLiteralKindUnknownPrefix
	InvalidNumberLiteralKindMissingDigits
)

func (InvalidNumberLiteralKind) Description

func (k InvalidNumberLiteralKind) Description() string

func (InvalidNumberLiteralKind) String

func (i InvalidNumberLiteralKind) String() string

type InvalidStaticModifierError added in v1.7.0

type InvalidStaticModifierError struct {
	Pos             ast.Position
	DeclarationKind common.DeclarationKind
}

func (*InvalidStaticModifierError) EndPosition added in v1.7.0

func (e *InvalidStaticModifierError) EndPosition(memoryGauge common.MemoryGauge) ast.Position

func (*InvalidStaticModifierError) Error added in v1.7.0

func (*InvalidStaticModifierError) IsUserError added in v1.7.0

func (*InvalidStaticModifierError) IsUserError()

func (*InvalidStaticModifierError) SecondaryError added in v1.7.0

func (e *InvalidStaticModifierError) SecondaryError() string

func (*InvalidStaticModifierError) StartPosition added in v1.7.0

func (e *InvalidStaticModifierError) StartPosition() ast.Position

func (*InvalidStaticModifierError) SuggestFixes added in v1.7.0

type InvalidViewModifierError added in v1.7.0

type InvalidViewModifierError struct {
	Pos             ast.Position
	DeclarationKind common.DeclarationKind
}
func (*InvalidViewModifierError) DocumentationLink() string

func (*InvalidViewModifierError) EndPosition added in v1.7.0

func (*InvalidViewModifierError) Error added in v1.7.0

func (e *InvalidViewModifierError) Error() string

func (*InvalidViewModifierError) IsUserError added in v1.7.0

func (*InvalidViewModifierError) IsUserError()

func (*InvalidViewModifierError) SecondaryError added in v1.7.0

func (*InvalidViewModifierError) SecondaryError() string

func (*InvalidViewModifierError) StartPosition added in v1.7.0

func (e *InvalidViewModifierError) StartPosition() ast.Position

type MemberAccessMissingNameError added in v1.7.0

type MemberAccessMissingNameError struct {
	GotToken lexer.Token
}

MemberAccessMissingNameError is reported when a member access is missing a name.

func (*MemberAccessMissingNameError) DocumentationLink() string

func (*MemberAccessMissingNameError) EndPosition added in v1.7.0

func (*MemberAccessMissingNameError) Error added in v1.7.0

func (*MemberAccessMissingNameError) IsUserError added in v1.7.0

func (*MemberAccessMissingNameError) IsUserError()

func (*MemberAccessMissingNameError) SecondaryError added in v1.7.0

func (*MemberAccessMissingNameError) SecondaryError() string

func (*MemberAccessMissingNameError) StartPosition added in v1.7.0

func (e *MemberAccessMissingNameError) StartPosition() ast.Position

type MissingCommaInParameterListError

type MissingCommaInParameterListError struct {
	Pos ast.Position
}
func (*MissingCommaInParameterListError) DocumentationLink() string

func (*MissingCommaInParameterListError) EndPosition

func (*MissingCommaInParameterListError) Error

func (*MissingCommaInParameterListError) IsUserError

func (*MissingCommaInParameterListError) IsUserError()

func (*MissingCommaInParameterListError) SecondaryError added in v1.7.0

func (*MissingCommaInParameterListError) SecondaryError() string

func (*MissingCommaInParameterListError) StartPosition

func (e *MissingCommaInParameterListError) StartPosition() ast.Position

func (*MissingCommaInParameterListError) SuggestFixes added in v1.7.0

type MissingConformanceError added in v1.7.0

type MissingConformanceError struct {
	Pos ast.Position
}

MissingConformanceError is reported when a colon for conformances is present, but no conformances follow.

func (*MissingConformanceError) DocumentationLink() string

func (*MissingConformanceError) EndPosition added in v1.7.0

func (*MissingConformanceError) Error added in v1.7.0

func (*MissingConformanceError) IsUserError added in v1.7.0

func (*MissingConformanceError) IsUserError()

func (*MissingConformanceError) SecondaryError added in v1.7.0

func (*MissingConformanceError) SecondaryError() string

func (*MissingConformanceError) StartPosition added in v1.7.0

func (e *MissingConformanceError) StartPosition() ast.Position

type MissingEnumCaseNameError added in v1.7.0

type MissingEnumCaseNameError struct {
	GotToken lexer.Token
}

MissingEnumCaseNameError is reported when an enum case is missing a name.

func (*MissingEnumCaseNameError) DocumentationLink() string

func (*MissingEnumCaseNameError) EndPosition added in v1.7.0

func (*MissingEnumCaseNameError) Error added in v1.7.0

func (e *MissingEnumCaseNameError) Error() string

func (*MissingEnumCaseNameError) IsUserError added in v1.7.0

func (*MissingEnumCaseNameError) IsUserError()

func (*MissingEnumCaseNameError) SecondaryError added in v1.7.0

func (*MissingEnumCaseNameError) SecondaryError() string

func (*MissingEnumCaseNameError) StartPosition added in v1.7.0

func (e *MissingEnumCaseNameError) StartPosition() ast.Position

type NonNominalTypeError added in v1.7.0

type NonNominalTypeError struct {
	Pos  ast.Position
	Type ast.Type
}
func (*NonNominalTypeError) DocumentationLink() string

func (*NonNominalTypeError) EndPosition added in v1.7.0

func (*NonNominalTypeError) Error added in v1.7.0

func (e *NonNominalTypeError) Error() string

func (*NonNominalTypeError) IsUserError added in v1.7.0

func (*NonNominalTypeError) IsUserError()

func (*NonNominalTypeError) SecondaryError added in v1.7.0

func (*NonNominalTypeError) SecondaryError() string

func (*NonNominalTypeError) StartPosition added in v1.7.0

func (e *NonNominalTypeError) StartPosition() ast.Position

type ParseError

type ParseError interface {
	errors.UserError
	ast.HasPosition
	// contains filtered or unexported methods
}

type PrivAccessError added in v1.7.0

type PrivAccessError struct {
	ast.Range
}
func (*PrivAccessError) DocumentationLink() string

func (*PrivAccessError) Error added in v1.7.0

func (*PrivAccessError) Error() string

func (*PrivAccessError) IsUserError added in v1.7.0

func (*PrivAccessError) IsUserError()

func (*PrivAccessError) MigrationNote added in v1.7.0

func (*PrivAccessError) MigrationNote() string

func (*PrivAccessError) SecondaryError added in v1.7.0

func (*PrivAccessError) SecondaryError() string

func (*PrivAccessError) SuggestFixes added in v1.7.0

func (e *PrivAccessError) SuggestFixes(_ string) []errors.SuggestedFix[ast.TextEdit]

type PubAccessError added in v1.7.0

type PubAccessError struct {
	ast.Range
}
func (*PubAccessError) DocumentationLink() string

func (*PubAccessError) Error added in v1.7.0

func (*PubAccessError) Error() string

func (*PubAccessError) IsUserError added in v1.7.0

func (*PubAccessError) IsUserError()

func (*PubAccessError) MigrationNote added in v1.7.0

func (*PubAccessError) MigrationNote() string

func (*PubAccessError) SecondaryError added in v1.7.0

func (*PubAccessError) SecondaryError() string

func (*PubAccessError) SuggestFixes added in v1.7.0

func (e *PubAccessError) SuggestFixes(_ string) []errors.SuggestedFix[ast.TextEdit]

type RestrictedTypeError

type RestrictedTypeError struct {
	ast.Range
}
func (*RestrictedTypeError) DocumentationLink() string

func (*RestrictedTypeError) Error

func (*RestrictedTypeError) Error() string

func (*RestrictedTypeError) IsUserError

func (*RestrictedTypeError) IsUserError()

func (*RestrictedTypeError) MigrationNote added in v1.7.0

func (*RestrictedTypeError) MigrationNote() string

func (*RestrictedTypeError) SecondaryError added in v1.7.0

func (*RestrictedTypeError) SecondaryError() string

type SpecialFunctionReturnTypeError added in v1.7.0

type SpecialFunctionReturnTypeError struct {
	DeclarationKind common.DeclarationKind
	ast.Range
}

SpecialFunctionReturnTypeError is reported when a special function has a return type.

func (*SpecialFunctionReturnTypeError) DocumentationLink() string

func (*SpecialFunctionReturnTypeError) Error added in v1.7.0

func (*SpecialFunctionReturnTypeError) IsUserError added in v1.7.0

func (*SpecialFunctionReturnTypeError) IsUserError()

func (*SpecialFunctionReturnTypeError) SecondaryError added in v1.7.0

func (*SpecialFunctionReturnTypeError) SecondaryError() string

func (*SpecialFunctionReturnTypeError) SuggestFixes added in v1.7.0

type StatementSeparationError added in v1.7.0

type StatementSeparationError struct {
	Pos ast.Position
}

StatementSeparationError is reported when two statements on the same line are not separated by a semicolon.

func (*StatementSeparationError) DocumentationLink() string

func (*StatementSeparationError) EndPosition added in v1.7.0

func (*StatementSeparationError) Error added in v1.7.0

func (*StatementSeparationError) IsUserError added in v1.7.0

func (*StatementSeparationError) IsUserError()

func (*StatementSeparationError) SecondaryError added in v1.7.0

func (*StatementSeparationError) SecondaryError() string

func (*StatementSeparationError) StartPosition added in v1.7.0

func (e *StatementSeparationError) StartPosition() ast.Position

func (*StatementSeparationError) SuggestFixes added in v1.7.0

type SyntaxError

type SyntaxError struct {
	Message       string
	Secondary     string
	Migration     string
	Documentation string
	Pos           ast.Position
}

func NewSyntaxError

func NewSyntaxError(pos ast.Position, message string, params ...any) *SyntaxError
func (e *SyntaxError) DocumentationLink() string

func (*SyntaxError) EndPosition

func (e *SyntaxError) EndPosition(_ common.MemoryGauge) ast.Position

func (*SyntaxError) Error

func (e *SyntaxError) Error() string

func (*SyntaxError) IsUserError

func (*SyntaxError) IsUserError()

func (*SyntaxError) MigrationNote added in v1.7.0

func (e *SyntaxError) MigrationNote() string

func (*SyntaxError) SecondaryError added in v1.7.0

func (e *SyntaxError) SecondaryError() string

func (*SyntaxError) StartPosition

func (e *SyntaxError) StartPosition() ast.Position

func (*SyntaxError) WithDocumentation added in v1.7.0

func (e *SyntaxError) WithDocumentation(documentation string) *SyntaxError

func (*SyntaxError) WithMigration added in v1.7.0

func (e *SyntaxError) WithMigration(migration string) *SyntaxError

func (*SyntaxError) WithSecondary added in v1.7.0

func (e *SyntaxError) WithSecondary(secondary string) *SyntaxError

type TypeDepthLimitReachedError

type TypeDepthLimitReachedError struct {
	Pos ast.Position
}

TypeDepthLimitReachedError is reported when the type depth limit was reached

func (TypeDepthLimitReachedError) EndPosition

func (TypeDepthLimitReachedError) Error

func (TypeDepthLimitReachedError) IsUserError

func (TypeDepthLimitReachedError) IsUserError()

func (TypeDepthLimitReachedError) SecondaryError

func (TypeDepthLimitReachedError) SecondaryError() string

func (TypeDepthLimitReachedError) StartPosition

func (e TypeDepthLimitReachedError) StartPosition() ast.Position

type UnexpectedEOFError added in v1.7.0

type UnexpectedEOFError struct {
	Pos ast.Position
}

UnexpectedEOFError is reported when the end of the program is reached unexpectedly

func (UnexpectedEOFError) DocumentationLink() string

func (UnexpectedEOFError) EndPosition added in v1.7.0

func (UnexpectedEOFError) Error added in v1.7.0

func (UnexpectedEOFError) Error() string

func (UnexpectedEOFError) IsUserError added in v1.7.0

func (UnexpectedEOFError) IsUserError()

func (UnexpectedEOFError) SecondaryError added in v1.7.0

func (UnexpectedEOFError) SecondaryError() string

func (UnexpectedEOFError) StartPosition added in v1.7.0

func (e UnexpectedEOFError) StartPosition() ast.Position

type UnexpectedTokenAtEndError added in v1.7.0

type UnexpectedTokenAtEndError struct {
	Token lexer.Token
}

UnexpectedTokenAtEndError is reported when there is an unexpected token at the end of the program

func (*UnexpectedTokenAtEndError) DocumentationLink() string

func (*UnexpectedTokenAtEndError) EndPosition added in v1.7.0

func (*UnexpectedTokenAtEndError) Error added in v1.7.0

func (e *UnexpectedTokenAtEndError) Error() string

func (*UnexpectedTokenAtEndError) IsUserError added in v1.7.0

func (*UnexpectedTokenAtEndError) IsUserError()

func (*UnexpectedTokenAtEndError) SecondaryError added in v1.7.0

func (*UnexpectedTokenAtEndError) SecondaryError() string

func (*UnexpectedTokenAtEndError) StartPosition added in v1.7.0

func (e *UnexpectedTokenAtEndError) StartPosition() ast.Position

type WhitespaceAfterMemberAccessError added in v1.7.0

type WhitespaceAfterMemberAccessError struct {
	OperatorTokenType lexer.TokenType
	WhitespaceRange   ast.Range
}

WhitespaceAfterMemberAccessError is reported when there is whitespace after a member access operator.

func (*WhitespaceAfterMemberAccessError) DocumentationLink() string

func (*WhitespaceAfterMemberAccessError) EndPosition added in v1.7.0

func (*WhitespaceAfterMemberAccessError) Error added in v1.7.0

func (*WhitespaceAfterMemberAccessError) IsUserError added in v1.7.0

func (*WhitespaceAfterMemberAccessError) IsUserError()

func (*WhitespaceAfterMemberAccessError) SecondaryError added in v1.7.0

func (e *WhitespaceAfterMemberAccessError) SecondaryError() string

func (*WhitespaceAfterMemberAccessError) StartPosition added in v1.7.0

func (e *WhitespaceAfterMemberAccessError) StartPosition() ast.Position

func (*WhitespaceAfterMemberAccessError) SuggestFixes added in v1.7.0

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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