Class ParsingContext
Index
Constructors
Properties
Methods
Constructors
constructor
- new ParsingContext(
registry: ExpressionRegistry,
isConstantFunc: (expression: Expression) => boolean,
path?: number[],
expectedType?: Type | null,
scope?: Scope,
errors?: ExpressionParsingError[],
): ParsingContextParameters
- registry: ExpressionRegistry
- isConstantFunc: (expression: Expression) => boolean
Optionalpath: number[]OptionalexpectedType: Type | nullOptionalscope: ScopeOptionalerrors: ExpressionParsingError[]
Returns ParsingContext
Methods
checkSubtype
concat
- concat(
index: number,
expectedType?: Type | null,
bindings?: [string, Expression][],
): ParsingContextReturns a copy of this context suitable for parsing the subexpression at index
index, optionally appending to 'let' binding map.Note that
errorsproperty, intended for collecting errors while parsing, is copied by reference rather than cloned.Parameters
- index: number
OptionalexpectedType: Type | nullOptionalbindings: [string, Expression][]
Returns ParsingContext
error
parse
- parse(
expr: unknown,
index?: number,
expectedType?: Type | null,
bindings?: [string, Expression][],
options?: { typeAnnotation?: "assert" | "coerce" | "omit" },
): ExpressionParameters
- expr: unknown
the JSON expression to parse
Optionalindex: numberthe optional argument index if this expression is an argument of a parent expression that's being parsed
OptionalexpectedType: Type | nullOptionalbindings: [string, Expression][]Optionaloptions: { typeAnnotation?: "assert" | "coerce" | "omit" }
Returns Expression
- expr: unknown
Was this helpful?
State associated parsing at a given point in an expression tree.
Private