Skip to main content

Module parser

Module parser 

Source
Expand description

Recursive descent parser for the nautilus schema language.

This module provides a parser that transforms a stream of tokens into an AST.

§Example

use nautilus_schema::{Lexer, Parser};

let source = r#"
    model User {
      id    Int    @id
      email String @unique
    }
"#;

let tokens = Lexer::new(source).collect::<Result<Vec<_>, _>>().unwrap();
let schema = Parser::new(&tokens, source).parse_schema().unwrap();

Structs§

Parser
Parser for schema files.