String assignment

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

String assignment

invin
My compiler is stuck at the string assignment translation. I have a few doubts, please help clear these

x="abcdef"
should I check in the compiler's Let x = y statement to figure out whether I need to do String assignment and then emit code like below in python or java:

for i = 1 to (str -1)
  codeWriter.writePush("push constant"+ str[0]
  codeWriter.writeCall("call String.appendChar 1")

Please explain?
Reply | Threaded
Open this post in threaded view
|

Re: String assignment

invin
Please ignore the above post