We don't have official specifications about the language grammar other than the wiki page, scattered information across forums and discords, and observations from compiling the code with the tools provided.
Also, the same language is used for different game/engines and it may have differences between versions.
For these reasons a bunch of arbitrary and opinionated choices have been taken that may cause this grammar not to be 100% up to spec.
Here is a list of quirks, differences and unclear specifications
-
In Enforce, classes can be named with just a number, a string literal, an underscore and possibly more.
This grammar only allows an identifier to be a classname.
-
Whitespaces are not ignored
void foo() {
return // empty return
69; // statement_expression
}
With this grammar, the previous example would be parsed as only one return statement.
- In Enforce, arrays and enum entries can be separated by a newline rather than a comma.
This grammar doesn't allow it.
- Parenthesis can be omitted in instantiations
new SomeType;
- In Enforce, visibility modifiers are allowed (but unused?) for formal parameters
enum can be nested in classes (but not be used?)
- Generic types can be upper bounded by native only types, but no visible difference is noticed
7.1. Generic type with primitive upper bound, cannot be instantiated without a "wrong number of template parameters" compile error
- In Enforce, attributes list can be empty.
This grammar doesn't allow it
- More?
We don't have official specifications about the language grammar other than the wiki page, scattered information across forums and discords, and observations from compiling the code with the tools provided.
Also, the same language is used for different game/engines and it may have differences between versions.
For these reasons a bunch of arbitrary and opinionated choices have been taken that may cause this grammar not to be 100% up to spec.
Here is a list of quirks, differences and unclear specifications
In Enforce, classes can be named with just a number, a string literal, an underscore and possibly more.
This grammar only allows an
identifierto be a classname.Whitespaces are not ignored
With this grammar, the previous example would be parsed as only one return statement.
This grammar doesn't allow it.
new SomeType;enumcan be nested in classes (but not be used?)7.1. Generic type with primitive upper bound, cannot be instantiated without a "wrong number of template parameters" compile error
This grammar doesn't allow it