1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
#![allow(dead_code)]

mod comment;
pub mod expression;
pub mod literals;
pub mod statement;
pub mod tokens;

use nom::{error::VerboseError, IResult};

use nom_locate::LocatedSpan;

use crate::parser::statement::{parse_block, Block};

pub type Span<'a> = LocatedSpan<&'a str>;

pub type Res<'a, O> = IResult<Span<'a>, O, VerboseError<Span<'a>>>;

/// Entry point to the parser, which parse the liva language
pub fn parse_source(input: Span) -> Res<Block> {
    parse_block(input)
}