hebi 0.4.0

A dynamic scripting language
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use super::*;

impl<'src> Parser<'src> {
  pub(super) fn module(mut self) -> Result<ast::Module<'src>, Vec<SpannedError>> {
    while !self.current().is(Tok_Eof) {
      if let Err(e) = self.top_level_stmt() {
        self.errors.push(e);
        self.sync();
      }
    }

    if !self.errors.is_empty() {
      return Err(self.errors);
    }

    Ok(self.module)
  }
}