From f649096bc715541c6b861f13c6710eda970b78ce Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 14 Oct 2010 00:27:15 +0000 Subject: Prefix internal "me" parameter with underscore. git-svn-id: http://svn.drobilla.net/resp/resp@271 ad02d1e2-f140-0410-9f75-f8b11f17cedd --- src/lift.cpp | 8 ++++---- src/resp.hpp | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src') 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(loc, cenv.penv.sym("."), - cenv.penv.sym("me"), + cenv.penv.sym("_me"), new ALiteral(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(); 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()) { 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; } -- cgit v1.2.1