Skip to content

Commit

Permalink
v0.19.3
Browse files Browse the repository at this point in the history
  • Loading branch information
marzer committed Nov 11, 2024
1 parent 0246e36 commit be409df
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 25 deletions.
14 changes: 0 additions & 14 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,6 @@ name: ci

on:
push:
branches:
- main
paths:
- "**.py"
- "**.css"
- "**.js"
- "**.json"
- "**.xml"
- "**/poxy/data/*"
- "**/workflows/**.yaml"
- "pyproject.toml"
pull_request:
branches:
- main
paths:
- "**.py"
- "**.css"
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## v0.19.3 - 2024-11-11

- fixed crash with nested C-style enums without a name (#39) (@tim-janik)
- fixed `POXY_IMPLEMENTATION_DETAIL_IMPL` appearing in HTML in some circumstances

## v0.19.1 - 2024-10-30

- fixed `ModuleNotFoundError` error in Python 3.12 (#38) (@dekinet)
Expand Down
18 changes: 12 additions & 6 deletions src/poxy/fixers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1031,14 +1031,20 @@ class ImplementationDetails(PlainTextFixer):
Replaces implementation details with appropriate shorthands.
'''

__shorthands = ((r'POXY_IMPLEMENTATION_DETAIL_IMPL', r'<code class="m-note m-dim poxy-impl">/* ... */</code>'),)
__patterns = (
re.compile(
r'<\s*a\s+class="m-doc"\s+href=".+?"\s*>POXY_(?:<wbr>)?IMPLEMENTATION_(?:<wbr>)?DETAIL_(?:<wbr>)?IMPL<\s*/a\s*>',
re.I,
),
re.compile(r'POXY_(?:<wbr>)?IMPLEMENTATION_(?:<wbr>)?DETAIL_(?:<wbr>)?IMPL', re.I),
re.compile(r'poxyimplementationdetailimplplaceholder', re.I),
)

__replacement = r'<code class="m-note m-dim poxy-impl">/* ... */</code>'

def __call__(self, context: Context, text: str, path: Path) -> str:
for shorthand, replacement in self.__shorthands:
idx = text.find(shorthand)
while idx >= 0:
text = text[:idx] + replacement + text[idx + len(shorthand) :]
idx = text.find(shorthand)
for pattern in self.__patterns:
text = pattern.sub(self.__replacement, text)
return text


Expand Down
2 changes: 1 addition & 1 deletion src/poxy/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class Defaults(object):
r'__has_builtin(...)': 0,
r'__has_feature(...)': 0,
r'__has_cpp_attribute(...)': 999999,
r'POXY_IMPLEMENTATION_DETAIL(...)': r'POXY_IMPLEMENTATION_DETAIL_IMPL',
r'POXY_IMPLEMENTATION_DETAIL(...)': r'poxyimplementationdetailimplplaceholder',
r'POXY_IGNORE(...)': r'',
}
cpp_builtin_macros = {
Expand Down
10 changes: 7 additions & 3 deletions src/poxy/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -746,12 +746,17 @@ def postprocess_xml(context: Context):

# re-sort members to override Doxygen's weird and stupid sorting 'rules'
if 1:
sort_members_by_name = lambda tag: tag.find(r'name').text
# sort_members_by_name = lambda tag: tag.find(r'name').text
def sort_members_by_name(tag):
n = tag.find(r'name')
if n is None:
return ''
return '' if n.text is None else n.text

members = [tag for tag in section.findall(r'memberdef')]
for tag in members:
section.remove(tag)
# fmt: off
# yapf: disable
groups = [
([tag for tag in members if tag.get(r'kind') == r'define'], True), #
([tag for tag in members if tag.get(r'kind') == r'typedef'], True),
Expand All @@ -763,7 +768,6 @@ def postprocess_xml(context: Context):
([tag for tag in members if tag.get(r'kind') == r'function' and tag.get(r'static') == r'no'], True),
([tag for tag in members if tag.get(r'kind') == r'friend'], True)
]
# yapf: enable
# fmt: on
for group, sort in groups:
if sort:
Expand Down
2 changes: 1 addition & 1 deletion src/poxy/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.19.1
0.19.3

0 comments on commit be409df

Please sign in to comment.