rokucommunity / brighterscript

A superset of Roku's BrightScript language
MIT License
162 stars 46 forks source link

Implement all Scenegraph field types as types in BrighterScript [V1] #545

Closed markwpearce closed 8 months ago

markwpearce commented 2 years ago

SceneGraph has a bunch of field types that could also be "first-class" types in Brighterscript.

From https://developer.roku.com/en-ca/docs/references/scenegraph/xml-elements/interface.md --

Type Description Done/Notes
integer, int BrightScript integer type ✔️ (only integer)
longinteger BrightScript longinteger type ✔️
float BrightScript float type ✔️
string, str BrightScript string type ✔️ (only string)
Boolean, bool BrightScript Boolean type ✔️ (only boolean)
vector2d X/Y coordinate array could be implemented as float[]
color Color type is this a string or an int?
time Time type what even is this?
uri A URL identifier could be string
node SceneGraph node object reference Best to wait until we have full typing of built-in components (e.g. #435)
floatarray Array of float ✔️ float[] - requires TypeExpression lookup
intarray Array of integer ✔️ integer[] - requires TypeExpression lookup
boolarray Array of Boolean ✔️ boolean[] - requires TypeExpression lookup
stringarray Array of string ✔️ string[] - requires TypeExpression lookup
vector2darray Array of vector2d ✔️ vector2d[] - requires TypeExpression lookup
colorarray Array of color Can be completed once color is defined
timearray Array of time Can be completed once time is defined
nodearray Array of SceneGraph node object reference Can be completed once node is defined
assocarray Associative array This is a special case of object - will benefit from #435
array Array of objects - type specifier can be either array or roArray ✔️ - will benefit from #435
rect2D An associative array with 4 float values: (x, y, width, height)x and y represent the coordinates of the top left corner of the rectangle basically an interface!
rect2DArray Array of rect2D associative arrays Can be completed once rect2d is defined

Concerns:

These are really common words, (time, color, etc)... perhaps the actual keyword could be something like timeType... Another option is to put them in a namespace: SceneGraph.time ... etc.

markwpearce commented 8 months ago

Completed, as of #1016