Expand description
Typed Rust bindings for Facebook’s Flow parser via QuickJS.
use flow_parser::FlowParser;
let parser = FlowParser::new().unwrap();
// Parse and get a typed AST
let ast = parser.parse("type Foo = string;").unwrap();
// Validate that source is syntactically valid Flow
parser.validate("type Bar = {| +x: number |}").unwrap();Structs§
- Flow
Parser - A reusable Flow parser instance backed by QuickJS.
- Identifier
- An identifier node.
- Object
Type Indexer - An indexer on an object type (
[key: K]: V). - Parse
Error - A parse error reported by the Flow parser.
- Position
- Line and column (both 1-based for line, 0-based for column, matching Flow convention).
- Program
- Root AST node returned by the Flow parser.
- Source
Location - Source location attached to a parse error.
- Type
Parameter Instantiation - Type parameter instantiation (
<T, U>). - Variance
- Variance annotation (
+= plus,-= minus).
Enums§
- Declaration
- A type-level declaration inside an export statement.
- Error
- Flow parser error.
- Object
Member - A member of an object type annotation.
- Property
Key - Property key — either an identifier or a string literal (for quoted keys).
- Statement
- Top-level statement in a Flow program.
- Type
Annotation - A Flow type annotation node.
- Variance
Kind - Variance direction.