Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion cxxheaderparser/lexer.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ class PlyLexer:
"new",
"noexcept",
"nullptr",
"nullptr_t", # not a keyword, but makes things easier
"operator",
"private",
"protected",
Expand Down
33 changes: 33 additions & 0 deletions tests/test_fn.py
Original file line number Diff line number Diff line change
Expand Up @@ -1428,3 +1428,36 @@ def test_deleted_function() -> None:
]
)
)


def test_nullptr_t() -> None:
content = """
void f(std::nullptr_t) {}
"""
data = parse_string(content, cleandoc=True)

assert data == ParsedData(
namespace=NamespaceScope(
functions=[
Function(
return_type=Type(
typename=PQName(segments=[FundamentalSpecifier(name="void")])
),
name=PQName(segments=[NameSpecifier(name="f")]),
parameters=[
Parameter(
type=Type(
typename=PQName(
segments=[
NameSpecifier(name="std"),
FundamentalSpecifier(name="nullptr_t"),
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm. This probably should be a NameSpecifier.

]
)
)
)
],
has_body=True,
)
]
)
)
Loading