55from . import logging
66from . import messages
77
8+
89class ProvisionalFeature (abc .ABC ):
910 def tag (self ) -> str :
1011 return self .__class__ .__name__
1112
12- @abc .abstractproperty
13- def __doc__ (self ): pass
13+ @property
14+ @abc .abstractmethod
15+ def __doc__ (self ):
16+ pass
1417
15- @abc .abstractproperty
16- def short (self ) -> str : pass
18+ @property
19+ @abc .abstractmethod
20+ def short (self ) -> str :
21+ pass
1722
18- @abc .abstractproperty
19- def stable (self ) -> str : pass
23+ @property
24+ @abc .abstractmethod
25+ def stable (self ) -> bool :
26+ pass
2027
2128 # Whether the feature is included in 1.2 documentation
2229 dml12 = False
2330
31+
2432# tag -> feature
2533features : dict [str , ProvisionalFeature ] = {}
2634
@@ -34,7 +42,8 @@ def feature(cls: type[ProvisionalFeature]):
3442
3543@feature
3644class explicit_param_decls (ProvisionalFeature ):
37- '''<a id="explicit_param_decls"/>
45+ """<a id="explicit_param_decls"/>
46+
3847 This feature extends the DML syntax for parameter definitions to
3948 distinguish between an intent to declare a new parameter, and an intent to
4049 override an existing parameter (including when providing a definition
@@ -80,14 +89,21 @@ class explicit_param_decls(ProvisionalFeature):
8089
8190 Enabling the `explicit_param_decls` feature in a file only affects
8291 the parameter definitions specified in that file.
83- '''
84- short = "Require := syntax for defining new params"
85- stable = True
92+ """
93+
94+ @property
95+ def short (self ) -> str :
96+ return "Require := syntax for defining new params"
97+
98+ @property
99+ def stable (self ) -> bool :
100+ return True
86101
87102
88103@feature
89104class simics_util_vect (ProvisionalFeature ):
90- '''<a id="simics_util_vect"/>
105+ """<a id="simics_util_vect"/>
106+
91107 This feature enables the `vect` type, based on the
92108 `VECT` macro from the Simics C API (`simics/util/vect.h`).
93109
@@ -130,18 +146,24 @@ class simics_util_vect(ProvisionalFeature):
130146 When the `simics_util_vect` feature is disabled, usage of `vect` is an
131147 error unless the [`experimental_vect` compatibility
132148 feature](deprecations-auto.html#experimental_vect) is enabled.
133- '''
134- short = "Allow vect syntax based on the VECT macro"
135- stable = True
149+ """
150+
151+ @property
152+ def short (self ) -> str :
153+ return "Allow vect syntax based on the VECT macro"
154+
155+ @property
156+ def stable (self ) -> bool :
157+ return True
158+
136159 dml12 = True
137160
138- def parse_provisional (
139- provs : list [( "Site" , str )] ) -> dict [ProvisionalFeature , "Site" ]:
161+
162+ def parse_provisional ( provs : list [tuple [ str , str ]] ) -> dict [ProvisionalFeature , str ]:
140163 ret = {}
141- for ( site , name ) in provs :
164+ for site , name in provs :
142165 if name in features :
143166 ret [features [name ]] = site
144167 else :
145- logging .report (messages .ENOPROV (
146- site , name , ', ' .join (sorted (features ))))
168+ logging .report (messages .ENOPROV (site , name , ", " .join (sorted (features ))))
147169 return ret
0 commit comments