scip

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: MIT Imports: 7 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package scip reads the parts of a SCIP index that stacklit needs (documents, occurrences, symbol names) with a small hand-written protobuf decoder, so no protobuf dependency is added. Unknown fields are skipped.

Index

Constants

View Source
const (
	RoleDefinition = 0x1
)

Role bits on an occurrence, from the SCIP schema.

View Source
const SrcTag = "scip"

SrcTag is written into the src field of edges this package upgrades.

Variables

This section is empty.

Functions

This section is empty.

Types

type Document

type Document struct {
	Path        string
	Occurrences []Occurrence
}

Document is one indexed source file.

type Index

type Index struct {
	Documents []Document
}

Index is the decoded subset of a SCIP index.

func Load

func Load(path string) (*Index, error)

Load reads and decodes a .scip file.

func Parse

func Parse(data []byte) (*Index, error)

Parse decodes a SCIP index from its serialized bytes.

type Occurrence

type Occurrence struct {
	Line    int
	Symbol  string
	Roles   int32
	IsLocal bool
}

Occurrence is one symbol mention. Lines are zero-based like the format.

type Stats

type Stats struct {
	Upgraded        int // INFERRED edges now EXACT
	AlreadyExact    int // EXTRACTED edges the index also confirms
	StillInferred   int // INFERRED edges the index did not confirm
	UnmatchedFiles  int // indexed documents with no node in the graph
	DocumentsParsed int
}

Stats reports what Upgrade changed.

func Upgrade

func Upgrade(g *graph.SymGraph, idx *Index) Stats

Upgrade marks INFERRED edges EXACT when the SCIP data contains a reference from the edge's source to a symbol defined at the edge's target. It never adds or removes edges.

Jump to

Keyboard shortcuts

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