nar 0.0.8

Narc, a dependently-typed programming language with dependent pattern matching
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use std::str;

use minitt_util::io::read_file;

use nar::syntax::surf::{parse_str_err_printed, ExprDecl};

pub fn parse_file(file_arg: &str) -> Option<Vec<ExprDecl>> {
    // If cannot read input, return.
    let file_content = read_file(file_arg)?;
    // Read file
    let file_content_utf8 = str::from_utf8(file_content.as_slice()).unwrap();
    // Parse
    parse_str_err_printed(file_content_utf8)
}