sannybuilder / dev

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

Shorthand Combination of const...end and var...end #352

Closed Aldrin-John-Olaer-Manalansan closed 2 months ago

Aldrin-John-Olaer-Manalansan commented 2 months ago

SB only allows this:

const
    MYACTOR      = 31@
    MYWEAPON     = 30@
    MYPOSITION_Z = 29@
    MYPOSITION_Y = 28@
    MYPOSITION_X = 27@
end
var
    MYACTOR:        int
    MYWEAPON:       int
    MYPOSITION_Z: float
    MYPOSITION_Y: float
    MYPOSITION_X: float
end

Can you implement a shorthand version? For example:

var
    float MYACTOR      = 31@
    float MYWEAPON     = 30@
    float MYPOSITION_Z = 29@
    float MYPOSITION_Y = 28@
    float MYPOSITION_X = 27@
end
x87 commented 2 months ago

Just define variables using [type] [name] declaration. Let the compiler manage variable allocations.

float MYACTOR, MYWEAPON, MYPOSITION_Z, MYPOSITION_Y, MYPOSITION_X 

https://tutorial.sannybuilder.com/variables/ https://docs.sannybuilder.com/language/data-types/variables#local-variables