Module ryan::parser

source ·
Expand description

The Ryan language per se, with parsing and evaluating functions and the types building the Abstract Syntax Tree.

Structs

  • An operation involving two Ryan expressions and a binary operator.
  • A block of Ryan code. This consists of a list of statements and a return expression at the end.
  • An association of string values to Ryan values.
  • An entry of a post-parsing error, logged by ErrorLogger.
  • A logger of errors that happen post-parsing. Post parsing always succeeds, even with a list of errors. It’s the whole parsing processing that fails if there are post-parsing errors.
  • An error that happens during the execution of a Ryan program.
  • An import statement.
  • An entry of a dictionary expression.
  • A Python-style list comprehension. This is the nearest thing to for statement that you will get in Ryan.
  • A pattern matching a dictionary entry. This can take the form of x, which binds the value associated to the key x to the variable x or x: pattern which bind the value associated with xto another pattern. Of note is that, in this position, pattern cannot be an identifier pattern.
  • Error when the user tries to iterate over non-iterable values.
  • An error raised when a Value has no counterpart in JSON, e.g., a type or a pattern match rule.
  • A general parsing error.
  • A pattern match rule introduced by a biding.
  • An operation involving a Ryan expression and a postfix operator.
  • An operation involving a Ryan expression and a prefix operator.

Enums

  • An operation involving two Ryan values.
  • A binding is a let ... = ...; or a type ... = ...; statement that creates new variables, types and patterns.
  • Transformations of Ryan values.
  • The way the imported value should be imported into Ryan.
  • A literal Ryan value.
  • An expression expecting a certain structure of a given value and optionally binding variables to selected bits and pieces of this value.
  • An operation involving one Ryan value, where the value precedes it.
  • An operation involving one Ryan value, where the value follows it.
  • The type of a Ryan value.
  • Ans expression returning a concrete Ryan type.
  • A Ryan value.

Functions

  • Executes a block in a given environment, returning the resulting value.
  • Parses a Ryan string and returns an abstract syntax tree (AST) object, represented by its root, a Block.