Expand description
Analyzing the syntax of a source file.
This module must hide all AST details from the rest of the codebase.
Modules§
- comment
- Convenient utilities to match comment in code.
- def
- Definitions of syntax structures.
- import
- Import resolution utilities.
- matcher
- Convenient utilities to match syntax structures of code.
Structs§
- Apply
Expr - Represents a function application expression.
- Args
Expr - Represents an arguments expression.
- BinInst
- A binary operation type.
- Comment
Group Matcher - A matcher that groups comments.
- Content
RefExpr - Represents a content reference expression.
- Content
SeqExpr - Represents a content sequence expression.
- DocComment
Matcher - A matcher that collects documentation comments.
- Docs
Decl - A documentation declaration linking a base declaration with type variables.
- Element
Expr - Represents an element expression.
- Expr
Info - Information about expressions in a source file.
- Expr
Info Repr - Representation of
ExprInfo
for a specific file. - ForExpr
- Represents a for loop expression.
- Func
Expr - Represents a function expression.
- Generated
Decl - A generated declaration with a unique definition ID.
- IfExpr
- Represents a conditional (if) expression.
- Import
Expr - Represents an import expression.
- Include
Expr - Represents an include expression.
- Index
Info - The information for the index.
- Interpret
Mode Iter - An iterator over the variants of InterpretMode
- LetExpr
- Represents a let binding expression.
- Module
Decl - A module declaration with name and file ID.
- Module
Dependency - The dependency information of a module (file).
- Name
Range Decl - A declaration with a name and range information.
- Pattern
Sig - Signature pattern for function parameters.
- RefExpr
- Represents a reference expression.
- Select
Expr - Represents a field selection expression.
- SetExpr
- Represents a set rule expression.
- Show
Expr - Represents a show rule expression.
- Span
Decl - A span-only declaration for anonymous constructs.
- Spanned
Decl - A declaration with an associated name and span location.
- Surrounding
Syntax Iter - An iterator over the variants of SurroundingSyntax
- UnInst
- A unary operation type.
- While
Expr - Represents a while loop expression.
Enums§
- ArgClass
- Classes of arguments that can be operated on by IDE functionality.
- ArgExpr
- Represents different kinds of function arguments.
- BadCompletion
Cursor - The cursor is on an invalid position for completion.
- Comment
Group Signal - A signal raised by the comment group matcher.
- Decl
- Represents different kinds of declarations in the language.
- DefClass
- Classes of def items that can be operated on by IDE functionality.
- DefKind
- Kind of a definition.
- Expr
- Represents different kinds of expressions in the language.
- Expr
Scope - Different types of scopes for expression evaluation.
- Field
Class - Classes of field syntax that can be operated on by IDE functionality.
- Interpret
Mode - A mode in which a text document is interpreted.
- Lexical
Kind - The kind of a lexical hierarchy recogized by the analyzers.
- Lexical
VarKind - The kind of a variable.
- Pattern
- Represents different kinds of patterns for destructuring.
- Previous
Decl - A declaration that is an ancestor of the given node or the previous sibling of some ancestor.
- Previous
Item - A node that is an ancestor of the given node or the previous sibling of some ancestor.
- Surrounding
Syntax - Classes of syntax context (outer syntax) that can be operated on by IDE
- Syntax
Class - Classes of syntax that can be operated on by IDE functionality.
- Syntax
Context - Classes of syntax context (outer syntax) that can be operated on by IDE functionality.
- UnaryOp
- The kind of unary operation.
- VarClass
- Classes of variable (access) syntax that can be operated on by IDE functionality.
Functions§
- adjust_
expr - Adjusts an expression node to a more suitable one for classification. It is not formal, but the following cases are forbidden:
- bad_
completion_ cursor - Checks if the cursor is on an invalid position for completion.
- cast_
include_ expr - Casts a node to a single include expression.
- classify_
context - Classifies the context (outer syntax) of the node that can be operated on by IDE functionality.
- classify_
context_ outer - Classifies the context (outer syntax) of the node by the outer node that can be operated on by IDE functionality.
- classify_
def - Classifies a definition strictly.
- classify_
def_ loosely - Classifies a definition loosely.
- classify_
syntax - Classifies node’s syntax (inner syntax) that can be operated on by IDE functionality.
- construct_
module_ dependencies - Construct the module dependencies of the given context.
- find_
module_ level_ docs - Extracts the module-level documentation from a source.
- find_
source_ by_ expr - Finds a source instance by its import node.
- first_
ancestor_ expr - Finds the first ancestor node that is an expression.
- get_
index_ info - Gets the index information for the source.
- interpret_
mode_ at - Determines the interpretation mode at the given position (context-sensitive).
- is_
ident_ like - Checks if the node can be recognized as an identifier.
- is_mark
- Checks if the node can be recognized as a mark.
- node_
ancestors - Returns the ancestor iterator of the given node.
- previous_
decls - Finds the previous declarations starting from the given position. It checks
PreviousItem
and returns the found declarations. - previous_
items - Finds the previous items (in the scope) starting from the given position
inclusively. See
PreviousItem
for the possible items. - resolve_
id_ by_ path - Resolves a file id by its import path.
- surrounding_
syntax - Determines the surrounding syntax of the node at the given position.
Type Aliases§
- BinExpr
- Type alias for binary expressions.
- Binary
Op - Type alias for binary operation types.
- Decl
Expr - Type alias for declaration expressions.
- Export
Map - Type alias for export maps.
- Expr
Route - Maps file identifiers to their lexical scopes for expression analysis routing.
- Lexical
Scope - Type alias for lexical scopes.
- UnExpr
- Type alias for unary expressions.