aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-10-13 21:24:01 +0000
committerDavid Robillard <d@drobilla.net>2009-10-13 21:24:01 +0000
commit2c750487213a8c6baed9bd90e8544b4f709fa3dc (patch)
tree2e77b39de4e1ee24d407b47732d1e1d5815e5a2d
parent2759e14c66c62e3b66cdd5af3e9914f72b32b5ee (diff)
downloadresp-2c750487213a8c6baed9bd90e8544b4f709fa3dc.tar.gz
resp-2c750487213a8c6baed9bd90e8544b4f709fa3dc.tar.bz2
resp-2c750487213a8c6baed9bd90e8544b4f709fa3dc.zip
Tidy.
git-svn-id: http://svn.drobilla.net/resp/tuplr@210 ad02d1e2-f140-0410-9f75-f8b11f17cedd
-rw-r--r--src/tuplr.hpp58
1 files changed, 29 insertions, 29 deletions
diff --git a/src/tuplr.hpp b/src/tuplr.hpp
index 7295c5e..313286a 100644
--- a/src/tuplr.hpp
+++ b/src/tuplr.hpp
@@ -195,7 +195,7 @@ struct AST : public Object {
virtual void lift(CEnv& cenv) {}
virtual CVal compile(CEnv& cenv) = 0;
string str() const { ostringstream ss; ss << this; return ss.str(); }
- template<typename T> T to() { return dynamic_cast<T>(this); }
+ template<typename T> T to() { return dynamic_cast<T>(this); }
template<typename T> T const to() const { return dynamic_cast<T const>(this); }
template<typename T> T as() {
T t = dynamic_cast<T>(this);
@@ -226,24 +226,24 @@ struct ALiteral : public AST {
const ALiteral<T>* r = rhs.to<const ALiteral<T>*>();
return (r && (val == r->val));
}
- void constrain(TEnv& tenv, Constraints& c) const;
- CVal compile(CEnv& cenv);
+ void constrain(TEnv& tenv, Constraints& c) const;
+ CVal compile(CEnv& cenv);
const T val;
};
/// String, e.g. ""a""
struct AString : public AST, public std::string {
AString(Cursor c, const string& s) : AST(c), std::string(s) {}
- bool operator==(const AST& rhs) const { return this == &rhs; }
- void constrain(TEnv& tenv, Constraints& c) const;
- CVal compile(CEnv& cenv) { return NULL; }
+ bool operator==(const AST& rhs) const { return this == &rhs; }
+ void constrain(TEnv& tenv, Constraints& c) const;
+ CVal compile(CEnv& cenv) { return NULL; }
};
/// Symbol, e.g. "a"
struct ASymbol : public AST {
- bool operator==(const AST& rhs) const { return this == &rhs; }
- void constrain(TEnv& tenv, Constraints& c) const;
- CVal compile(CEnv& cenv);
+ bool operator==(const AST& rhs) const { return this == &rhs; }
+ void constrain(TEnv& tenv, Constraints& c) const;
+ CVal compile(CEnv& cenv);
mutable LAddr addr;
const string cppstr;
private:
@@ -388,13 +388,13 @@ inline ostream& operator<<(ostream& out, const Subst& s) {
/// Fn (first-class function with captured lexical bindings)
struct AFn : public ATuple {
AFn(Cursor c, AST* ast, va_list args) : ATuple(c, ast, args) {}
- bool operator==(const AST& rhs) const { return this == &rhs; }
- void constrain(TEnv& tenv, Constraints& c) const;
- AST* cps(TEnv& tenv, AST* cont);
- void lift(CEnv& cenv);
- CVal compile(CEnv& cenv);
+ bool operator==(const AST& rhs) const { return this == &rhs; }
+ void constrain(TEnv& tenv, Constraints& c) const;
+ AST* cps(TEnv& tenv, AST* cont);
+ void lift(CEnv& cenv);
+ CVal compile(CEnv& cenv);
const ATuple* prot() const { return at(1)->to<const ATuple*>(); }
- ATuple* prot() { return at(1)->to<ATuple*>(); }
+ ATuple* prot() { return at(1)->to<ATuple*>(); }
/// System level implementations of this (polymorphic) fn
struct Impls : public list< pair<AType*, CFunc> > {
CFunc find(AType* type) const {
@@ -413,10 +413,10 @@ struct AFn : public ATuple {
struct ACall : public ATuple {
ACall(const ATuple* exp) : ATuple(*exp) {}
ACall(Cursor c, AST* ast, va_list args) : ATuple(c, ast, args) {}
- void constrain(TEnv& tenv, Constraints& c) const;
- AST* cps(TEnv& tenv, AST* cont);
- void lift(CEnv& cenv);
- CVal compile(CEnv& cenv);
+ void constrain(TEnv& tenv, Constraints& c) const;
+ AST* cps(TEnv& tenv, AST* cont);
+ void lift(CEnv& cenv);
+ CVal compile(CEnv& cenv);
};
/// Definition special form, e.g. "(def x 2)"
@@ -432,19 +432,19 @@ struct ADef : public ACall {
}
return sym;
}
- void constrain(TEnv& tenv, Constraints& c) const;
- AST* cps(TEnv& tenv, AST* cont);
- void lift(CEnv& cenv);
- CVal compile(CEnv& cenv);
+ void constrain(TEnv& tenv, Constraints& c) const;
+ AST* cps(TEnv& tenv, AST* cont);
+ void lift(CEnv& cenv);
+ CVal compile(CEnv& cenv);
};
/// Conditional special form, e.g. "(if cond thenexp elseexp)"
struct AIf : public ACall {
AIf(const ATuple* exp) : ACall(exp) {}
AIf(Cursor c, AST* ast, va_list args) : ACall(c, ast, args) {}
- void constrain(TEnv& tenv, Constraints& c) const;
- AST* cps(TEnv& tenv, AST* cont);
- CVal compile(CEnv& cenv);
+ void constrain(TEnv& tenv, Constraints& c) const;
+ AST* cps(TEnv& tenv, AST* cont);
+ CVal compile(CEnv& cenv);
};
/// Primitive (builtin arithmetic function), e.g. "(+ 2 3)"
@@ -457,9 +457,9 @@ struct APrimitive : public ACall {
return false;;
return true;
}
- void constrain(TEnv& tenv, Constraints& c) const;
- AST* cps(TEnv& tenv, AST* cont);
- CVal compile(CEnv& cenv);
+ void constrain(TEnv& tenv, Constraints& c) const;
+ AST* cps(TEnv& tenv, AST* cont);
+ CVal compile(CEnv& cenv);
};