-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improved code reuse and fixed some incorrect tag names in XML code ge…
…neration. Added normalization step to lua/XML code generation that adds required plugins and components. Updated type data files from the DSLTypeExtractor to the newest version.
- Loading branch information
Showing
17 changed files
with
324 additions
and
207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
...versiaScript/trans/codegen/lua/luagen.str → ...rsiaScript/trans/codegen/lua/generate.str
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
module codegen/lua/normalise | ||
|
||
imports | ||
|
||
include/DiversiaScript | ||
|
||
signatures | ||
|
||
rules // Normalisation rules that add plugins and components to objects to make them work with lua/game xml. | ||
|
||
normalise-luaxml(|mediaDir): Start(imports, pluginDefs, objectDefs, eventDefs) -> | ||
Start(imports, pluginDefs', <map(normalise-luaxml)> objectDefs, eventDefs) | ||
where pluginDefs' := <concat> [ // Add PermissionManager, ResourceManager and Lua plugin. | ||
pluginDefs, | ||
[ | ||
PluginDef("ResourceManager", ResourceManager(), [ | ||
PluginProp(ResourceManager(), Type(), EnumValueRef(ResourceLocationType(), FileSystem())), | ||
PluginProp(ResourceManager(), ResourceLocation(), StrConst(mediaDir)) | ||
]), | ||
PluginDef("LevelManager", LevelManager(), []) | ||
] | ||
] | ||
|
||
normalise-luaxml: ObjectDef(name, propAssigns, propDefs, componentDefs, varDefs, defaultStateDef, stateDefs, eventDefs) -> | ||
ObjectDef(name, propAssigns, propDefs, componentDefs', varDefs, defaultStateDef, stateDefs, eventDefs) | ||
where componentDefs' := <concat> [ // Add LuaObjectScript component. | ||
componentDefs, | ||
[ | ||
ComponentDef("LuaObjectScript", LuaObjectScript(), [ | ||
ComponentProp(LuaObjectScript(), ClientScriptFile(), StrConst($[gen/[name].lua])), | ||
ComponentProp(LuaObjectScript(), ClientSecurityLevel(), StrConst("Low")) | ||
]) | ||
] | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.