sannybuilder / dev

Sanny Builder Bug Tracker and Roadmap development
https://sannybuilder.com
48 stars 0 forks source link

nested expressions #283

Open x87 opened 11 months ago

x87 commented 11 months ago
0@ = read_memory ((get_this_script_struct) + 0x10) size 4 virtual_protect 0

where (expr) essentially means: take the left-hand side variable and make a new command var = code

    0@ = get_this_script_struct
    0@ += 0x10
    0@ = read_memory 0@ size 4 virtual_protect 0

another example:

nlvar0 = WEAPONTYPE_SHOTGUN * SIZEOF_CWEAPONINFO
nlvar0 += aWeaponInfo
nlvar0 = Memory.Read(nlvar0, DWORD, false)

nlvar0 = Memory.Read(((WEAPONTYPE_SHOTGUN * SIZEOF_CWEAPONINFO) + aWeaponInfo), DWORD, false)

Originally posted by @x87 in https://github.com/sannybuilder/dev/issues/243#issuecomment-1697819960

MiranDMC commented 11 months ago

Some nested expressions will require use of temporal local variable to perform. In showed example it uses return value of the host expression. What in case when parent operation does not return value, or there are multiple nested expressions exceeding number of return arguments, or return arguments are also used as input value?

x87 commented 11 months ago

What in case when parent operation does not return value, or there are multiple nested expressions exceeding number of return arguments, or return arguments are also used as input value?

then this syntax won't be allowed.

adding temporary variables and supporting complex expressions would require more variables with #270