Library
core
modules
Core Src Parser Std Util

Lawtext core references / core/src/parser/std/util

Module: core/src/parser/std/util

Table of contents

Type Aliases

Variables

Functions

Type Aliases

ValueRule

Ƭ ValueRule<TValue>: Rule<VirtualLine[], TValue, Env, Empty>

Type parameters

Name
TValue

Defined in

core/src/parser/std/util.ts:10 (opens in a new tab)


WithErrorRule

Ƭ WithErrorRule<TValue>: Rule<VirtualLine[], WithErrorValue<TValue>, Env, Empty>

Type parameters

Name
TValue

Defined in

core/src/parser/std/util.ts:12 (opens in a new tab)


WithErrorValue

Ƭ WithErrorValue<TValue>: Object

Type parameters

Name
TValue

Type declaration

NameType
errorsErrorMessage[]
valueTValue

Defined in

core/src/parser/std/util.ts:11 (opens in a new tab)

Variables

$DEDENT

Const $DEDENT: ValueRule<Dedent>

Defined in

core/src/parser/std/util.ts:26 (opens in a new tab)


$INDENT

Const $INDENT: ValueRule<Indent>

Defined in

core/src/parser/std/util.ts:14 (opens in a new tab)


$blankLine

Const $blankLine: Rule<VirtualLine[], { line: BlankLine ; type: BNK ; virtualIndentDepth: number ; virtualRange: [start: number, end: number] }, Env, Empty>

Defined in

core/src/parser/std/util.ts:38 (opens in a new tab)


$indentBlock

Const $indentBlock: ValueRule<VirtualLine[]>

Defined in

core/src/parser/std/util.ts:42 (opens in a new tab)


$optBNK_DEDENT

Const $optBNK_DEDENT: ValueRule<[...PhysicalLine[], Dedent]>

Defined in

core/src/parser/std/util.ts:30 (opens in a new tab)


$optBNK_INDENT

Const $optBNK_INDENT: ValueRule<[...PhysicalLine[], Indent]>

Defined in

core/src/parser/std/util.ts:18 (opens in a new tab)


captionControl

Const captionControl: ":caption:"

Defined in

core/src/parser/std/util.ts:229 (opens in a new tab)

Functions

isSingleParentheses

isSingleParentheses(line): null | __Parentheses

Parameters

NameType
lineVirtualLine | Line | SentencesArray

Returns

null | __Parentheses

Defined in

core/src/parser/std/util.ts:231 (opens in a new tab)


makeDoubleIndentBlockWithCaptureRule

makeDoubleIndentBlockWithCaptureRule<TValue>(ruleName, ruleRepeatedOneOrMore): Rule<VirtualLine[], WithErrorValue<TValue[]>, Env, Omit<Env & Omit<Env & Empty & { childrenAndErrors1: ({ errorLines: VirtualLine[] ; success: TValue } | { errorLines: VirtualLine[] = captured; success: null = null })[] } & { errors2: { errorLines: VirtualLine[] = captured; success: null = null }[] }, keyof Env>, keyof Env>>

Type parameters

Name
TValue

Parameters

NameType
ruleNamestring
ruleRepeatedOneOrMoreRule<VirtualLine[], TValue, Env, Empty>

Returns

Rule<VirtualLine[], WithErrorValue<TValue[]>, Env, Omit<Env & Omit<Env & Empty & { childrenAndErrors1: ({ errorLines: VirtualLine[] ; success: TValue } | { errorLines: VirtualLine[] = captured; success: null = null })[] } & { errors2: { errorLines: VirtualLine[] = captured; success: null = null }[] }, keyof Env>, keyof Env>>

Defined in

core/src/parser/std/util.ts:139 (opens in a new tab)


makeIndentBlockWithCaptureRule

makeIndentBlockWithCaptureRule<TValue>(ruleName, ruleRepeatedOneOrMore): Rule<VirtualLine[], WithErrorValue<TValue[]>, Env, Omit<Env & Omit<Env & Empty & { childrenAndErrors: ({ errorLines: VirtualLine[] ; success: TValue } | { errorLines: VirtualLine[] = captured; success: null = null })[] }, keyof Env>, keyof Env>>

Type parameters

Name
TValue

Parameters

NameType
ruleNamestring
ruleRepeatedOneOrMoreRule<VirtualLine[], TValue, Env, Empty>

Returns

Rule<VirtualLine[], WithErrorValue<TValue[]>, Env, Omit<Env & Omit<Env & Empty & { childrenAndErrors: ({ errorLines: VirtualLine[] ; success: TValue } | { errorLines: VirtualLine[] = captured; success: null = null })[] }, keyof Env>, keyof Env>>

Defined in

core/src/parser/std/util.ts:65 (opens in a new tab)