classifier

package
v1.8.14 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package classifier implements line classification for CalcMark

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IdentifierResolver

type IdentifierResolver interface {
	Has(name string) bool
}

IdentifierResolver checks whether a variable name is defined in the current evaluation context. This interface decouples the spec/classifier package from impl/interpreter, preserving the spec → impl dependency direction. impl/interpreter.Environment satisfies this interface.

type LineType

type LineType int

LineType represents the type of a line in a CalcMark document

const (
	Calculation LineType = iota
	Markdown
	Blank
)

func ClassifyLine

func ClassifyLine(line string, env IdentifierResolver) (LineType, error)

ClassifyLine classifies a line as CALCULATION, MARKDOWN, or BLANK. Returns an error for critical syntax errors (like inline octothorpe).

func (LineType) String

func (lt LineType) String() string

Jump to

Keyboard shortcuts

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