Skip to content

Commit

Permalink
binary version 1
Browse files Browse the repository at this point in the history
  • Loading branch information
Jesse Chen committed Oct 8, 2023
1 parent 77933df commit 9ecf03c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
12 changes: 12 additions & 0 deletions tests/cases/binaryExpression.pas
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
program Hello;
var a:Integer;
var b:Integer;
var c:Integer;
var d:Integer;
begin
a := 11;
b := 22;
c := 33;
d := (a+(c-b));
writeln(d);
end.
6 changes: 0 additions & 6 deletions tests/cases/left_recursive.pas

This file was deleted.

4 changes: 2 additions & 2 deletions tests/e2e.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ void printAssemblyMachineCode(T&& runtime) {
}

TEST(compiler_e2e, parser) {
std::ifstream t(workspace / "tests" / "cases" / "variable_assign.pas");
std::ifstream t(workspace / "tests" / "cases" / "binaryExpression.pas");
std::stringstream buffer;
buffer << t.rdbuf();
Tokenizer tokenizer(buffer.str());
Expand All @@ -54,7 +54,7 @@ TEST(compiler_e2e, parser) {
auto program = parser.parse();
auto fun = createJit(program->codegen());
std::cout << "ptr: " << std::hex<< (void*) fun << std::endl;
fun();
// fun();
// printAssemblyMachineCode(program->codegen());
}

Expand Down

0 comments on commit 9ecf03c

Please sign in to comment.