Jason McKesson  committed d32d93a

Updated spec files to include the extension that an enum comes from.

  • Participants
  • Parent commits 797e0c3

Comments (0)

Files changed (3)

File ConvertToXml.lua

 local specFilename, outputFilename, name, specVersion = ...
+if(not specVersion) then
+	print("Not enough arguments:");
+	print("Usage:");
+	print("\tspecFilename\tName of the Lua spec file.");
+	print("\toutputFile\tName of the XML file to write.");
+	print("\tname\t\tInternal name of the specification.");
+	print("\tspecVersion\tThe version of the specification.");
+	return -1;
 local specFile = dofile(specFilename);
 		if(enum.version) then xmlFile:AddAttribute("version", enum.version); end
 		if(enum.deprecated) then xmlFile:AddAttribute("deprecated", enum.deprecated); end
 		if(enum.removed) then xmlFile:AddAttribute("removed", enum.removed); end
+		if(enum.extensions) then
+			for i, ext in ipairs(enum.extensions) do
+				xmlFile:PushElement("ext");
+					xmlFile:AddAttribute("name", ext);
+				xmlFile:PopElement();
+			end
+		end

File GenAllXml.bat

+lua ConvertToXml.lua "glspecs\glspec.lua" "opengl.xml" OpenGL "4.2" 
+lua ConvertToXml.lua "glspecs\glxspec.lua" "glx.xml" GLX "1.3" 
+lua ConvertToXml.lua "glspecs\wglspec.lua" "wgl.xml" WGL "4.2" 
 <?xml version="1.0" encoding="UTF-8"?>
 <?oxygen RNGSchema="XML Spec Format.rnc" type="compact"?>
-<specification xmlns="" name="OpenGL" glversion="1.0" fileversion="1.0.1">
+<specification xmlns="" name="OpenGL" specversion="3.0" fileversion="1.0.1">
         <type-def typename="foo" C-lang="bar"></type-def>
         <ext name="bisco"/>
-        <enum name="AnEnumerator" value="0x04AF" version="1.1"/>
+        <enum name="AnEnumerator" value="0x04AF" version="1.1">
+            <ext name="bisco"/>
+        </enum>