1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//! A fast JavaScript parser. Currently only a [lexical analyzer](lex/index.html) and a [skipper](skip/index.html).

#![cfg_attr(test, feature(test))]

#![warn(missing_docs)]
#![doc(html_root_url = "https://docs.rs/esparse/0.0.4")]

#[macro_use]
extern crate matches;
extern crate memchr;

#[macro_use]
pub mod lex;
pub mod skip;
pub mod ast;

pub use ast::{Loc, Span};

#[doc(hidden)]
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
pub struct ParseOptions<'a> {
    pub first_line: usize,
    pub file_name: &'a str,
}

impl<'a> Default for ParseOptions<'a> {
    fn default() -> Self {
        ParseOptions {
            first_line: 0,
            file_name: "<input>",
        }
    }
}

#[doc(hidden)]
pub fn parse_script(_input: &str, _options: ParseOptions) -> ! {
    unimplemented!()
}
#[doc(hidden)]
pub fn parse_module(_input: &str, _options: ParseOptions) -> ! {
    unimplemented!()
}
#[doc(hidden)]
pub fn parse_expr(_input: &str, _options: ParseOptions) -> ! {
    unimplemented!()
}

#[cfg(test)]
mod tests {
}