Merge pull request #85 from robotpy/static-inline
Allow fields to be marked inline
This commit is contained in:
commit
f1708bf9b8
@ -848,6 +848,7 @@ class Field:
|
|||||||
constexpr: bool = False
|
constexpr: bool = False
|
||||||
mutable: bool = False
|
mutable: bool = False
|
||||||
static: bool = False
|
static: bool = False
|
||||||
|
inline: bool = False
|
||||||
|
|
||||||
doxygen: typing.Optional[str] = None
|
doxygen: typing.Optional[str] = None
|
||||||
|
|
||||||
|
@ -3336,3 +3336,40 @@ def test_constructor_outside_class() -> None:
|
|||||||
]
|
]
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def test_class_inline_static() -> None:
|
||||||
|
content = """
|
||||||
|
struct X {
|
||||||
|
inline static bool Foo = 1;
|
||||||
|
};
|
||||||
|
"""
|
||||||
|
data = parse_string(content, cleandoc=True)
|
||||||
|
|
||||||
|
assert data == ParsedData(
|
||||||
|
namespace=NamespaceScope(
|
||||||
|
classes=[
|
||||||
|
ClassScope(
|
||||||
|
class_decl=ClassDecl(
|
||||||
|
typename=PQName(
|
||||||
|
segments=[NameSpecifier(name="X")], classkey="struct"
|
||||||
|
)
|
||||||
|
),
|
||||||
|
fields=[
|
||||||
|
Field(
|
||||||
|
access="public",
|
||||||
|
type=Type(
|
||||||
|
typename=PQName(
|
||||||
|
segments=[FundamentalSpecifier(name="bool")]
|
||||||
|
)
|
||||||
|
),
|
||||||
|
name="Foo",
|
||||||
|
value=Value(tokens=[Token(value="1")]),
|
||||||
|
static=True,
|
||||||
|
inline=True,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
)
|
||||||
|
]
|
||||||
|
)
|
||||||
|
)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user