numscript

package module
v0.0.10 Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: MIT Imports: 3 Imported by: 0

README

Numscript CLI

Go codecov

Numscript is the DSL used to express financial transaction within the Formance ledger

The CLI in this repo allows you to play with numscript locally, check if there are parsing or logic errors in your numscript files, and run the numscript language server

The language server features include:

  • Diagnostics
  • Hover on values
  • Detect document symbols
  • Go to definition
Develop locally

You can update snaphshots with the UPDATE_SNAPS=true variable while running the tests

If you need to update the grammar, you can generate the parser using the generate-parser.sh script (you'll need to install the antlr4 command first)

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ParseErrorsToString = parser.ParseErrorsToString

Functions

This section is empty.

Types

type AccountBalance

type AccountBalance = interpreter.AccountBalance

type AccountMetadata

type AccountMetadata = interpreter.AccountMetadata

type AccountsMetadata

type AccountsMetadata = interpreter.AccountsMetadata

The newly defined account metadata after the execution

type BalanceQuery

type BalanceQuery = interpreter.BalanceQuery

For each account, list of the needed assets

type Balances

type Balances = interpreter.Balances

type ExecutionResult

type ExecutionResult = interpreter.ExecutionResult

type InterpreterError

type InterpreterError = interpreter.InterpreterError

type Metadata

type Metadata = interpreter.Metadata

The transaction metadata, set by set_tx_meta()

type MetadataQuery

type MetadataQuery = interpreter.MetadataQuery

type ParseResult

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

This struct represents a parsed numscript source code

func Parse

func Parse(code string) ParseResult

func (ParseResult) GetParsingErrors

func (p ParseResult) GetParsingErrors() []ParserError

func (ParseResult) GetSource

func (p ParseResult) GetSource() string

func (ParseResult) Run

func (ParseResult) RunWithFeatureFlags added in v0.0.10

func (p ParseResult) RunWithFeatureFlags(
	ctx context.Context,
	vars VariablesMap,
	store Store,
	featureFlags map[string]struct{},
) (ExecutionResult, InterpreterError)

type ParserError

type ParserError = parser.ParserError

type Posting

type Posting = interpreter.Posting

type StaticStore

type StaticStore = interpreter.StaticStore

type Store

type Store = interpreter.Store

type Value

type Value = interpreter.Value

type VariablesMap

type VariablesMap = interpreter.VariablesMap

Directories

Path Synopsis
internal
cmd
lsp

Jump to

Keyboard shortcuts

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