EliotVU / UnrealScript-Language-Service

Bringing a work-in-progress intelliSense to ye olde UnrealScript :)
MIT License
48 stars 9 forks source link

Support special const values. #1

Closed EliotVU closed 5 years ago

EliotVU commented 5 years ago

UnrealScript has some quirky special const tokens such as "sizeof", "nameof", and "arraycount". Where "sizeof" in particular can only be used within a const declaration.

const CONST_SIZEOF = sizeof(Object);

const CONST_ARRAYCOUNT = arraycount(staticArray);

const CONST_CLASS = class'Object';

const CONST_VECT = vect(0,0,0);

const CONST_ROT = rot(0,0,0);

const CONST_RNG = rng(0,0);

const CONST_NAMEOF = nameof(staticArray);
EliotVU commented 5 years ago

Considering this as fixed because the original task was to recognize them when parsing and highlighting.

The special tokens are however not analyzed yet for use in expression analytics.