kross77 / as3-commons

Automatically exported from code.google.com/p/as3-commons
0 stars 0 forks source link

Invalid parsing of string operand when defining method body from source string. #135

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
Adding the method body by defining the assembly source fully as a string where 
opcode's operand is a string with spaces. For example:

 pushstring abra kadabra

generate an error "has incorrect number of operands, ...".

What is the expected output? What do you see instead?
In this case, anly 2 tokens should be parsed, 'pushstring' and 'abra kadabra'.

What version of the product are you using? On what operating system?
FLash CS6, win 7 x64

Please provide any additional information below.
So, in function Asm.convert(), I've replaced following line 
  var rawParams:Array = token.value.split(SINGLE_SPACE);
with
  var rawParams:Array = splitParams( token.value );

and created private method "splitParams". Now one can write operand like this:
  pushstring "abra kadabra"

Modified Asm.as file in attachment.

Original issue reported on code.google.com by wojm...@gmail.com on 6 Jan 2013 at 12:55

Attachments: