Changeset cb4eca2 in rtems-central


Ignore:
Timestamp:
Dec 2, 2020, 10:12:42 AM (8 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
master
Children:
c970d63
Parents:
c3193cc
git-author:
Sebastian Huber <sebastian.huber@…> (12/02/20 10:12:42)
git-committer:
Sebastian Huber <sebastian.huber@…> (12/02/20 10:13:36)
Message:

interfacedoc: Fix format of parameter names

File:
1 edited

Legend:

Unmodified
Added
Removed
  • rtemsspec/interfacedoc.py

    rc3193cc rcb4eca2  
    4141
    4242
     43def _sanitize_name(name: str) -> str:
     44    return name.lstrip("_")
     45
     46
    4347def _forward_declaration(item: Item) -> str:
    4448    target = item.parent("interface-target")
     
    6670
    6771def _get_param(ctx: ItemGetValueContext) -> Any:
    68     return f"``{ctx.value[ctx.key].lstrip('_')}``"
     72    return f"``{_sanitize_name(ctx.value[ctx.key])}``"
    6973
    7074
     
    116120    ret = mapper.substitute(value["return"])
    117121    name = item["name"]
    118     params = [mapper.substitute(param) for param in value["params"]]
     122    params = [
     123        mapper.substitute(_sanitize_name(param)) for param in value["params"]
     124    ]
    119125    content.declare_function(ret, name, params)
    120126
     
    124130    ret = "#define"
    125131    name = item["name"]
    126     params = [param["name"] for param in item["params"]]
     132    params = [_sanitize_name(param["name"]) for param in item["params"]]
    127133    content.call_function(ret, name, params, semicolon="")
    128134
     
    174180        content.add(".. rubric:: PARAMETERS:")
    175181        for param in item["params"]:
    176             param_name = mapper.substitute(param["name"])
    177182            content.add_definition_item(
    178                 f"``{param_name}``",
     183                f"``{_sanitize_name(param['name'])}``",
    179184                mapper.substitute(f"This parameter {param['description']}"),
    180185                wrap=True)
Note: See TracChangeset for help on using the changeset viewer.