-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
30 lines (24 loc) · 771 Bytes
/
main.cpp
File metadata and controls
30 lines (24 loc) · 771 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <iostream>
#include <string>
#include <fstream>
#include <dusl/utils/dusl_core.hpp>
#include <dusl/Context.hpp>
#include <dusl/utils/dusl_standard.hpp>
int main(const int argc, char* argv[])
{
if (argc < 2) {
std::cerr << "Usage: dusl [file]" << std::endl;
return 1;
}
const std::string file_name = argv[1];
dusl::Interpreter visitor;
dusl::Context global_context;
global_context.enterScope();
visitor.setContext(global_context);
dusl::loadSTL(visitor);
auto items = dusl::loadObjects(visitor); // keeping list of object so they dont die and get deleted
const bool success = dusl::runSingleFile(file_name, visitor);
// dusl::runRepl(visitor);
global_context.exitScope();
return success;
}