-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b67945c
commit 2e1e8ad
Showing
5 changed files
with
45 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,16 @@ | ||
pub mod parser; | ||
use ast::Ast; | ||
use eval::eval; | ||
use parser::Parser; | ||
use parser::Rule; | ||
use pest::Parser as PestParser; | ||
|
||
pub mod ast; | ||
pub mod rational; | ||
pub mod eval; | ||
pub mod parser; | ||
pub mod rational; | ||
|
||
pub fn run(line: &str, env: &mut eval::Env) -> anyhow::Result<eval::Number> { | ||
let parse = Parser::parse(Rule::line, line)?; | ||
let ast = Ast::from_line(parse); | ||
eval(ast, env) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters