Note: this has been tested against the automated tests (such as they are), but not against the engine example (since it seems to be in a state of flux). Let me know if I should try to test against the engine before checking this in.
The big picture here is that any flavor of declaration is now allowed in any context where declarations are expected (global scope, body of a struct, body of a shader, etc.), and also any modifier keywords or attributes are allowed on any declaration (you can declare a public param int foo; at global scope).
It is (or rather, will be) up to later semantic analysis steps to rule out the cases that shouldn't be allowed, but we know that the parser won't stop us from supporting scenarios like:
Global variables
Member functions in struct types
Having component functions just be functions nested inside shader/module declarations
Note: this has been tested against the automated tests (such as they are), but not against the engine example (since it seems to be in a state of flux). Let me know if I should try to test against the engine before checking this in.
The big picture here is that any flavor of declaration is now allowed in any context where declarations are expected (global scope, body of a
struct
, body of ashader
, etc.), and also any modifier keywords or attributes are allowed on any declaration (you can declare apublic param int foo;
at global scope).It is (or rather, will be) up to later semantic analysis steps to rule out the cases that shouldn't be allowed, but we know that the parser won't stop us from supporting scenarios like:
struct
typesYou get the point.