plan9

package
v0.9.3 Latest Latest
Warning

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

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

Documentation

Overview

Package plan9 scans Plan 9 assembly (Go's asm dialect) source for TEXT and GLOBL symbol definitions.

Plan 9 asm has no viable tree-sitter grammar: existing asm grammars target GAS/NASM, while Plan 9 uses TEXT ·name(SB), pseudo-registers (SB/FP/SP/PC) and the middle dot. We only need symbol definitions, so a line scanner is more robust and dependency-free.

This package is intentionally dependency-free (no graph/index/resolve imports): both internal/index (AsmParser, same-language nodes) and internal/resolve (Plan9AsmResolver, the Go<->asm EAsm edge) need this scanner, and internal/index already imports internal/resolve — a shared leaf package is the only way to give both sides the scanner without an import cycle.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AsmSym

type AsmSym struct {
	Name  string // symbol name without the leading middle dot
	Kind  string // "text" or "globl"
	Line  int    // 1-based
	Frame string // raw frame/arg size suffix, e.g. "$0-56" (TEXT only)
}

AsmSym is one TEXT or GLOBL definition in a .s file.

func Scan

func Scan(src []byte) []AsmSym

Scan extracts symbol definitions from Plan 9 asm source.

Jump to

Keyboard shortcuts

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