diff --git a/debug.hpp b/debug.hpp index 73e6dae..53db68a 100644 --- a/debug.hpp +++ b/debug.hpp @@ -9,7 +9,6 @@ #ifdef SCL_DEBUG_MODE #define SCL_DEBUG_MSG(m) std::cout < #include @@ -28,4 +28,4 @@ namespace util { std::pair pos_to_line_offset(std::istream& file, const unsigned long long pos); } -#endif //DLANG_UTIL_HPP +#endif //SCL_UTIL_HPP diff --git a/vm/bc/exec_bc_instr.cpp b/vm/bc/exec_bc_instr.cpp index 62db61a..5c89980 100644 --- a/vm/bc/exec_bc_instr.cpp +++ b/vm/bc/exec_bc_instr.cpp @@ -116,7 +116,7 @@ void exec_bc_instr(Frame& f, BCInstr cmd) { return; case BCInstr::OPCode::VAL_EMPTY: - f.eval_stack.emplace_back(Value()); + f.eval_stack.emplace_back(); return; case BCInstr::OPCode::VAL_TRUE: f.eval_stack.emplace_back((ValueTypes::int_t) 1); @@ -264,7 +264,7 @@ void exec_bc_instr(Frame& f, BCInstr cmd) { } case BCInstr::OPCode::VAL_CATCH: - f.eval_stack.emplace_back(Value((NativeFunction*) f.gc_make(f))); + f.eval_stack.emplace_back((NativeFunction*) f.gc_make(f)); break; default: diff --git a/vm/global_ids.cpp b/vm/global_ids.cpp index d314ee1..0e2e8b1 100644 --- a/vm/global_ids.cpp +++ b/vm/global_ids.cpp @@ -55,7 +55,7 @@ class InputFn : public NativeFunction { cs->throw_error(gen_error_object("EOF-Error", "input not received", *cs)); // return value - cs->stack.back()->eval_stack.emplace_back(Value(inp)); + cs->stack.back()->eval_stack.emplace_back(inp); // unfreeze origin thread cs->stack.back()->rt->recv_msg(new UnfreezeCallStack(cs)); // die diff --git a/vm/lambda_return.hpp b/vm/lambda_return.hpp index edaaf25..4979ca5 100644 --- a/vm/lambda_return.hpp +++ b/vm/lambda_return.hpp @@ -2,8 +2,8 @@ // Created by tate on 23-05-20. // -#ifndef DLANG_LAMBDA_RETURN_HPP -#define DLANG_LAMBDA_RETURN_HPP +#ifndef SCL_LAMBDA_RETURN_HPP +#define SCL_LAMBDA_RETURN_HPP #include @@ -54,14 +54,14 @@ class LambdaReturnMsg : public RTMessage { // TODO: Once compiler is smart enough to detect BS, this can be optimized if (!this->stack_target || !this->frame_target) { - std::cout <<"invalid lambda return msg call "; + std::cerr <<"invalid lambda return msg call "; } while (this->stack_target->stack.back() != this->frame_target && !this->stack_target->stack.empty()) this->stack_target->stack.pop_back(); if (this->stack_target->stack.empty()) { - std::cout <<"o() called out of frame???\n"; + std::cerr <<"o() called out of frame???\n"; return; } @@ -77,7 +77,7 @@ class LambdaReturnMsg : public RTMessage { // i++; // don't pop frame_target... // if (i <= 0) { // // no longer on stack wtf?? -// std::cout << "o() called out of scope???"; +// std::cerr << "o() called out of scope???"; // // TODO: o() out of scope error // // @@ -132,4 +132,4 @@ class LambdaReturnNativeFn : public NativeFunction { void mark() override { } }; -#endif //DLANG_LAMBDA_RETURN_HPP +#endif //SCL_LAMBDA_RETURN_HPP diff --git a/vm/primitive_methods.cpp b/vm/primitive_methods.cpp index 65d431e..8e02b54 100644 --- a/vm/primitive_methods.cpp +++ b/vm/primitive_methods.cpp @@ -80,10 +80,10 @@ class StrSplitFn : public NativeClosure { auto* ret = f.gc_make(); std::string& str = *(std::string*)this->data; while ((next = str.find(delimiter, last)) != std::string::npos) { - ret->emplace_back(Value(str.substr(last, next-last))); + ret->emplace_back(str.substr(last, next-last)); last = next + 1; } - ret->emplace_back(Value(str.substr(last))); + ret->emplace_back(str.substr(last)); // Return list of tokens f.eval_stack.back() = Value(ret); diff --git a/vm/vm.cpp b/vm/vm.cpp index dbea363..efbf68d 100644 --- a/vm/vm.cpp +++ b/vm/vm.cpp @@ -104,7 +104,7 @@ VM::VM(std::vector lit_header, const std::vector& argv, st // Load argv auto* args = ::new(this->gc.alloc()) ValueTypes::list_t(); for (const std::string& s : argv) - args->emplace_back(Value(s)); + args->emplace_back(s); main.vars[main.i_id] = ::new(this->gc.alloc()) Value(args); main.vars[main.o_id] = ::new(this->gc.alloc()) Value( diff --git a/vm/vm.hpp b/vm/vm.hpp index f4f5c12..2b092fc 100644 --- a/vm/vm.hpp +++ b/vm/vm.hpp @@ -2,8 +2,8 @@ // Created by tate on 17-05-20. // -#ifndef DLANG_VM_HPP -#define DLANG_VM_HPP +#ifndef SCL_VM_HPP +#define SCL_VM_HPP #include #include @@ -314,4 +314,4 @@ namespace GC { */ -#endif //DLANG_VM_HPP +#endif //SCL_VM_HPP