internalast

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package internalast contains helpers shared by every per-language strategy implementation. Kept in a sub-package so that experimentation in one strategy can not accidentally widen the helper API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FindChildByType

func FindChildByType(n *sitter.Node, kind string) *sitter.Node

FindChildByType returns the first immediate child of n whose Type() equals kind.

func FirstLine

func FirstLine(s string) string

FirstLine returns the first line of s, useful as a signature fallback.

func HasModifier

func HasModifier(modifiers []string, m string) bool

HasModifier reports whether modifiers contains m.

func IsCapitalized

func IsCapitalized(name string) bool

IsCapitalized reports whether name begins with an uppercase ASCII letter. Useful for Go's export rule.

func NodeSpan

func NodeSpan(n *sitter.Node) astkit.LineRange

NodeSpan returns the 1-indexed inclusive line range covered by n.

func NodeText

func NodeText(n *sitter.Node, src []byte) string

NodeText returns the source text covered by n, clamped to src bounds.

func WalkChildren

func WalkChildren(n *sitter.Node, fn func(*sitter.Node))

WalkChildren invokes fn on every immediate child of n.

Types

This section is empty.

Jump to

Keyboard shortcuts

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