Documentation ¶
Index ¶
- Variables
- type FileParser
- func (fp *FileParser) AssertNodeType(nodeType string) []SyntaxError
- func (fp *FileParser) AstSource() *ast.Source
- func (fp *FileParser) ChildParserConsumingComments(node *sitter.Node) *FileParser
- func (fp *FileParser) ConsumeDocs() *ast.Docs
- func (fp *FileParser) CountFunction() int
- func (ex *FileParser) LocatableErrorf(kind string, format string, args ...interface{}) SyntaxError
- func (fp *FileParser) NewScopeChildParser(node *sitter.Node) *FileParser
- func (fp *FileParser) ParseBinaryExpr() (*ast.ExprOperatorBinary, []SyntaxError)
- func (fp *FileParser) ParseChildCommentIfNeeded(child *sitter.Node) bool
- func (fp *FileParser) ParseDataDeclaration() (*ast.DeclData, []SyntaxError)
- func (fp *FileParser) ParseDeclsIfGiven() ([]ast.Decl, []SyntaxError)
- func (fp *FileParser) ParseEnumCaseDeclaration() (*ast.DeclEnumCase, []ast.Decl, []SyntaxError)
- func (fp *FileParser) ParseEnumDeclaration() (*ast.DeclEnum, []ast.Decl, []SyntaxError)
- func (fp *FileParser) ParseExprArray() (*ast.ExprArray, []SyntaxError)
- func (fp *FileParser) ParseExprDict() (*ast.ExprDict, []SyntaxError)
- func (fp *FileParser) ParseExprMemberAccess() (*ast.ExprMemberAccess, []SyntaxError)
- func (fp *FileParser) ParseExprString() (*ast.ExprString, []SyntaxError)
- func (fp *FileParser) ParseExprTypeSwitch() (*ast.ExprTypeSwitch, []SyntaxError)
- func (fp *FileParser) ParseExpression() (ast.Expr, []SyntaxError)
- func (fp *FileParser) ParseExpressionIfGiven() (ast.Expr, []SyntaxError)
- func (fp *FileParser) ParseExternDeclaration() (*ast.Decl, []SyntaxError)
- func (fp *FileParser) ParseFieldDeclaration() (*ast.DeclField, []SyntaxError)
- func (fp *FileParser) ParseFloatExpr() (*ast.ExprFloat, []SyntaxError)
- func (fp *FileParser) ParseFunctionDeclaration() (*ast.DeclFunc, []SyntaxError)
- func (fp *FileParser) ParseFunctionExpr(name string) (*ast.ExprFunc, []SyntaxError)
- func (fp *FileParser) ParseGroupExpr() (*ast.ExprGroup, []SyntaxError)
- func (fp *FileParser) ParseImportDeclaration() (*ast.DeclImport, []SyntaxError)
- func (fp *FileParser) ParseIntExpr() (*ast.ExprInt, []SyntaxError)
- func (fp *FileParser) ParseInvocationExpr() (*ast.ExprInvocation, []SyntaxError)
- func (fp *FileParser) ParseLetDeclaration() (*ast.DeclConstant, []SyntaxError)
- func (fp *FileParser) ParseModuleDeclaration() (*ast.DeclModule, []SyntaxError)
- func (fp *FileParser) ParseParameterDeclaration() (*ast.DeclParameter, []SyntaxError)
- func (fp *FileParser) ParseParameterDeclarationList() ([]ast.DeclParameter, []SyntaxError)
- func (fp *FileParser) ParseSourceFile() (*ast.SourceFile, []SyntaxError)
- func (fp *FileParser) ParseUnaryExpr() (*ast.ExprOperatorUnary, []SyntaxError)
- func (fp *FileParser) SameScopeChildParser(node *sitter.Node) *FileParser
- func (ex *FileParser) SyntaxErrorOrConvert(err error) *SyntaxError
- func (ex *FileParser) SyntaxErrorf(format string, args ...interface{}) SyntaxError
- type GroupedSyntaxError
- type Parser
- type SourceLocation
- type SyntaxError
- type SyntaxParsingError
Constants ¶
This section is empty.
Variables ¶
View Source
var ( TYPE_NODE_SOURCE_FILE = "source_file" TYPE_NODE_MODULE_DECLARATION = "module_declaration" TYPE_NODE_IMPORT_DECLARATION = "import_declaration" TYPE_NODE_LET_DECLARATION = "let_declaration" TYPE_NODE_FUNCTION_DECLARATION = "function_declaration" TYPE_NODE_DATA_DECLARATION = "data_declaration" TYPE_NODE_EXTERN_DECLARATION = "extern_declaration" TYPE_NODE_DATA_PROPERTY_LIST = "data_property_list" TYPE_NODE_DATA_PROPERTY_VALUE = "data_property_value" TYPE_NODE_DATA_PROPERTY_FUNCTION = "data_property_function" TYPE_NODE_ENUM_DECLARATION = "enum_declaration" TYPE_NODE_ENUM_CASE_LIST = "enum_case_list" TYPE_NODE_COMPLEX_INVOCATION_EXPRESSION = "complex_invocation_expression" TYPE_NODE_SIMPLE_INVOCATION_EXPRESSION = "simple_invocation_expression" TYPE_NODE_UNARY_EXPRESSION = "unary_expression" TYPE_NODE_BINARY_EXPRESSION = "binary_expression" TYPE_NODE_MEMBER_ACCESS = "member_access" TYPE_NODE_TYPE_EXPRESSION = "type_expression" TYPE_NODE_TYPE_BODY = "type_body" TYPE_NODE_TYPE_CASE = "type_case" TYPE_NODE_STRING_LITERAL = "string_literal" TYPE_NODE_ESCAPE_SEQUENCE = "escape_sequence" TYPE_NODE_GROUP_LITERAL = "group_literal" TYPE_NODE_INT_LITERAL = "int_literal" TYPE_NODE_FLOAT_LITERAL = "float_literal" TYPE_NODE_ARRAY_LITERAL = "array_literal" TYPE_NODE_DICT_LITERAL = "dict_literal" TYPE_NODE_DICT_ENTRY = "dict_entry" TYPE_NODE_FUNCTION_LITERAL = "function_literal" TYPE_NODE_PARAMETER_LIST = "parameter_list" TYPE_NODE_IDENTIFIER = "identifier" TYPE_NODE_COMMENT = "comment" // alias TYPE_NODE_ENUM_CASE_REFERENCE = "enum_case_reference" // errors TYPE_NODE_ERROR = "ERROR" TYPE_NODE_MISSING = "MISSING" TYPE_NODE_UNEXPECTED = "UNEXPECTED" )
Functions ¶
This section is empty.
Types ¶
type FileParser ¶
type FileParser struct { ModuleName ast.ModuleName File string Node *sitter.Node Tree *sitter.Tree Source []byte Comments []string // contains filtered or unexported fields }
func NewFileParser ¶
func NewFileParser(moduleName ast.ModuleName, file string, node *sitter.Node, tree *sitter.Tree, source []byte) *FileParser
func (*FileParser) AssertNodeType ¶
func (fp *FileParser) AssertNodeType(nodeType string) []SyntaxError
func (*FileParser) AstSource ¶
func (fp *FileParser) AstSource() *ast.Source
func (*FileParser) ChildParserConsumingComments ¶
func (fp *FileParser) ChildParserConsumingComments(node *sitter.Node) *FileParser
func (*FileParser) ConsumeDocs ¶
func (fp *FileParser) ConsumeDocs() *ast.Docs
func (*FileParser) CountFunction ¶
func (fp *FileParser) CountFunction() int
func (*FileParser) LocatableErrorf ¶
func (ex *FileParser) LocatableErrorf(kind string, format string, args ...interface{}) SyntaxError
func (*FileParser) NewScopeChildParser ¶
func (fp *FileParser) NewScopeChildParser(node *sitter.Node) *FileParser
func (*FileParser) ParseBinaryExpr ¶
func (fp *FileParser) ParseBinaryExpr() (*ast.ExprOperatorBinary, []SyntaxError)
func (*FileParser) ParseChildCommentIfNeeded ¶
func (fp *FileParser) ParseChildCommentIfNeeded(child *sitter.Node) bool
func (*FileParser) ParseDataDeclaration ¶
func (fp *FileParser) ParseDataDeclaration() (*ast.DeclData, []SyntaxError)
func (*FileParser) ParseDeclsIfGiven ¶
func (fp *FileParser) ParseDeclsIfGiven() ([]ast.Decl, []SyntaxError)
func (*FileParser) ParseEnumCaseDeclaration ¶
func (fp *FileParser) ParseEnumCaseDeclaration() (*ast.DeclEnumCase, []ast.Decl, []SyntaxError)
func (*FileParser) ParseEnumDeclaration ¶
func (fp *FileParser) ParseEnumDeclaration() (*ast.DeclEnum, []ast.Decl, []SyntaxError)
func (*FileParser) ParseExprArray ¶
func (fp *FileParser) ParseExprArray() (*ast.ExprArray, []SyntaxError)
func (*FileParser) ParseExprDict ¶ added in v0.0.17
func (fp *FileParser) ParseExprDict() (*ast.ExprDict, []SyntaxError)
func (*FileParser) ParseExprMemberAccess ¶
func (fp *FileParser) ParseExprMemberAccess() (*ast.ExprMemberAccess, []SyntaxError)
func (*FileParser) ParseExprString ¶
func (fp *FileParser) ParseExprString() (*ast.ExprString, []SyntaxError)
func (*FileParser) ParseExprTypeSwitch ¶
func (fp *FileParser) ParseExprTypeSwitch() (*ast.ExprTypeSwitch, []SyntaxError)
func (*FileParser) ParseExpression ¶
func (fp *FileParser) ParseExpression() (ast.Expr, []SyntaxError)
func (*FileParser) ParseExpressionIfGiven ¶
func (fp *FileParser) ParseExpressionIfGiven() (ast.Expr, []SyntaxError)
func (*FileParser) ParseExternDeclaration ¶
func (fp *FileParser) ParseExternDeclaration() (*ast.Decl, []SyntaxError)
func (*FileParser) ParseFieldDeclaration ¶
func (fp *FileParser) ParseFieldDeclaration() (*ast.DeclField, []SyntaxError)
func (*FileParser) ParseFloatExpr ¶ added in v0.0.17
func (fp *FileParser) ParseFloatExpr() (*ast.ExprFloat, []SyntaxError)
func (*FileParser) ParseFunctionDeclaration ¶
func (fp *FileParser) ParseFunctionDeclaration() (*ast.DeclFunc, []SyntaxError)
func (*FileParser) ParseFunctionExpr ¶
func (fp *FileParser) ParseFunctionExpr(name string) (*ast.ExprFunc, []SyntaxError)
func (*FileParser) ParseGroupExpr ¶
func (fp *FileParser) ParseGroupExpr() (*ast.ExprGroup, []SyntaxError)
func (*FileParser) ParseImportDeclaration ¶
func (fp *FileParser) ParseImportDeclaration() (*ast.DeclImport, []SyntaxError)
func (*FileParser) ParseIntExpr ¶
func (fp *FileParser) ParseIntExpr() (*ast.ExprInt, []SyntaxError)
func (*FileParser) ParseInvocationExpr ¶
func (fp *FileParser) ParseInvocationExpr() (*ast.ExprInvocation, []SyntaxError)
func (*FileParser) ParseLetDeclaration ¶
func (fp *FileParser) ParseLetDeclaration() (*ast.DeclConstant, []SyntaxError)
func (*FileParser) ParseModuleDeclaration ¶
func (fp *FileParser) ParseModuleDeclaration() (*ast.DeclModule, []SyntaxError)
func (*FileParser) ParseParameterDeclaration ¶
func (fp *FileParser) ParseParameterDeclaration() (*ast.DeclParameter, []SyntaxError)
func (*FileParser) ParseParameterDeclarationList ¶
func (fp *FileParser) ParseParameterDeclarationList() ([]ast.DeclParameter, []SyntaxError)
func (*FileParser) ParseSourceFile ¶
func (fp *FileParser) ParseSourceFile() (*ast.SourceFile, []SyntaxError)
func (*FileParser) ParseUnaryExpr ¶
func (fp *FileParser) ParseUnaryExpr() (*ast.ExprOperatorUnary, []SyntaxError)
func (*FileParser) SameScopeChildParser ¶
func (fp *FileParser) SameScopeChildParser(node *sitter.Node) *FileParser
func (*FileParser) SyntaxErrorOrConvert ¶
func (ex *FileParser) SyntaxErrorOrConvert(err error) *SyntaxError
func (*FileParser) SyntaxErrorf ¶
func (ex *FileParser) SyntaxErrorf(format string, args ...interface{}) SyntaxError
type GroupedSyntaxError ¶
type GroupedSyntaxError struct {
Errors []SyntaxError
}
func NewGroupedSyntaxError ¶
func NewGroupedSyntaxError(errors []SyntaxError) GroupedSyntaxError
func (GroupedSyntaxError) Error ¶
func (err GroupedSyntaxError) Error() string
type Parser ¶
type Parser struct { }
func (*Parser) Parse ¶
func (*Parser) Parse(moduleName ast.ModuleName, file string, contents string) (*FileParser, []SyntaxError)
type SourceLocation ¶
type SyntaxError ¶
type SyntaxError struct { Kind string Message string SourceLocation SourceLocation }
func NewSyntaxError ¶
func (SyntaxError) Error ¶
func (err SyntaxError) Error() string
type SyntaxParsingError ¶
type SyntaxParsingError struct {
// contains filtered or unexported fields
}
func MakeSyntaxParsingError ¶
func MakeSyntaxParsingError(fileName string, source string, tree *sitter.Tree) *SyntaxParsingError
func (SyntaxParsingError) Error ¶
func (err SyntaxParsingError) Error() string
func (SyntaxParsingError) ErrorNodes ¶
func (e SyntaxParsingError) ErrorNodes(node *sitter.Node) []*sitter.Node
func (SyntaxParsingError) SyntaxErrors ¶
func (err SyntaxParsingError) SyntaxErrors() []SyntaxError
Source Files ¶
- file-parser.go
- node-types.go
- parse-comment.go
- parse-decl-data.go
- parse-decl-enum-case.go
- parse-decl-enum.go
- parse-decl-extern.go
- parse-decl-field.go
- parse-decl-function.go
- parse-decl-import.go
- parse-decl-let.go
- parse-decl-module.go
- parse-decl-parameter.go
- parse-decl.go
- parse-expr-array.go
- parse-expr-binary.go
- parse-expr-dict.go
- parse-expr-float.go
- parse-expr-function.go
- parse-expr-group.go
- parse-expr-identifier.go
- parse-expr-int.go
- parse-expr-invocation.go
- parse-expr-member-access.go
- parse-expr-string.go
- parse-expr-type-switch.go
- parse-expr-unary.go
- parse-expr.go
- parse-source-file.go
- parser.go
- syntax-error-group.go
- syntax-error.go
- syntax-parsing-error.go
Click to show internal directories.
Click to hide internal directories.