Changes in src/ResolvExpr/CurrentObject.cc [56e49b0:ea6332d]
- File:
-
- 1 edited
-
src/ResolvExpr/CurrentObject.cc (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/CurrentObject.cc
r56e49b0 rea6332d 14 14 // 15 15 16 #include <stack> 17 #include <iostream> 18 16 #include <stddef.h> // for size_t 17 #include <cassert> // for assertf, assert, safe_dynamic_... 18 #include <iostream> // for ostream, operator<<, basic_ost... 19 #include <stack> // for stack 20 #include <string> // for string, operator<<, allocator 21 22 #include "Common/Indenter.h" // for Indenter, operator<< 23 #include "Common/SemanticError.h" // for SemanticError 24 #include "Common/utility.h" // for toString 19 25 #include "CurrentObject.h" 20 21 #include "SynTree/Declaration.h" 22 #include "SynTree/Initializer.h" 23 #include "SynTree/Type.h" 24 #include "SynTree/TypeSubstitution.h" 26 #include "SynTree/Constant.h" // for Constant 27 #include "SynTree/Declaration.h" // for ObjectDecl, Declaration, Struc... 28 #include "SynTree/Expression.h" // for InitAlternative, VariableExpr 29 #include "SynTree/Initializer.h" // for Designation, operator<< 30 #include "SynTree/Type.h" // for Type, StructInstType, UnionIns... 31 #include "SynTree/TypeSubstitution.h" // for TypeSubstitution 25 32 26 33 #if 0 … … 45 52 assertf( false, "unhandled type on getConstValue %s", toString( constExpr->get_result() ).c_str() ); // xxx - might be semantic error 46 53 } 47 }48 49 struct Indenter {50 static const int amt = 2;51 unsigned int indent = 0;52 53 Indenter & operator+=(int nlevels) { indent += amt*nlevels; return *this; }54 Indenter & operator-=(int nlevels) { indent -= amt*nlevels; return *this; }55 Indenter operator+(int nlevels) { Indenter indenter = *this; return indenter += nlevels; }56 Indenter operator-(int nlevels) { Indenter indenter = *this; return indenter -= nlevels; }57 Indenter & operator++() { return *this += 1; }58 Indenter & operator--() { return *this -= 1; }59 };60 std::ostream & operator<<( std::ostream & out, Indenter & indent ) {61 return out << std::string(indent.indent, ' ');62 54 } 63 55
Note:
See TracChangeset
for help on using the changeset viewer.