Skip to content

Commit

Permalink
simplify :multi generation
Browse files Browse the repository at this point in the history
  • Loading branch information
NotFound committed Aug 22, 2011
1 parent 662d3d9 commit 183e21d
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions winxedst1.winxed
Original file line number Diff line number Diff line change
Expand Up @@ -8890,7 +8890,7 @@ class FunctionStatement : FunctionBase
int start_idx = 0;
if (self.ismethod()) {
start_idx = 1;
multi_sig[0] = 'P';
multi_sig[0] = REGvar;
}
for (int i = 0; i < elements(params); i++) {
var param = params[i];
Expand Down Expand Up @@ -8946,18 +8946,12 @@ class FunctionStatement : FunctionBase
function emit_extra_modifiers(e)
{
if (self.is_multi) {
var table = {"P" : "pmc", "S" : "string", "I" : "int", "N" : "num"};
var multi_sig = self.multi_sig;
e.print(' :multi(');
if (elements(multi_sig) == 0) {
e.print(')');
return;
}
string first = multi_sig[0];
e.print(table[first]);
for (int i = 1; i < elements(multi_sig); i++) {
string mod = string(multi_sig[i]);
e.print(', ' + string(table[mod]));
string sep = '';
for (string mod in multi_sig) {
e.print(sep, typetopirname(mod));
sep = ', ';
}
e.print(')');
}
Expand Down

0 comments on commit 183e21d

Please sign in to comment.