This repository has been archived by the owner on Mar 4, 2024. It is now read-only.
-
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
966292e
commit a6e3c63
Showing
7 changed files
with
55 additions
and
76 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 |
---|---|---|
@@ -0,0 +1,38 @@ | ||
use clutils::{file_handler::{Extension, FileHandler}, literal::Literal}; | ||
use evaluator::evaluator::Evaluator; | ||
use lexer::lexer::Lexer; | ||
use parser::parser::Parser; | ||
|
||
mod builtin; | ||
mod evaluator; | ||
mod lexer; | ||
mod parser; | ||
mod util; | ||
|
||
pub enum NexusExtensions { | ||
NX, | ||
} | ||
|
||
impl Literal for NexusExtensions { | ||
fn literal(self: &Self) -> &str { | ||
"nx" | ||
} | ||
} | ||
|
||
impl Extension for NexusExtensions { | ||
|
||
} | ||
|
||
pub fn run_interpreter(src: FileHandler) { | ||
let mut lexer = Lexer::new(src); | ||
|
||
let mut parser = match Parser::new(&mut lexer, true) { | ||
Ok(parser) => parser, | ||
Err(_) => todo!(), | ||
}; | ||
|
||
let ast = parser.parse_program(); | ||
|
||
let mut evaluator = Evaluator::new(); | ||
evaluator.eval_program(ast); | ||
} |
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
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,13 +1 @@ | ||
<<<<<<< HEAD | ||
foo :: func(x) { | ||
print(x) | ||
} | ||
|
||
foo(0) | ||
======= | ||
var x = [0, 0] | ||
|
||
loop i in 0..10 { | ||
print(i) | ||
} | ||
>>>>>>> parent of 9811e27 (rewrite enviroments) | ||
print("Good morning!") |