Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nested expressions #283

Open
x87 opened this issue Oct 31, 2023 · 2 comments
Open

nested expressions #283

x87 opened this issue Oct 31, 2023 · 2 comments
Labels
priority:p2 Medium priority scope:compiler type:feature New feature or request
Milestone

Comments

@x87
Copy link
Collaborator

x87 commented Oct 31, 2023

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 #243 (comment)

@x87 x87 added type:feature New feature or request priority:p2 Medium priority scope:compiler labels Oct 31, 2023
@MiranDMC
Copy link

MiranDMC commented Nov 2, 2023

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
Copy link
Collaborator Author

x87 commented Nov 2, 2023

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

@x87 x87 added this to the v4.1.0 milestone Aug 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority:p2 Medium priority scope:compiler type:feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants