Skip to content

Generated functions.txt separate functions from constants #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Somebodyisnobody opened this issue Feb 14, 2022 · 1 comment
Open

Comments

@Somebodyisnobody
Copy link

Constants are shown with a [Function]-stanza in the generated functions.txt. To spearate constants from functions in legacyclonk/LegacyClonk#72 we need to export the constants with a [Constant]-stanza.

@Somebodyisnobody
Copy link
Author

Somebodyisnobody commented Feb 15, 2022

Functions are identified by the <func> tag in the corresponding xml:

def endElement(self, name):
self.statestack = self.statestack[:-1]
self.cur = self.cur.strip()
if name == 'type':
self.type = self.cur
elif name == 'name':
self.name = self.cur
elif name == 'title':
self.title = self.cur
elif name == 'rtype':
self.rtype = self.cur
elif name == 'desc':
self.desc = self.cur
elif name == 'func':
c4scripter.write("""[Function]
Name=%s
Return=%s
Parameter=%s
DescDE=%s
"""

<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<!DOCTYPE funcs SYSTEM "../../../clonk.dtd">
<?xml-stylesheet type="text/xsl" href="../../../clonk.xsl"?>
<funcs>
<func>
<title>C4D_All</title>
<category>Objekte</category><subcat>Kategorie</subcat>

it is an old penalty that constants are documented in <func> tags.
There are <constants> and <constant> tags required.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant