binding

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Binder

type Binder struct {
	// contains filtered or unexported fields
}

Binder matches nearby comments to parsed graph nodes. @intent attach normalized and parsed annotations to nodes based on source proximity

func NewBinder

func NewBinder() *Binder

NewBinder creates a Binder with the Look-Between binding strategy. @intent compose the normalizer and parser used during comment-to-node binding

func (*Binder) Bind

func (b *Binder) Bind(comments []CommentBlock, nodes []graph.Node, language string, sourceLines []string) []Binding

Bind associates comment blocks with nodes when they appear immediately above declarations. @intent build node-to-annotation bindings from parsed comments and node positions @domainRule gap=1 always binds; gap>1 binds only if all lines between are blank (Look-Between) @ensures file nodes bind only the first leading comment block when present @see binding.hasCodeBetween

type Binding

type Binding struct {
	Node       graph.Node
	Annotation *graph.Annotation
}

Binding connects a parsed node with its resolved annotation payload. @intent represent the result of associating one comment block with one graph node

type CommentBlock

type CommentBlock struct {
	StartLine      int
	EndLine        int
	Text           string
	IsDocstring    bool // Python docstring 여부 (true이면 OwnerStartLine으로 바인딩)
	OwnerStartLine int  // docstring이 귀속된 심볼의 StartLine (모듈 docstring은 0)
}

CommentBlock records a contiguous source comment range for later binding. @intent preserve comment text with source line bounds during parse-to-annotation binding

Jump to

Keyboard shortcuts

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