Add a <class> comment tag for classes not named after their source files.
Johnny C. Lam [04-06-14 - 18:46]
Add a <class> comment tag for classes not named after their source files.
The syntax is:
<class name="ClassName" />
<class name="ClassName" inherits="ParentClassName" />
Replace "--inherits" with the new <class> tag.
git-svn-id: svn://svn.curseforge.net/wow/ovale/mainline/trunk@1267 d5049fe3-3747-40f7-a4b5-f36d6801af5f
diff --git a/OvaleFrame.lua b/OvaleFrame.lua
index c7ac3ce..32dcbce 100644
--- a/OvaleFrame.lua
+++ b/OvaleFrame.lua
@@ -10,7 +10,7 @@
local _, Ovale = ...
---inherits Frame
+--<class name="OvaleFrame" inherits="Frame" />
do
--<private-static-properties>
local AceGUI = LibStub("AceGUI-3.0")
diff --git a/OvaleIcone.lua b/OvaleIcone.lua
index 1c66742..9cb91ff 100644
--- a/OvaleIcone.lua
+++ b/OvaleIcone.lua
@@ -10,7 +10,7 @@
local _, Ovale = ...
---inherits ActionButtonTemplate
+--<class name="OvaleIcone" inherits="ActionButtonTemplate" />
--<private-static-properties>
local L = Ovale.L
diff --git a/compiler.pl b/compiler.pl
index e6d26f4..4c6e6a6 100644
--- a/compiler.pl
+++ b/compiler.pl
@@ -136,9 +136,15 @@ sub ParseDirectory
my %pp = {};
my %pm = {};
- if ($content =~ m/--inherits (\w+)/)
+ if ($content =~ m/--<class name="(\w+)"\s*\/>/)
{
- my $parent = $1;
+ $class = $1;
+ }
+
+ if ($content =~ m/--<class name="(\w+)"\s+inherits="(\w+)"\s*\/>/)
+ {
+ $class = $1;
+ my $parent = $2;
for my $prop (keys %{$sp{$parent}})
{
$sp{$class}{$prop} = $sp{$parent}{$prop}