glisp / parse
parse
Classes
ParseError
Defined in: parse.ts:62
Thrown by parse on a structural error (unexpected token, bad arity, malformed special form, etc.). Carries the full source text and the byte offset of the offending token so a host can render a positional error message.
Extends
Error
Constructors
Constructor
new ParseError(
message,source,position):ParseError
Defined in: parse.ts:63
Parameters
| Parameter | Type |
|---|---|
message | string |
source | string |
position | number |
Returns
Overrides
Error.constructor
Properties
| Property | Modifier | Type |
|---|---|---|
position | readonly | number |
source | readonly | string |
Functions
parse()
parse(
src):AST
Defined in: parse.ts:49
Parse Glisp source into an AST. Each node is stamped with a SourceRange so print(ast) round-trips back to the original verbatim text (modulo intentional source-canonicalization). Throws LexError (during tokenization) or ParseError (during structure parsing) on malformed input.
Parameters
| Parameter | Type |
|---|---|
src | string |