clice

package module
v0.0.0-...-56add83 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: MIT Imports: 9 Imported by: 0

README

CLICE

This is an integer only spreadsheet. It is zero-indexed. It can do multiplication, (integer) division, addition and subtraction. Parentheses are also supported.

It can save and load files. See the flags for help. spreadsheet -h

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CellID

func CellID(in string) (int, int, error)

Types

type Assignment

type Assignment struct {
	Identifier string
	Expression string
}

type Cell

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

func (*Cell) Column

func (cell *Cell) Column() int

func (*Cell) Error

func (cell *Cell) Error() string

func (*Cell) Expression

func (cell *Cell) Expression() string

func (*Cell) HasExpression

func (cell *Cell) HasExpression() bool

func (*Cell) ID

func (cell *Cell) ID() string

func (*Cell) MarshalJSON

func (cell *Cell) MarshalJSON() ([]byte, error)

func (*Cell) Row

func (cell *Cell) Row() int

func (*Cell) String

func (cell *Cell) String() string

type Column

type Column struct {
	Number int
}

func (Column) Label

func (column Column) Label() string

type EncodedCell

type EncodedCell struct {
	ID         string `json:"id"`
	Expression string `json:"ex"`
}

type EncodedTable

type EncodedTable struct {
	ColumnCount int           `json:"columns"`
	RowCount    int           `json:"rows"`
	Cells       []EncodedCell `json:"cells"`
}

type Row

type Row struct {
	Number int
}

func (Row) Label

func (row Row) Label() string

type Scope

type Scope struct {
	Table *Table
	// contains filtered or unexported fields
}

func (*Scope) Resolve

func (s *Scope) Resolve(ident string) (constant.Value, error)

type Table

type Table struct {
	ColumnLen int    `json:"columns"`
	RowLen    int    `json:"rows"`
	Cells     []Cell `json:"cells"`
}

func NewTable

func NewTable(columns, rows int) Table

func (*Table) Apply

func (table *Table) Apply(assignments ...Assignment) error

func (*Table) Cell

func (table *Table) Cell(column, row int) *Cell

func (*Table) Columns

func (table *Table) Columns() []Column

func (*Table) Evaluate

func (table *Table) Evaluate() error

func (*Table) Rows

func (table *Table) Rows() []Row

func (*Table) UnmarshalJSON

func (table *Table) UnmarshalJSON(in []byte) error

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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