Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

regler le bug des fonctions qui avaient des ->

  • Loading branch information...
commit c017ead58fa6e4a0c92bfa6aa18cb3ef6a3e2f8f 1 parent 9a831ac
Julien Desrosiers authored
Showing with 15 additions and 5 deletions.
  1. +15 −5 awesomephp.rb
20 awesomephp.rb
View
@@ -49,14 +49,19 @@ def defnode(name, params, body)
body
end
-def callnode(identifier, arglist, expression="")
+def callnode(identifier, arglist, expression)
if identifier=='new' && expression!='' && expression.instance_of?(GetConstantNode)
@f.write("$"+identifier+" = new ")
yield expression
@f.write("(")
- yield arglist
+ arglist.each_with_index do |arg, count|
+ yield arg
+ if count<(arglist.length-1)
+ @f.write(",")
+ end
+ end
@f.write(");\n")
- elsif expression!=''
+ elsif !(expression.nil?)
@f.write("$"+expression.to_s+"->"+identifier+"(")
arglist.each_with_index do |arg, count|
yield arg
@@ -67,7 +72,12 @@ def callnode(identifier, arglist, expression="")
@f.write(");\n")
else
@f.write(identifier+"(")
- yield arglist
+ arglist.each_with_index do |arg, count|
+ yield arg
+ if count<(arglist.length-1)
+ @f.write(",")
+ end
+ end
@f.write(");\n")
end
end
@@ -88,7 +98,7 @@ def setlocalnode(name, value)
@f.write(",")
end
end
- @f.write(")\n")
+ @f.write(");\n")
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.