Anaminus / rbxmk

A tool for processing Roblox files.
MIT License
109 stars 11 forks source link

Implement generate scheme #3

Closed Anaminus closed 7 years ago

Anaminus commented 7 years ago

Generates data on the fly.

Scheme

Input only: Generating an output doesn't really make sense.

generate://<type>

Types:

The reference specifies the content of the generated data.

Instance

The reference has the following syntax:

root       = <class> { `;` <class> } [ `;` ]
class      = <name> `{` [ <properties> ] `}`
properties = <property> { `;` <property> } [ `;` ]
property   = <name> <type> `:` <value>
name       = <string>
type       = <string>
value      = <component> { `,` <component> } [ `,` ]
component  = <bool> | <number> | <string>
bool       = `true` | `false`
number     = ! a number !
string     = ! a string, possibly quoted with " or ', escaped with \ !

Problem: How to implement <value> Solution: Use rbxfile/declare: declare can fill in any value using only bools, numbers, and strings.

Property

The reference uses the <properties> syntax.

Value

The reference uses the <value> syntax.

Anaminus commented 7 years ago

Possibly a better property syntax:

property = <name> `:` <type> `=` <value>
Anaminus commented 7 years ago

If an API is provided, then <type> can be omitted from <property>.