Skip to content

Commit

Permalink
removed replacedArgs, varArgs holds the same information
Browse files Browse the repository at this point in the history
  • Loading branch information
alexnask committed Feb 18, 2013
1 parent be6e3e6 commit d51dc56
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions source/rock/middle/FunctionCall.ooc
Expand Up @@ -76,13 +76,6 @@ FunctionCall: class extends Expression {


args := ArrayList<Expression> new() args := ArrayList<Expression> new()


/**
* Arguments of the call before they are replaced by the VarArg structure access.
* Stored to be resolved if the function call needs to be resolved again, as those
* arguments could need more resolving rounds too.
*/
replacedArgs: ArrayList<Expression>

/** /**
* The actual function declaration this call is calling. * The actual function declaration this call is calling.
* Note that this makes rock almost a linker too - it effectively * Note that this makes rock almost a linker too - it effectively
Expand Down Expand Up @@ -277,12 +270,13 @@ FunctionCall: class extends Expression {
} }


// resolve the arguments we replaced with the varArg structure access // resolve the arguments we replaced with the varArg structure access
if(replacedArgs) { if(varArgs) {
for(arg in replacedArgs) { for(arg in varArgs) {
response := resolveArg(arg, true) response := resolveArg(arg, true)
if(!response ok()) return response if(!response ok()) return response
} }
} }

trail pop(this) trail pop(this)
} }


Expand Down Expand Up @@ -898,10 +892,8 @@ FunctionCall: class extends Expression {
res throwError(CouldntAddBeforeInScope new(token, this, vaDecl, trail)) res throwError(CouldntAddBeforeInScope new(token, this, vaDecl, trail))
} }


replacedArgs = ArrayList<Expression> new(numVarArgs)
numVarArgs times(|| numVarArgs times(||
removedArg := args removeAt(args lastIndex()) args removeAt(args lastIndex())
replacedArgs add(removedArg)
) )
args add(VariableAccess new(vaDecl, token)) args add(VariableAccess new(vaDecl, token))
} }
Expand Down

0 comments on commit d51dc56

Please sign in to comment.