Documentation
¶
Index ¶
- Constants
- Variables
- func IsHardKeyword(identifier string) bool
- func Parse[T any](memoryGauge common.MemoryGauge, input []byte, parse func(*parser) (T, error), ...) (result T, errors []error)
- func ParseArgumentList(memoryGauge common.MemoryGauge, input []byte, config Config) (arguments ast.Arguments, errs []error)
- func ParseDeclarations(memoryGauge common.MemoryGauge, input []byte, config Config) (declarations []ast.Declaration, errs []error)
- func ParseDocstringPragmaArguments(docString string) []string
- func ParseDocstringPragmaSigners(docString string) []string
- func ParseExpression(memoryGauge common.MemoryGauge, input []byte, config Config) (expression ast.Expression, errs []error)
- func ParseProgram(memoryGauge common.MemoryGauge, code []byte, config Config) (program *ast.Program, err error)
- func ParseProgramFromFile(memoryGauge common.MemoryGauge, filename string, config Config) (program *ast.Program, code []byte, err error)
- func ParseProgramFromTokenStream(memoryGauge common.MemoryGauge, input lexer.TokenStream, config Config) (program *ast.Program, err error)
- func ParseStatements(memoryGauge common.MemoryGauge, input []byte, config Config) (statements []ast.Statement, errs []error)
- func ParseStatementsFromTokenStream(memoryGauge common.MemoryGauge, tokens lexer.TokenStream, config Config) (statements []ast.Statement, errs []error)
- func ParseTokenStream[T any](memoryGauge common.MemoryGauge, tokens lexer.TokenStream, ...) (result T, errs []error)
- func ParseType(memoryGauge common.MemoryGauge, input []byte, config Config) (ty ast.Type, errs []error)
- type AccessKeywordEntitlementNameError
- type Config
- type CustomDestructorError
- func (*CustomDestructorError) DocumentationLink() string
- func (e *CustomDestructorError) EndPosition(_ common.MemoryGauge) ast.Position
- func (*CustomDestructorError) Error() string
- func (*CustomDestructorError) IsUserError()
- func (*CustomDestructorError) MigrationNote() string
- func (*CustomDestructorError) SecondaryError() string
- func (e *CustomDestructorError) StartPosition() ast.Position
- func (e *CustomDestructorError) SuggestFixes(_ string) []errors.SuggestedFix[ast.TextEdit]
- type DuplicateAccessModifierError
- func (*DuplicateAccessModifierError) DocumentationLink() string
- func (*DuplicateAccessModifierError) Error() string
- func (*DuplicateAccessModifierError) IsUserError()
- func (*DuplicateAccessModifierError) SecondaryError() string
- func (e *DuplicateAccessModifierError) SuggestFixes(_ string) []errors.SuggestedFix[ast.TextEdit]
- type DuplicateViewModifierError
- func (*DuplicateViewModifierError) DocumentationLink() string
- func (*DuplicateViewModifierError) Error() string
- func (*DuplicateViewModifierError) IsUserError()
- func (*DuplicateViewModifierError) SecondaryError() string
- func (e *DuplicateViewModifierError) SuggestFixes(_ string) []errors.SuggestedFix[ast.TextEdit]
- type Error
- type ExpressionDepthLimitReachedError
- func (e ExpressionDepthLimitReachedError) EndPosition(_ common.MemoryGauge) ast.Position
- func (ExpressionDepthLimitReachedError) Error() string
- func (ExpressionDepthLimitReachedError) IsUserError()
- func (ExpressionDepthLimitReachedError) SecondaryError() string
- func (e ExpressionDepthLimitReachedError) StartPosition() ast.Position
- type InvalidAccessModifierError
- func (*InvalidAccessModifierError) DocumentationLink() string
- func (e *InvalidAccessModifierError) EndPosition(_ common.MemoryGauge) ast.Position
- func (e *InvalidAccessModifierError) Error() string
- func (*InvalidAccessModifierError) IsUserError()
- func (e *InvalidAccessModifierError) SecondaryError() string
- func (e *InvalidAccessModifierError) StartPosition() ast.Position
- type InvalidEntitlementSeparatorError
- func (*InvalidEntitlementSeparatorError) DocumentationLink() string
- func (e *InvalidEntitlementSeparatorError) EndPosition(_ common.MemoryGauge) ast.Position
- func (e *InvalidEntitlementSeparatorError) Error() string
- func (*InvalidEntitlementSeparatorError) IsUserError()
- func (*InvalidEntitlementSeparatorError) SecondaryError() string
- func (e *InvalidEntitlementSeparatorError) StartPosition() ast.Position
- type InvalidIntegerLiteralError
- type InvalidNativeModifierError
- func (e *InvalidNativeModifierError) EndPosition(memoryGauge common.MemoryGauge) ast.Position
- func (e *InvalidNativeModifierError) Error() string
- func (*InvalidNativeModifierError) IsUserError()
- func (e *InvalidNativeModifierError) SecondaryError() string
- func (e *InvalidNativeModifierError) StartPosition() ast.Position
- func (e *InvalidNativeModifierError) SuggestFixes(_ string) []errors.SuggestedFix[ast.TextEdit]
- type InvalidNumberLiteralKind
- type InvalidStaticModifierError
- func (e *InvalidStaticModifierError) EndPosition(memoryGauge common.MemoryGauge) ast.Position
- func (e *InvalidStaticModifierError) Error() string
- func (*InvalidStaticModifierError) IsUserError()
- func (e *InvalidStaticModifierError) SecondaryError() string
- func (e *InvalidStaticModifierError) StartPosition() ast.Position
- func (e *InvalidStaticModifierError) SuggestFixes(_ string) []errors.SuggestedFix[ast.TextEdit]
- type InvalidViewModifierError
- func (*InvalidViewModifierError) DocumentationLink() string
- func (e *InvalidViewModifierError) EndPosition(_ common.MemoryGauge) ast.Position
- func (e *InvalidViewModifierError) Error() string
- func (*InvalidViewModifierError) IsUserError()
- func (*InvalidViewModifierError) SecondaryError() string
- func (e *InvalidViewModifierError) StartPosition() ast.Position
- type MemberAccessMissingNameError
- func (*MemberAccessMissingNameError) DocumentationLink() string
- func (e *MemberAccessMissingNameError) EndPosition(_ common.MemoryGauge) ast.Position
- func (e *MemberAccessMissingNameError) Error() string
- func (*MemberAccessMissingNameError) IsUserError()
- func (*MemberAccessMissingNameError) SecondaryError() string
- func (e *MemberAccessMissingNameError) StartPosition() ast.Position
- type MissingCommaInParameterListError
- func (*MissingCommaInParameterListError) DocumentationLink() string
- func (e *MissingCommaInParameterListError) EndPosition(_ common.MemoryGauge) ast.Position
- func (*MissingCommaInParameterListError) Error() string
- func (*MissingCommaInParameterListError) IsUserError()
- func (*MissingCommaInParameterListError) SecondaryError() string
- func (e *MissingCommaInParameterListError) StartPosition() ast.Position
- func (e *MissingCommaInParameterListError) SuggestFixes(_ string) []errors.SuggestedFix[ast.TextEdit]
- type MissingConformanceError
- func (*MissingConformanceError) DocumentationLink() string
- func (e *MissingConformanceError) EndPosition(_ common.MemoryGauge) ast.Position
- func (*MissingConformanceError) Error() string
- func (*MissingConformanceError) IsUserError()
- func (*MissingConformanceError) SecondaryError() string
- func (e *MissingConformanceError) StartPosition() ast.Position
- type MissingEnumCaseNameError
- func (*MissingEnumCaseNameError) DocumentationLink() string
- func (e *MissingEnumCaseNameError) EndPosition(_ common.MemoryGauge) ast.Position
- func (e *MissingEnumCaseNameError) Error() string
- func (*MissingEnumCaseNameError) IsUserError()
- func (*MissingEnumCaseNameError) SecondaryError() string
- func (e *MissingEnumCaseNameError) StartPosition() ast.Position
- type NonNominalTypeError
- func (*NonNominalTypeError) DocumentationLink() string
- func (e *NonNominalTypeError) EndPosition(_ common.MemoryGauge) ast.Position
- func (e *NonNominalTypeError) Error() string
- func (*NonNominalTypeError) IsUserError()
- func (*NonNominalTypeError) SecondaryError() string
- func (e *NonNominalTypeError) StartPosition() ast.Position
- type ParseError
- type PrivAccessError
- func (*PrivAccessError) DocumentationLink() string
- func (*PrivAccessError) Error() string
- func (*PrivAccessError) IsUserError()
- func (*PrivAccessError) MigrationNote() string
- func (*PrivAccessError) SecondaryError() string
- func (e *PrivAccessError) SuggestFixes(_ string) []errors.SuggestedFix[ast.TextEdit]
- type PubAccessError
- func (*PubAccessError) DocumentationLink() string
- func (*PubAccessError) Error() string
- func (*PubAccessError) IsUserError()
- func (*PubAccessError) MigrationNote() string
- func (*PubAccessError) SecondaryError() string
- func (e *PubAccessError) SuggestFixes(_ string) []errors.SuggestedFix[ast.TextEdit]
- type RestrictedTypeError
- type SpecialFunctionReturnTypeError
- func (*SpecialFunctionReturnTypeError) DocumentationLink() string
- func (e *SpecialFunctionReturnTypeError) Error() string
- func (*SpecialFunctionReturnTypeError) IsUserError()
- func (*SpecialFunctionReturnTypeError) SecondaryError() string
- func (e *SpecialFunctionReturnTypeError) SuggestFixes(code string) []errors.SuggestedFix[ast.TextEdit]
- type StatementSeparationError
- func (*StatementSeparationError) DocumentationLink() string
- func (e *StatementSeparationError) EndPosition(_ common.MemoryGauge) ast.Position
- func (*StatementSeparationError) Error() string
- func (*StatementSeparationError) IsUserError()
- func (*StatementSeparationError) SecondaryError() string
- func (e *StatementSeparationError) StartPosition() ast.Position
- func (e *StatementSeparationError) SuggestFixes(_ string) []errors.SuggestedFix[ast.TextEdit]
- type SyntaxError
- func (e *SyntaxError) DocumentationLink() string
- func (e *SyntaxError) EndPosition(_ common.MemoryGauge) ast.Position
- func (e *SyntaxError) Error() string
- func (*SyntaxError) IsUserError()
- func (e *SyntaxError) MigrationNote() string
- func (e *SyntaxError) SecondaryError() string
- func (e *SyntaxError) StartPosition() ast.Position
- func (e *SyntaxError) WithDocumentation(documentation string) *SyntaxError
- func (e *SyntaxError) WithMigration(migration string) *SyntaxError
- func (e *SyntaxError) WithSecondary(secondary string) *SyntaxError
- type TypeDepthLimitReachedError
- func (e TypeDepthLimitReachedError) EndPosition(_ common.MemoryGauge) ast.Position
- func (TypeDepthLimitReachedError) Error() string
- func (TypeDepthLimitReachedError) IsUserError()
- func (TypeDepthLimitReachedError) SecondaryError() string
- func (e TypeDepthLimitReachedError) StartPosition() ast.Position
- type UnexpectedEOFError
- func (UnexpectedEOFError) DocumentationLink() string
- func (e UnexpectedEOFError) EndPosition(_ common.MemoryGauge) ast.Position
- func (UnexpectedEOFError) Error() string
- func (UnexpectedEOFError) IsUserError()
- func (UnexpectedEOFError) SecondaryError() string
- func (e UnexpectedEOFError) StartPosition() ast.Position
- type UnexpectedTokenAtEndError
- func (*UnexpectedTokenAtEndError) DocumentationLink() string
- func (e *UnexpectedTokenAtEndError) EndPosition(_ common.MemoryGauge) ast.Position
- func (e *UnexpectedTokenAtEndError) Error() string
- func (*UnexpectedTokenAtEndError) IsUserError()
- func (*UnexpectedTokenAtEndError) SecondaryError() string
- func (e *UnexpectedTokenAtEndError) StartPosition() ast.Position
- type WhitespaceAfterMemberAccessError
- func (*WhitespaceAfterMemberAccessError) DocumentationLink() string
- func (e *WhitespaceAfterMemberAccessError) EndPosition(_ common.MemoryGauge) ast.Position
- func (e *WhitespaceAfterMemberAccessError) Error() string
- func (*WhitespaceAfterMemberAccessError) IsUserError()
- func (e *WhitespaceAfterMemberAccessError) SecondaryError() string
- func (e *WhitespaceAfterMemberAccessError) StartPosition() ast.Position
- func (e *WhitespaceAfterMemberAccessError) SuggestFixes(_ string) []errors.SuggestedFix[ast.TextEdit]
Constants ¶
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 ¶
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.
var SoftKeywords = []string{ KeywordFrom, KeywordAccount, KeywordAll, KeywordView, KeywordAttach, KeywordRemove, KeywordTo, KeywordType, }
SoftKeywords are keywords that can be used as identifiers anywhere, without any restriction or ambiguity.
Functions ¶
func IsHardKeyword ¶
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 ParseDeclarations ¶
func ParseDeclarations( memoryGauge common.MemoryGauge, input []byte, config Config, ) ( declarations []ast.Declaration, errs []error, )
func ParseDocstringPragmaArguments ¶
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 ¶
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 ParseProgramFromFile ¶
func ParseProgramFromTokenStream ¶
func ParseProgramFromTokenStream( memoryGauge common.MemoryGauge, input lexer.TokenStream, config Config, ) ( program *ast.Program, err error, )
func ParseStatements ¶
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, )
Types ¶
type AccessKeywordEntitlementNameError ¶ added in v1.7.0
AccessKeywordEntitlementNameError is reported when an access keyword (e.g. `all`, `self`) is used as an entitlement name.
func (*AccessKeywordEntitlementNameError) DocumentationLink ¶ added in v1.7.0
func (*AccessKeywordEntitlementNameError) DocumentationLink() string
func (*AccessKeywordEntitlementNameError) Error ¶ added in v1.7.0
func (e *AccessKeywordEntitlementNameError) Error() string
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 ¶
func (*CustomDestructorError) DocumentationLink ¶ added in v1.7.0
func (*CustomDestructorError) DocumentationLink() string
func (*CustomDestructorError) EndPosition ¶
func (e *CustomDestructorError) EndPosition(_ common.MemoryGauge) ast.Position
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
func (e *CustomDestructorError) SuggestFixes(_ string) []errors.SuggestedFix[ast.TextEdit]
type DuplicateAccessModifierError ¶ added in v1.7.0
func (*DuplicateAccessModifierError) DocumentationLink ¶ added in v1.7.0
func (*DuplicateAccessModifierError) DocumentationLink() string
func (*DuplicateAccessModifierError) Error ¶ added in v1.7.0
func (*DuplicateAccessModifierError) Error() string
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
func (e *DuplicateAccessModifierError) SuggestFixes(_ string) []errors.SuggestedFix[ast.TextEdit]
type DuplicateViewModifierError ¶ added in v1.7.0
func (*DuplicateViewModifierError) DocumentationLink ¶ added in v1.7.0
func (*DuplicateViewModifierError) DocumentationLink() string
func (*DuplicateViewModifierError) Error ¶ added in v1.7.0
func (*DuplicateViewModifierError) Error() string
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
func (e *DuplicateViewModifierError) SuggestFixes(_ string) []errors.SuggestedFix[ast.TextEdit]
type Error ¶
func (Error) ChildErrors ¶
type ExpressionDepthLimitReachedError ¶
ExpressionDepthLimitReachedError is reported when the expression depth limit was reached
func (ExpressionDepthLimitReachedError) EndPosition ¶
func (e ExpressionDepthLimitReachedError) EndPosition(_ common.MemoryGauge) ast.Position
func (ExpressionDepthLimitReachedError) Error ¶
func (ExpressionDepthLimitReachedError) Error() string
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 ¶ added in v1.7.0
func (*InvalidAccessModifierError) DocumentationLink() string
func (*InvalidAccessModifierError) EndPosition ¶ added in v1.7.0
func (e *InvalidAccessModifierError) EndPosition(_ common.MemoryGauge) ast.Position
func (*InvalidAccessModifierError) Error ¶ added in v1.7.0
func (e *InvalidAccessModifierError) Error() string
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
InvalidEntitlementSeparatorError is reported when an invalid token is used as an entitlement separator.
func (*InvalidEntitlementSeparatorError) DocumentationLink ¶ added in v1.7.0
func (*InvalidEntitlementSeparatorError) DocumentationLink() string
func (*InvalidEntitlementSeparatorError) EndPosition ¶ added in v1.7.0
func (e *InvalidEntitlementSeparatorError) EndPosition(_ common.MemoryGauge) ast.Position
func (*InvalidEntitlementSeparatorError) Error ¶ added in v1.7.0
func (e *InvalidEntitlementSeparatorError) Error() string
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 ¶ added in v1.7.0
func (*InvalidIntegerLiteralError) DocumentationLink() string
func (*InvalidIntegerLiteralError) Error ¶
func (e *InvalidIntegerLiteralError) Error() string
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 (e *InvalidNativeModifierError) Error() string
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
func (e *InvalidNativeModifierError) SuggestFixes(_ string) []errors.SuggestedFix[ast.TextEdit]
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 (e *InvalidStaticModifierError) Error() string
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
func (e *InvalidStaticModifierError) SuggestFixes(_ string) []errors.SuggestedFix[ast.TextEdit]
type InvalidViewModifierError ¶ added in v1.7.0
type InvalidViewModifierError struct {
Pos ast.Position
DeclarationKind common.DeclarationKind
}
func (*InvalidViewModifierError) DocumentationLink ¶ added in v1.7.0
func (*InvalidViewModifierError) DocumentationLink() string
func (*InvalidViewModifierError) EndPosition ¶ added in v1.7.0
func (e *InvalidViewModifierError) EndPosition(_ common.MemoryGauge) ast.Position
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
MemberAccessMissingNameError is reported when a member access is missing a name.
func (*MemberAccessMissingNameError) DocumentationLink ¶ added in v1.7.0
func (*MemberAccessMissingNameError) DocumentationLink() string
func (*MemberAccessMissingNameError) EndPosition ¶ added in v1.7.0
func (e *MemberAccessMissingNameError) EndPosition(_ common.MemoryGauge) ast.Position
func (*MemberAccessMissingNameError) Error ¶ added in v1.7.0
func (e *MemberAccessMissingNameError) Error() string
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 ¶
func (*MissingCommaInParameterListError) DocumentationLink ¶ added in v1.7.0
func (*MissingCommaInParameterListError) DocumentationLink() string
func (*MissingCommaInParameterListError) EndPosition ¶
func (e *MissingCommaInParameterListError) EndPosition(_ common.MemoryGauge) ast.Position
func (*MissingCommaInParameterListError) Error ¶
func (*MissingCommaInParameterListError) Error() string
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
func (e *MissingCommaInParameterListError) SuggestFixes(_ string) []errors.SuggestedFix[ast.TextEdit]
type MissingConformanceError ¶ added in v1.7.0
MissingConformanceError is reported when a colon for conformances is present, but no conformances follow.
func (*MissingConformanceError) DocumentationLink ¶ added in v1.7.0
func (*MissingConformanceError) DocumentationLink() string
func (*MissingConformanceError) EndPosition ¶ added in v1.7.0
func (e *MissingConformanceError) EndPosition(_ common.MemoryGauge) ast.Position
func (*MissingConformanceError) Error ¶ added in v1.7.0
func (*MissingConformanceError) Error() string
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
MissingEnumCaseNameError is reported when an enum case is missing a name.
func (*MissingEnumCaseNameError) DocumentationLink ¶ added in v1.7.0
func (*MissingEnumCaseNameError) DocumentationLink() string
func (*MissingEnumCaseNameError) EndPosition ¶ added in v1.7.0
func (e *MissingEnumCaseNameError) EndPosition(_ common.MemoryGauge) ast.Position
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
func (*NonNominalTypeError) DocumentationLink ¶ added in v1.7.0
func (*NonNominalTypeError) DocumentationLink() string
func (*NonNominalTypeError) EndPosition ¶ added in v1.7.0
func (e *NonNominalTypeError) EndPosition(_ common.MemoryGauge) ast.Position
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
func (*PrivAccessError) DocumentationLink ¶ added in v1.7.0
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
func (*PubAccessError) DocumentationLink ¶ added in v1.7.0
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 ¶
func (*RestrictedTypeError) DocumentationLink ¶ added in v1.7.0
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 ¶ added in v1.7.0
func (*SpecialFunctionReturnTypeError) DocumentationLink() string
func (*SpecialFunctionReturnTypeError) Error ¶ added in v1.7.0
func (e *SpecialFunctionReturnTypeError) Error() string
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
func (e *SpecialFunctionReturnTypeError) SuggestFixes(code string) []errors.SuggestedFix[ast.TextEdit]
type StatementSeparationError ¶ added in v1.7.0
StatementSeparationError is reported when two statements on the same line are not separated by a semicolon.
func (*StatementSeparationError) DocumentationLink ¶ added in v1.7.0
func (*StatementSeparationError) DocumentationLink() string
func (*StatementSeparationError) EndPosition ¶ added in v1.7.0
func (e *StatementSeparationError) EndPosition(_ common.MemoryGauge) ast.Position
func (*StatementSeparationError) Error ¶ added in v1.7.0
func (*StatementSeparationError) Error() string
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
func (e *StatementSeparationError) SuggestFixes(_ string) []errors.SuggestedFix[ast.TextEdit]
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 (*SyntaxError) DocumentationLink ¶ added in v1.7.0
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 ¶
TypeDepthLimitReachedError is reported when the type depth limit was reached
func (TypeDepthLimitReachedError) EndPosition ¶
func (e TypeDepthLimitReachedError) EndPosition(_ common.MemoryGauge) ast.Position
func (TypeDepthLimitReachedError) Error ¶
func (TypeDepthLimitReachedError) Error() string
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
UnexpectedEOFError is reported when the end of the program is reached unexpectedly
func (UnexpectedEOFError) DocumentationLink ¶ added in v1.7.0
func (UnexpectedEOFError) DocumentationLink() string
func (UnexpectedEOFError) EndPosition ¶ added in v1.7.0
func (e UnexpectedEOFError) EndPosition(_ common.MemoryGauge) ast.Position
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
UnexpectedTokenAtEndError is reported when there is an unexpected token at the end of the program
func (*UnexpectedTokenAtEndError) DocumentationLink ¶ added in v1.7.0
func (*UnexpectedTokenAtEndError) DocumentationLink() string
func (*UnexpectedTokenAtEndError) EndPosition ¶ added in v1.7.0
func (e *UnexpectedTokenAtEndError) EndPosition(_ common.MemoryGauge) ast.Position
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 ¶ added in v1.7.0
func (*WhitespaceAfterMemberAccessError) DocumentationLink() string
func (*WhitespaceAfterMemberAccessError) EndPosition ¶ added in v1.7.0
func (e *WhitespaceAfterMemberAccessError) EndPosition(_ common.MemoryGauge) ast.Position
func (*WhitespaceAfterMemberAccessError) Error ¶ added in v1.7.0
func (e *WhitespaceAfterMemberAccessError) Error() string
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
func (e *WhitespaceAfterMemberAccessError) SuggestFixes(_ string) []errors.SuggestedFix[ast.TextEdit]