Crate koto_parser

Source
Expand description

Contains the parser and AST format used by the Koto language

Macros§

astvec
A convenience macro for initializing an AstVec Creates a SmallVec containing the arguments.

Structs§

Ast
A Koto program represented as an Abstract Syntax Tree
AstCatch
A catch block definition
AstFor
A for loop definition
AstIf
An if expression definition
AstIndex
The index type used by nodes in the Ast
AstNode
A Node in the Ast, along with its corresponding Span
AstString
A string definition
AstTry
A try expression definition
ConstantIndex
The type used to refer to constants in the ConstantPool
ConstantPool
A constant pool produced by the Parser for a Koto script
Error
An error that can be produced by the Parser
Function
A function definition
ImportItem
A node in an import item, see Node::Import
KString
The String type used by the Koto runtime
MatchArm
An arm in a match expression
Parser
Koto’s parser
Position
Represents a line/column position in a script
RawStringDelimiter
The delimiter used by a raw string
Span
A span is a range in the source code, represented by a start and end position
StringFormatOptions
The formatting options that are available for interpolated strings
StringSlice
String data with defined bounds
SwitchArm
An arm in a switch expression

Enums§

AstBinaryOp
An operation used in BinaryOp expressions
AstUnaryOp
An operation used in UnaryOp expressions
ChainNode
A node in a chained expression
Constant
A constant provided by a ConstantPool
MetaKeyId
A meta key
Node
A parsed node that can be included in the AST.
StringAlignment
Alignment options for formatted strings
StringContents
The contents of an AstString
StringNode
A node in a string definition
StringQuote
The type of quotation mark used in string delimiters
StringType
The string types that the lexer can produce

Functions§

format_source_excerpt
Renders the excerpt of the source corresponding to the given span

Type Aliases§

AstVec
The Vec type used in the AST
Result
The result type used by the Parser