solidity

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2026 License: AGPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package solidity parses .sol via the vendored tree-sitter-solidity grammar (see internal/parse/solidity/binding). Emits symbol-level spans for the retrieval layer:

  • contract/library/interface → KindContract / KindInterface
  • function (inside contract) → KindMethod ("Contract.fn")
  • free function (rare, 0.7.4+) → KindFunction
  • constructor → KindMethod ("Contract.constructor")
  • modifier → KindModifier
  • event → KindEvent
  • struct → KindStruct
  • enum → KindType

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parser

type Parser struct{}

Parser implements parse.Parser for .sol files.

func New

func New() *Parser

New returns a stateless Solidity parser.

func (*Parser) Language

func (p *Parser) Language() string

func (*Parser) Parse

func (p *Parser) Parse(file string, src []byte) ([]cparse.SymbolSpan, error)

Parse extracts contract-scoped + top-level declarations. Walks named children of the source_unit; recurses into contract/library/interface bodies so methods get qualified names.

Directories

Path Synopsis
Package binding wraps tree-sitter-solidity (vendored from github.com/JoranHonig/tree-sitter-solidity v1.2.13, MIT-licensed — see ./LICENSE) into a *sitter.Language for go-tree-sitter.
Package binding wraps tree-sitter-solidity (vendored from github.com/JoranHonig/tree-sitter-solidity v1.2.13, MIT-licensed — see ./LICENSE) into a *sitter.Language for go-tree-sitter.

Jump to

Keyboard shortcuts

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