GlispGlisp
Home
Guide
Playground
  • Overview
  • Syntax
  • Types
  • Evaluation
  • Host API
API
  • English
  • 日本語
GitHub
Home
Guide
Playground
  • Overview
  • Syntax
  • Types
  • Evaluation
  • Host API
API
  • English
  • 日本語
GitHub
  • API

    • glisp
    • build
    • check
    • eval
    • expand
    • expectedType
    • infer
    • lex
    • parse
    • print
    • session
    • types

glisp


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
ParameterType
messagestring
sourcestring
positionnumber
Returns

ParseError

Overrides

Error.constructor

Properties

PropertyModifierType
positionreadonlynumber
sourcereadonlystring

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

ParameterType
srcstring

Returns

AST

Edit this page
Prev
lex
Next
print