44#include < optional>
55#include < string>
66#include < variant>
7- #include < lbd/fe /ast.h>
8- #include < lbd/fe /parser.h>
7+ #include < lbd/frontend /ast.h>
8+ #include < lbd/frontend /parser.h>
99#include < lbd/options.h>
1010
1111namespace intp ::interp {
@@ -18,7 +18,7 @@ namespace intp::interp {
1818 // / Runtime representation of Lambda-Expression.
1919 struct Closure {
2020 std::string parameter;
21- const fe::ast ::Expression *body; // / Non-owning, read-only AST pointer.
21+ const frontend ::Expression *body; // / Non-owning, read-only AST pointer.
2222 std::shared_ptr<Environment> environment; // / Environment at the time of Lambda-Expression creation.
2323
2424 [[nodiscard]] std::string toString () const ;
@@ -73,26 +73,26 @@ namespace intp::interp {
7373 // / Lazy-Thunk (call-by-need).
7474 struct Thunk : std::enable_shared_from_this<Thunk> {
7575 mutable std::optional<Value> cached;
76- const fe::ast ::Expression *expression = nullptr ; // / Non-owning, read-only AST pointer.
77- std::unique_ptr<fe::ast ::Expression> owned; // / Owning storage (when needed) (primarily in REPL).
76+ const frontend ::Expression *expression = nullptr ; // / Non-owning, read-only AST pointer.
77+ std::unique_ptr<frontend ::Expression> owned; // / Owning storage (when needed) (primarily in REPL).
7878 std::shared_ptr<Environment> environment; // / Environment for evaluating Expression.
79- std::optional<fe::loc::Loc > origin = std::nullopt ;
79+ std::optional<frontend::Location > origin = std::nullopt ;
8080
8181 Thunk () = default ;
8282
83- Thunk (const fe::ast ::Expression *expression, std::shared_ptr<Environment> environment,
84- std::optional<fe::loc::Loc > origin = std::nullopt );
83+ Thunk (const frontend ::Expression *expression, std::shared_ptr<Environment> environment,
84+ std::optional<frontend::Location > origin = std::nullopt );
8585
8686 // / Force computation on Thunk and return a const reference to Value.
8787 const Value &force () const ; // / Marked const as cached is mutable.
8888
8989 // / Sets Thunk's fields after construction.
9090 // / Allows for recursive reference.
91- void set (const fe::ast ::Expression *expression_, std::shared_ptr<Environment> environment_,
92- std::optional<fe::loc::Loc > origin_ = std::nullopt );
91+ void set (const frontend ::Expression *expression_, std::shared_ptr<Environment> environment_,
92+ std::optional<frontend::Location > origin_ = std::nullopt );
9393
94- void set_owned (fe::ast ::Expression expression_, std::shared_ptr<Environment> environment_,
95- std::optional<fe::loc::Loc > origin_ = std::nullopt );
94+ void set_owned (frontend ::Expression expression_, std::shared_ptr<Environment> environment_,
95+ std::optional<frontend::Location > origin_ = std::nullopt );
9696 };
9797
9898 struct Environment : std::enable_shared_from_this<Environment> {
@@ -108,11 +108,11 @@ namespace intp::interp {
108108 std::vector<std::vector<std::string> > toVector (bool force) const ;
109109 };
110110
111- Value evalExpression (const fe::ast ::Expression &expression, std::shared_ptr<Environment> environment);
111+ Value evalExpression (const frontend ::Expression &expression, std::shared_ptr<Environment> environment);
112112
113113 Value applyFunctionApplication (Value functionName, const std::vector<std::shared_ptr<Thunk> > &arguments,
114114 const std::shared_ptr<Environment> &callSiteEnvironment,
115- const std::optional<fe::loc::Loc > &callLocation = std::nullopt );
115+ const std::optional<frontend::Location > &callLocation = std::nullopt );
116116
117117 // / Program Driver.
118118 struct Result {
@@ -121,7 +121,7 @@ namespace intp::interp {
121121 ResultOptions options = {};
122122 };
123123
124- Result interpret (fe::ast ::Program &program, std::optional<std::shared_ptr<Environment> > globalEnvironment = std::nullopt ,
124+ Result interpret (frontend ::Program &program, std::optional<std::shared_ptr<Environment> > globalEnvironment = std::nullopt ,
125125 options::Options options_ = {});
126126
127127 // / Add builtins Native Functions into Environment.
0 commit comments