Minor refactorings to Nodes.hpp

1. Convenience ctor for Id
2. Clean spaces and redudant things.
This commit is contained in:
Stefano Sanfilippo 2015-03-07 14:06:16 +01:00
parent 0f5c138948
commit e476446e75

View File

@ -82,6 +82,9 @@ private:
class Id: public SimpleExpression { class Id: public SimpleExpression {
public: public:
explicit Id(std::string *c): value(c) {} explicit Id(std::string *c): value(c) {}
explicit Id(char const* c) {
value = Pointer<std::string>(new std::string(c));
}
virtual bool emit(Emitter *emitter) const { virtual bool emit(Emitter *emitter) const {
return emitter->emit(*this); return emitter->emit(*this);
@ -307,7 +310,6 @@ private:
Pointer<PointerList<Expression>> args; Pointer<PointerList<Expression>> args;
}; };
class BranchCase { class BranchCase {
public: public:
BranchCase(SemiExpression *c, PointerList<Statement> *b): condition(c), body(b) {} BranchCase(SemiExpression *c, PointerList<Statement> *b): condition(c), body(b) {}
@ -462,7 +464,6 @@ namespace std {
template<> template<>
struct hash<monicelli::Module> { struct hash<monicelli::Module> {
public:
size_t operator ()(const monicelli::Module &e) const noexcept { size_t operator ()(const monicelli::Module &e) const noexcept {
return e.hash(); return e.hash();
} }