diff options
author | David Robillard <d@drobilla.net> | 2010-10-14 00:27:15 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2010-10-14 00:27:15 +0000 |
commit | f649096bc715541c6b861f13c6710eda970b78ce (patch) | |
tree | 1156e75f8e8da75d6ac798ef8f1057985efa9f79 /src | |
parent | 0faa00e9dfd221016ad26b5629617949fcce4676 (diff) | |
download | resp-f649096bc715541c6b861f13c6710eda970b78ce.tar.gz resp-f649096bc715541c6b861f13c6710eda970b78ce.tar.bz2 resp-f649096bc715541c6b861f13c6710eda970b78ce.zip |
Prefix internal "me" parameter with underscore.
git-svn-id: http://svn.drobilla.net/resp/resp@271 ad02d1e2-f140-0410-9f75-f8b11f17cedd
Diffstat (limited to 'src')
-rw-r--r-- | src/lift.cpp | 8 | ||||
-rw-r--r-- | src/resp.hpp | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/lift.cpp b/src/lift.cpp index 939d529..b2ead08 100644 --- a/src/lift.cpp +++ b/src/lift.cpp @@ -31,7 +31,7 @@ AST* ASymbol::lift(CEnv& cenv, Code& code) throw() { if (!cenv.liftStack.empty() && cppstr == cenv.liftStack.top().fn->name) { - return cenv.penv.sym("me"); // Reference to innermost function + return cenv.penv.sym("_me"); // Reference to innermost function } else if (!cenv.penv.handler(true, cppstr) && !cenv.penv.handler(false, cppstr) && !cenv.code.innermost(this)) { @@ -40,7 +40,7 @@ ASymbol::lift(CEnv& cenv, Code& code) throw() // Replace symbol with code to access free variable from closure return tup<ADot>(loc, cenv.penv.sym("."), - cenv.penv.sym("me"), + cenv.penv.sym("_me"), new ALiteral<int32_t>(index, Cursor()), NULL); } else { @@ -109,7 +109,7 @@ AFn::lift(CEnv& cenv, Code& code) throw() cenv.pop(); // Set name of closure parameter to "me" - *impl->prot()->begin() = cenv.penv.sym("me"); + *impl->prot()->begin() = cenv.penv.sym("_me"); // Create definition for implementation fn ASymbol* implName = cenv.penv.sym(impl->name); @@ -157,7 +157,7 @@ ACall::lift(CEnv& cenv, Code& code) throw() ASymbol* sym = head()->to<ASymbol*>(); if (sym && !cenv.liftStack.empty() && sym->cppstr == cenv.liftStack.top().fn->name) { /* Recursive call to innermost function, call implementation directly, - * reusing the current "me" closure parameter (no cons or .). + * reusing the current "_me" closure parameter (no cons or .). */ copy->push_front(cenv.penv.sym(cenv.liftStack.top().implName)); } else if (head()->to<AFn*>()) { diff --git a/src/resp.hpp b/src/resp.hpp index 3145080..a7080fe 100644 --- a/src/resp.hpp +++ b/src/resp.hpp @@ -241,7 +241,7 @@ struct ALiteral : public AST { const T val; }; -/// Lexeme (any atom in the CST, e.g. "a", "3.4", ""hello"", etc. +/// Lexeme (any atom in the CST, e.g. "a", "3.4", ""hello"", etc.) struct ALexeme : public AST, public std::string { ALexeme(Cursor c, const string& s) : AST(c), std::string(s) {} bool operator==(const AST& rhs) const { return this == &rhs; } |