Does anyone care if I change Box2DAS3 to use ASDoc style comments e.g.
This is a precursor to providing reference documentation specifically for the flash version Box2D.
I append the python file that does the conversion, for if people have difficulties merging patches made previously.
Code:
/**
* My comment
*/
* My comment
*/
This is a precursor to providing reference documentation specifically for the flash version Box2D.
I append the python file that does the conversion, for if people have difficulties merging patches made previously.
Code:
import os
import re
def cleanfile(filename):
print filename
out = ""
f = open(filename,'r')
indocs = False
indent = ""
for line in f:
a = re.search(r"^(\s*)///",line)
if a:
indent = a.group(1)
if not indocs:
out += indent +"/**\n"
out += re.sub(r"^(\s*)///\s*",r"\1* ",line)
indocs = True
else:
if indocs:
out += indent + "*/\n"
b = re.search(r"^(\s)*(.*)///<\s*(.*)",line)
if b:
out += b.group(1) +"/** "+b.group(3).strip().capitalize()+" */"
out += b.group(1) + b.group(2).strip();
else:
out += line
indocs = False
f.close()
f = open(filename,'w')
f.write(out)
f.close()
for dirpath,dirnames,filenames in os.walk("Source"):
for filename1 in filenames:
filename2 = os.path.join(dirpath,filename1)
if ".svn" not in filename2:
cleanfile(filename2)
import re
def cleanfile(filename):
print filename
out = ""
f = open(filename,'r')
indocs = False
indent = ""
for line in f:
a = re.search(r"^(\s*)///",line)
if a:
indent = a.group(1)
if not indocs:
out += indent +"/**\n"
out += re.sub(r"^(\s*)///\s*",r"\1* ",line)
indocs = True
else:
if indocs:
out += indent + "*/\n"
b = re.search(r"^(\s)*(.*)///<\s*(.*)",line)
if b:
out += b.group(1) +"/** "+b.group(3).strip().capitalize()+" */"
out += b.group(1) + b.group(2).strip();
else:
out += line
indocs = False
f.close()
f = open(filename,'w')
f.write(out)
f.close()
for dirpath,dirnames,filenames in os.walk("Source"):
for filename1 in filenames:
filename2 = os.path.join(dirpath,filename1)
if ".svn" not in filename2:
cleanfile(filename2)