|
43 | 43 | line = line.replace("(", "").replace("),", "").replace(")", "") |
44 | 44 | parts = line.split(",") |
45 | 45 | if len(parts) != 3: |
46 | | - print "unexpected number of components in line: " + original_line |
| 46 | + print "error: unexpected number of components in line: " + original_line |
47 | 47 | sys.exit(1) |
48 | 48 | feature_name = parts[0].strip().replace('"', "") |
49 | 49 | since = parts[1].strip().replace('"', "") |
|
102 | 102 | lib_features[feature_name] = feature_name |
103 | 103 | if lib_features_and_level.get((feature_name, level)) is None: |
104 | 104 | # Add it to the observed features |
105 | | - lib_features_and_level[(feature_name, level)] = (since, path, line_num, line) |
| 105 | + lib_features_and_level[(feature_name, level)] = \ |
| 106 | + (since, path, line_num, line) |
106 | 107 | else: |
107 | 108 | # Verify that for this combination of feature_name and level the 'since' |
108 | 109 | # attribute matches. |
109 | 110 | (expected_since, source_path, source_line_num, source_line) = \ |
110 | 111 | lib_features_and_level.get((feature_name, level)) |
111 | 112 | if since != expected_since: |
112 | | - print "mismatch in " + level + " feature '" + feature_name + "'" |
| 113 | + print "error: mismatch in " + level + " feature '" + feature_name + "'" |
113 | 114 | print "line " + str(source_line_num) + " of " + source_path + ":" |
114 | 115 | print source_line |
115 | 116 | print "line " + str(line_num) + " of " + path + ":" |
|
118 | 119 |
|
119 | 120 | # Verify that this lib feature doesn't duplicate a lang feature |
120 | 121 | if feature_name in language_feature_names: |
121 | | - print "lib feature '" + feature_name + "' duplicates a lang feature" |
| 122 | + print "error: lib feature '" + feature_name + "' duplicates a lang feature" |
122 | 123 | print "line " + str(line_num) + " of " + path + ":" |
123 | 124 | print line |
124 | 125 | errors = True |
125 | 126 |
|
126 | 127 | else: |
127 | | - print "misformed stability attribute" |
| 128 | + print "error: misformed stability attribute" |
128 | 129 | print "line " + str(line_num) + " of " + path + ":" |
129 | 130 | print line |
130 | 131 | errors = True |
|
141 | 142 | status = "unstable" |
142 | 143 | stable_since = None |
143 | 144 | partially_deprecated = False |
144 | | - |
| 145 | + |
145 | 146 | if f[2] == "Accepted": |
146 | 147 | status = "stable" |
147 | 148 | if status == "stable": |
|
165 | 166 | is_deprecated = lib_features_and_level.get((name, "deprecated")) is not None |
166 | 167 |
|
167 | 168 | if is_stable and is_unstable: |
168 | | - print "feature '" + name + "' is both stable and unstable" |
| 169 | + print "error: feature '" + name + "' is both stable and unstable" |
169 | 170 | errors = True |
170 | 171 |
|
171 | 172 | if is_stable: |
|
189 | 190 | for name in lib_feature_stats: |
190 | 191 | if language_feature_stats.get(name) is not None: |
191 | 192 | if not name in joint_features: |
192 | | - print "feature '" + name + "' is both a lang and lib feature but not whitelisted" |
| 193 | + print "error: feature '" + name + "' is both a lang and lib feature but not whitelisted" |
193 | 194 | errors = True |
194 | 195 | lang_status = lang_feature_stats[name][3] |
195 | 196 | lib_status = lib_feature_stats[name][3] |
|
199 | 200 | lib_partially_deprecated = lib_feature_stats[name][5] |
200 | 201 |
|
201 | 202 | if lang_status != lib_status and lib_status != "deprecated": |
202 | | - print "feature '" + name + "' has lang status " + lang_status + \ |
| 203 | + print "error: feature '" + name + "' has lang status " + lang_status + \ |
203 | 204 | " but lib status " + lib_status |
204 | 205 | errors = True |
205 | 206 |
|
|
208 | 209 | partially_deprecated = True |
209 | 210 |
|
210 | 211 | if lang_stable_since != lib_stable_since: |
211 | | - print "feature '" + name + "' has lang stable since " + lang_stable_since + \ |
| 212 | + print "error: feature '" + name + "' has lang stable since " + lang_stable_since + \ |
212 | 213 | " but lib stable since " + lib_stable_since |
213 | 214 | errors = True |
214 | 215 |
|
|
0 commit comments