const refs in compiler

This commit is contained in:
2024-01-03 16:33:53 +01:00
parent 7ae83db728
commit eeb6ca5f34
2 changed files with 4 additions and 4 deletions

View File

@@ -10,10 +10,10 @@
class Compiler {
public:
static Handle compile(Handle src, Handle fake_env = nullptr, Handle suffix = nullptr);
static Handle compile(const Handle &src, Handle fake_env = nullptr, const Handle &suffix = nullptr);
private:
static Handle findIndex(Handle symbol, Handle env);
static Handle findIndex(const Handle &symbol, const Handle &env);
};

View File

@@ -11,7 +11,7 @@
using namespace Command;
Handle Compiler::compile(Handle src, Handle fake_env, Handle suffix) {
Handle Compiler::compile(const Handle &src, Handle fake_env, const Handle &suffix) {
Handle out;
std::function<Handle(Handle)> compileArgsRaw = [&](Handle args) {
@@ -119,7 +119,7 @@ Handle Compiler::compile(Handle src, Handle fake_env, Handle suffix) {
out.splice(suffix);
return out;
}
Handle Compiler::findIndex(Handle symbol, Handle env) {
Handle Compiler::findIndex(const Handle &symbol, const Handle &env) {
int64_t frame = 1;
Handle curFrame = env;