diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2015-09-04 16:37:22 -0700 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2015-09-08 11:01:42 +1000 |
| commit | 31310f5b65232ce9714f8f4c9ad066a97f7f20f4 (patch) | |
| tree | 7c8a780df6226d9845d3d53c2b23a3a59a0ab0f0 /src/etc | |
| parent | 62c45f4f25129af3708b7f5509d4503f5cce5b64 (diff) | |
Allow tracking issues for lang features.
This is similar to the libs version, which allow an `issue` field in the `#[unstable]` attribute. cc #28244
Diffstat (limited to 'src/etc')
| -rw-r--r-- | src/etc/featureck.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/etc/featureck.py b/src/etc/featureck.py index e82f00f3e7d..c6f3bcdf9ec 100644 --- a/src/etc/featureck.py +++ b/src/etc/featureck.py @@ -47,20 +47,24 @@ with open(feature_gate_source, 'r') as f: is_feature_line = True if is_feature_line: - line = line.replace("(", "").replace("),", "").replace(")", "") + # turn ` ("foo", "1.0.0", Some(10), Active)` into + # `"foo", "1.0.0", Some(10), Active` + line = line.strip(' ,()') parts = line.split(",") - if len(parts) != 3: + if len(parts) != 4: print("error: unexpected number of components in line: " + original_line) sys.exit(1) feature_name = parts[0].strip().replace('"', "") since = parts[1].strip().replace('"', "") - status = parts[2].strip() + issue = parts[2].strip() + status = parts[3].strip() assert len(feature_name) > 0 assert len(since) > 0 + assert len(issue) > 0 assert len(status) > 0 language_feature_names += [feature_name] - language_features += [(feature_name, since, status)] + language_features += [(feature_name, since, issue, status)] assert len(language_features) > 0 @@ -158,7 +162,7 @@ for f in language_features: status = "unstable" stable_since = None - if f[2] == "Accepted": + if f[3] == "Accepted": status = "stable" if status == "stable": stable_since = f[1] |
