klang 0.2.0

The Klang programming language
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
pub mod parser;

use crate::parser::errors::ParseError;
use crate::parser::{parse_file, write_program_to_file};
use std::path::Path;

pub fn compile_file(file_path: &Path, output_path: &Path, binary: bool) -> Result<(), ParseError> {
    match parse_file(file_path) {
        Ok(program) => write_program_to_file(&program, output_path, binary),
        Err(e) => Err(e),
    }
}

pub fn compile_file_inplace(file_path: &Path, binary: bool) -> Result<(), ParseError> {
    compile_file(file_path, file_path.with_extension("ko").as_path(), binary)
}