ParserAPI
Supported high-level parser surface. Tokenization, RPN conversion, and parser-stack machinery remain internal implementation details even though Nerdamer itself uses them across modules.
Members
create(): ParserAPIMethodCreates another parser facade backed by the shared parser configuration.
Returns
evaluate(str: string, values?: ParserValuesObject): ParserEntityMethodParses and evaluates Nerdamer notation with optional substitutions.
Parameters
| Name | Type | Description |
|---|---|---|
str | string | Nerdamer notation or expression-compatible input. |
values | ParserValuesObject | Values substituted by name while parsing. |
Returns
get(setting: K): indexedAccessMethodReturns one shared parser setting with the value type associated with that setting.
Parameters
| Name | Type | Description |
|---|---|---|
setting | K | — |
Returns
indexedAccess
getI(): stringMethodReturns the symbol currently used for the imaginary unit.
Returns
string
getPrecision(): numberMethodReturns the active Decimal precision.
Returns
number
isReserved(name: string): booleanMethodReturns whether Nerdamer currently reserves a variable or symbol name.
Parameters
| Name | Type | Description |
|---|---|---|
name | string | — |
Returns
boolean
parse(str: ExpressionInput, values?: ParserValuesObject): ParserEntityMethodParses Nerdamer notation with optional substitutions.
Parameters
| Name | Type | Description |
|---|---|---|
str | ExpressionInput | Nerdamer notation or expression-compatible input. |
values | ParserValuesObject | Values substituted by name while parsing. |
Returns
scopedBlock(setting: K, value: indexedAccess, callback: (): ParserEntity): ParserEntityMethodTemporarily changes one Boolean parser setting while a callback runs.
Parameters
| Name | Type | Description |
|---|---|---|
setting | K | Boolean setting name to change. |
value | indexedAccess | Temporary value for that setting. |
callback | (): ParserEntity | Work to perform before restoring the previous setting. |
Returns
set(setting: K, value: indexedAccess): ParserAPIMethodChanges one shared parser setting and returns the parser for chaining.
Parameters
| Name | Type | Description |
|---|---|---|
setting | K | Supported parser setting name. |
value | indexedAccess | Value associated with that setting. |
Returns
setConstants(constants: ParserConstants): voidMethodRegisters or removes parser constants.
Parameters
| Name | Type | Description |
|---|---|---|
constants | ParserConstants | Constant names mapped to values or deletion markers. |
Returns
void
setI(variable: string): ParserAPIMethodChanges the symbol used for the imaginary unit.
Parameters
| Name | Type | Description |
|---|---|---|
variable | string | New imaginary-unit symbol. |
Returns
setImaginary(variable: string): ParserAPIMethodAlias for ParserAPI.setI.
Parameters
| Name | Type | Description |
|---|---|---|
variable | string | New imaginary-unit symbol. |
Returns
setPrecision(precision: number): voidMethodChanges the Decimal precision used by numerical calculations.
Parameters
| Name | Type | Description |
|---|---|---|
precision | number | Significant decimal digits to retain. |
Returns
void
