Changes in / [62e456f:b5629d8]
- Files:
-
- 7 edited
-
src/ResolvExpr/AlternativeFinder.cc (modified) (1 diff)
-
src/ResolvExpr/Candidate.cpp (modified) (1 diff)
-
tests/.expect/castError.nast.txt (modified) (2 diffs)
-
tests/.expect/castError.oast.txt (modified) (4 diffs)
-
tests/errors/.expect/completeType.nast.x64.txt (modified) (2 diffs)
-
tests/meta/.expect/archVast.nast.x64.txt (modified) (2 diffs)
-
tests/meta/.expect/archVast.oast.x64.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
src/ResolvExpr/AlternativeFinder.cc
r62e456f rb5629d8 131 131 132 132 void printAlts( const AltList &list, std::ostream &os, unsigned int indentAmt ) { 133 std::vector<std::string> sorted; 134 sorted.reserve(list.size()); 135 for(const auto & c : list) { 136 std::stringstream ss; 137 c.print( ss, indentAmt ); 138 sorted.push_back(ss.str()); 139 } 140 141 std::sort(sorted.begin(), sorted.end()); 142 143 for ( const auto & s : sorted ) { 144 os << s << std::endl; 133 Indenter indent = { indentAmt }; 134 135 std::vector<int> idx; 136 idx.reserve(list.size()); 137 for(int i = 0; i < list.size(); i++) { idx.push_back(i); } 138 139 std::sort(idx.begin(), idx.end(), [&list](int lhs_idx, int rhs_idx) -> bool { 140 const auto & lhs = list.at(lhs_idx); 141 const auto & rhs = list.at(rhs_idx); 142 if(lhs.expr->location.startsBefore(rhs.expr->location)) return true; 143 if(rhs.expr->location.startsBefore(lhs.expr->location)) return false; 144 145 if(lhs.env.size() < rhs.env.size()) return true; 146 if(lhs.env.size() > rhs.env.size()) return false; 147 148 if(lhs.openVars.size() < rhs.openVars.size()) return true; 149 if(lhs.openVars.size() > rhs.openVars.size()) return false; 150 151 if(lhs.need.size() < rhs.need.size()) return true; 152 if(lhs.need.size() > rhs.need.size()) return false; 153 154 return false; 155 }); 156 157 for ( AltList::const_iterator i = list.begin(); i != list.end(); ++i ) { 158 i->print( os, indent ); 159 os << std::endl; 145 160 } 146 161 } -
src/ResolvExpr/Candidate.cpp
r62e456f rb5629d8 41 41 42 42 void print( std::ostream & os, const CandidateList & cands, Indenter indent ) { 43 std::vector<std::string> sorted; 44 sorted.reserve(cands.size()); 45 for(const auto & c : cands) { 46 std::stringstream ss; 47 print( ss, *c, indent ); 48 sorted.push_back(ss.str()); 49 } 50 51 std::sort(sorted.begin(), sorted.end()); 52 53 for ( const auto & s : sorted ) { 54 os << s << std::endl; 43 for ( const CandidateRef & cand : cands ) { 44 print( os, *cand, indent ); 45 os << std::endl; 55 46 } 56 47 } -
tests/.expect/castError.nast.txt
r62e456f rb5629d8 7 7 char Alternatives are: 8 8 Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of: 9 Variable Expression: f: double9 Variable Expression: f: signed int 10 10 ... with resolved type: 11 double11 signed int 12 12 ... to: 13 13 char … … 39 39 40 40 Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of: 41 Variable Expression: f: signed int41 Variable Expression: f: double 42 42 ... with resolved type: 43 signed int43 double 44 44 ... to: 45 45 char -
tests/.expect/castError.oast.txt
r62e456f rb5629d8 7 7 char Alternatives are: 8 8 Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of: 9 Variable Expression: f: double 9 Variable Expression: f: function 10 accepting unspecified arguments 11 ... returning nothing 12 10 13 with resolved type: 11 double 14 pointer to function 15 accepting unspecified arguments 16 ... returning nothing 17 12 18 ... to: 13 19 char … … 20 26 21 27 Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of: 22 Variable Expression: f: function 23 accepting unspecified arguments 24 ... returning nothing 25 28 Variable Expression: f: double 26 29 with resolved type: 27 pointer to function 28 accepting unspecified arguments 29 ... returning nothing 30 30 double 31 31 ... to: 32 32 char … … 67 67 with resolved type: 68 68 signed int 69 Variable Expression: v: signed short int69 Variable Expression: v: unsigned char 70 70 with resolved type: 71 signed short int71 unsigned char 72 72 with resolved type: 73 signed short int73 unsigned char 74 74 ... to: nothing 75 75 with resolved type: … … 85 85 with resolved type: 86 86 signed int 87 Variable Expression: v: unsigned char87 Variable Expression: v: signed short int 88 88 with resolved type: 89 unsigned char89 signed short int 90 90 with resolved type: 91 unsigned char91 signed short int 92 92 ... to: nothing 93 93 with resolved type: -
tests/errors/.expect/completeType.nast.x64.txt
r62e456f rb5629d8 9 9 ... with resolved type: 10 10 void Alternatives are: 11 Cost ( 0, 1, 2, 0, 1, -1, 0 ): Generated Cast of: 12 Application of 13 Variable Expression: *?: forall 14 DT: data type 15 function 16 ... with parameters 17 pointer to instance of type DT (not function type) 18 ... returning 19 reference to instance of type DT (not function type) 20 21 ... with resolved type: 22 pointer to forall 23 [unbound]:data type 24 function 25 ... with parameters 26 pointer to instance of type [unbound] (not function type) 27 ... returning 28 reference to instance of type [unbound] (not function type) 29 30 ... to arguments 31 Variable Expression: x: pointer to instance of struct B with body 32 ... with resolved type: 33 pointer to instance of struct B with body 34 35 ... with resolved type: 36 reference to instance of struct B with body 37 ... to: nothing 38 ... with resolved type: 39 void 40 (types: 41 void 42 ) 43 Environment:([unbound]) -> instance of struct B with body (no widening) 44 45 11 46 Cost ( 0, 1, 2, 0, 1, -1, 0 ): Generated Cast of: 12 47 Application of … … 42 77 ) 43 78 Environment:([unbound]) -> instance of struct A without body (no widening) 44 45 46 Cost ( 0, 1, 2, 0, 1, -1, 0 ): Generated Cast of:47 Application of48 Variable Expression: *?: forall49 DT: data type50 function51 ... with parameters52 pointer to instance of type DT (not function type)53 ... returning54 reference to instance of type DT (not function type)55 56 ... with resolved type:57 pointer to forall58 [unbound]:data type59 function60 ... with parameters61 pointer to instance of type [unbound] (not function type)62 ... returning63 reference to instance of type [unbound] (not function type)64 65 ... to arguments66 Variable Expression: x: pointer to instance of struct B with body67 ... with resolved type:68 pointer to instance of struct B with body69 70 ... with resolved type:71 reference to instance of struct B with body72 ... to: nothing73 ... with resolved type:74 void75 (types:76 void77 )78 Environment:([unbound]) -> instance of struct B with body (no widening)79 79 80 80 -
tests/meta/.expect/archVast.nast.x64.txt
r62e456f rb5629d8 7 7 char Alternatives are: 8 8 Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of: 9 Variable Expression: FX64: double9 Variable Expression: FX64: signed int 10 10 ... with resolved type: 11 double11 signed int 12 12 ... to: 13 13 char … … 39 39 40 40 Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of: 41 Variable Expression: FX64: signed int41 Variable Expression: FX64: double 42 42 ... with resolved type: 43 signed int43 double 44 44 ... to: 45 45 char -
tests/meta/.expect/archVast.oast.x64.txt
r62e456f rb5629d8 7 7 char Alternatives are: 8 8 Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of: 9 Variable Expression: FX64: double 9 Variable Expression: FX64: function 10 accepting unspecified arguments 11 ... returning nothing 12 10 13 with resolved type: 11 double 14 pointer to function 15 accepting unspecified arguments 16 ... returning nothing 17 12 18 ... to: 13 19 char … … 20 26 21 27 Cost ( 1, 0, 0, 0, 0, 0, 0 ): Explicit Cast of: 22 Variable Expression: FX64: function 23 accepting unspecified arguments 24 ... returning nothing 25 28 Variable Expression: FX64: double 26 29 with resolved type: 27 pointer to function 28 accepting unspecified arguments 29 ... returning nothing 30 30 double 31 31 ... to: 32 32 char
Note:
See TracChangeset
for help on using the changeset viewer.