4 index = 'cwg_index.html'
5 output = 'cxx_dr_status.html'
6 dr_test_dir = '../test/CXX/drs'
10 elif len(sys.argv) == 2:
13 print >>sys.stderr, 'Usage: make_drs [<path to cwg_index.html>]'
17 def __init__(self, section, issue, url, status, title):
18 self.section, self.issue, self.url, self.status, self.title = \
19 section, issue, url, status, title
21 return '%s (%s): %s' % (self.issue, self.status, self.title)
24 section, issue_link, status, title = [
25 col.split('>', 1)[1].split('</TD>')[0]
26 for col in dr.split('</TR>', 1)[0].split('<TD')[1:]
28 _, url, issue = issue_link.split('"', 2)
30 issue = int(issue.split('>', 1)[1].split('<', 1)[0])
31 title = title.replace('<issue_title>', '').replace('</issue_title>', '').strip()
32 return DR(section, issue, url, status, title)
34 status_re = re.compile(r'\bdr([0-9]+): (.*)')
36 for test_cpp in os.listdir(dr_test_dir):
37 test_cpp = os.path.join(dr_test_dir, test_cpp)
39 for match in re.finditer(status_re, file(test_cpp, 'r').read()):
40 status_map[int(match.group(1))] = match.group(2)
43 print >> sys.stderr, "warning:%s: no '// dr123: foo' comments in this file" % test_cpp
45 drs = sorted((parse(dr) for dr in file(index, 'r').read().split('<TR>')[2:]),
46 key = lambda dr: dr.issue)
47 out_file = file(output, 'w')
49 print >> out_file, '''\
50 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
51 "http://www.w3.org/TR/html4/strict.dtd">
54 <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
55 <title>Clang - C++ Defect Report Status</title>
56 <link type="text/css" rel="stylesheet" href="menu.css">
57 <link type="text/css" rel="stylesheet" href="content.css">
58 <style type="text/css">
59 .none { background-color: #FFCCCC }
60 .partial { background-color: #FFE0B0 }
61 .svn { background-color: #FFFF99 }
62 .full { background-color: #CCFF99 }
63 .na { background-color: #DDDDDD }
64 .open * { color: #AAAAAA }
65 //.open { filter: opacity(0.2) }
66 span:target { background-color: #FFFFBB; outline: #DDDD55 solid thin; }
67 th { background-color: #FFDDAA }
72 <!--#include virtual="menu.html.incl"-->
76 <!--*************************************************************************-->
77 <h1>C++ Defect Report Support in Clang</h1>
78 <!--*************************************************************************-->
79 <p>Last updated: $Date$</p>
81 <h2 id="cxxdr">C++ defect report implementation status</h2>
83 <p>This page tracks which C++ defect reports are implemented within Clang.</p>
85 <table width="689" border="1" cellspacing="0">
90 <th>Available in Clang?</th>
93 def availability(issue):
94 status = status_map.get(issue, 'unknown')
95 if status == 'unknown':
97 avail_style = ' class="none"'
100 avail_style = ' class="svn"'
101 elif status in ('3.1', '3.2', '3.3'):
102 avail = 'Clang %s' % status
103 avail_style = ' class="full"'
104 elif status == 'yes':
106 avail_style = ' class="full"'
107 elif status == 'partial':
109 avail_style = ' class="partial"'
112 avail_style = ' class="none"'
115 avail_style = ' class="na"'
116 elif status.startswith('sup '):
117 dup = int(status.split(' ', 1)[1])
118 avail = 'Superseded by %s' % dup
119 _, avail_style = availability(dup)
120 elif status.startswith('dup '):
121 dup = int(status.split(' ', 1)[1])
122 avail = 'Duplicate of %s' % dup
123 _, avail_style = availability(dup)
125 assert False, 'unknown status %s for issue %s' % (status, dr.issue)
126 return (avail, avail_style)
129 if dr.status in ('concepts',):
130 # Yeah, cool story bro.
132 if dr.status in ('open', 'concurrency', 'drafting', 'review', 'extension'):
133 # We may have to deal with these some day, but not yet.
134 row_style = ' class="open"'
135 avail = 'Not resolved'
137 assert dr.issue not in status_map, "have status for not-ready dr %s" % dr.issue
140 avail, avail_style = availability(dr.issue)
142 print >> out_file, '''\
144 <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/%s">%s</a></td>
147 <td%s align="center">%s</td>
148 </tr>''' % (row_style, dr.url, dr.issue, dr.status, dr.title, avail_style,
151 print >> out_file, '''\