mirror of
https://github.com/YosysHQ/yosys
synced 2026-06-26 10:38:47 +00:00
Remove trailing whitespaces
This commit is contained in:
parent
48a3dcc02a
commit
a689342207
317 changed files with 3136 additions and 3136 deletions
|
|
@ -9,7 +9,7 @@ class RtlilLexer(RegexLexer):
|
|||
filenames = ['*.il']
|
||||
|
||||
keyword_re = r'(always|assign|attribute|autoidx|case|cell|connect|edge|end|global|high|init|inout|input|low|memory|module|negedge|offset|output|parameter|posedge|process|real|signed|size|switch|sync|update|upto|width|wire)'
|
||||
|
||||
|
||||
tokens = {
|
||||
'common': [
|
||||
(r'\s+', Whitespace),
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ class YosysCell:
|
|||
inputs: list[str]
|
||||
outputs: list[str]
|
||||
properties: list[str]
|
||||
|
||||
|
||||
class YosysCellGroupDocumenter(Documenter):
|
||||
objtype = 'cellgroup'
|
||||
priority = 10
|
||||
|
|
@ -67,7 +67,7 @@ class YosysCellGroupDocumenter(Documenter):
|
|||
for (name, obj) in cells_obj.get(self.lib_key, {}).items():
|
||||
self.__cell_lib[name] = obj
|
||||
return self.__cell_lib
|
||||
|
||||
|
||||
@classmethod
|
||||
def can_document_member(
|
||||
cls,
|
||||
|
|
@ -83,7 +83,7 @@ class YosysCellGroupDocumenter(Documenter):
|
|||
self.content_indent = ''
|
||||
self.fullname = self.modname = self.name
|
||||
return True
|
||||
|
||||
|
||||
def import_object(self, raiseerror: bool = False) -> bool:
|
||||
# get cell
|
||||
try:
|
||||
|
|
@ -95,16 +95,16 @@ class YosysCellGroupDocumenter(Documenter):
|
|||
|
||||
self.real_modname = self.modname
|
||||
return True
|
||||
|
||||
|
||||
def get_sourcename(self) -> str:
|
||||
return self.env.doc2path(self.env.docname)
|
||||
|
||||
|
||||
def format_name(self) -> str:
|
||||
return self.options.caption or ''
|
||||
|
||||
def format_signature(self, **kwargs: Any) -> str:
|
||||
return self.modname
|
||||
|
||||
|
||||
def add_directive_header(self, sig: str) -> None:
|
||||
domain = getattr(self, 'domain', 'cell')
|
||||
directive = getattr(self, 'directivetype', 'group')
|
||||
|
|
@ -118,7 +118,7 @@ class YosysCellGroupDocumenter(Documenter):
|
|||
|
||||
if self.options.noindex:
|
||||
self.add_line(' :noindex:', sourcename)
|
||||
|
||||
|
||||
def add_content(self, more_content: Any | None) -> None:
|
||||
# groups have no native content
|
||||
# add additional content (e.g. from document), if present
|
||||
|
|
@ -271,22 +271,22 @@ class YosysCellDocumenter(YosysCellGroupDocumenter):
|
|||
self.fullname = ((self.modname) + (thing or ''))
|
||||
|
||||
return True
|
||||
|
||||
|
||||
def import_object(self, raiseerror: bool = False) -> bool:
|
||||
if super().import_object(raiseerror):
|
||||
self.object = YosysCell(self.modname, **self.object[1])
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def get_sourcename(self) -> str:
|
||||
return self.object.source.split(":")[0]
|
||||
|
||||
|
||||
def format_name(self) -> str:
|
||||
return self.object.name
|
||||
|
||||
def format_signature(self, **kwargs: Any) -> str:
|
||||
return self.groupname + self.fullname + self.attribute
|
||||
|
||||
|
||||
def add_directive_header(self, sig: str) -> None:
|
||||
domain = getattr(self, 'domain', self.objtype)
|
||||
directive = getattr(self, 'directivetype', 'def')
|
||||
|
|
@ -310,7 +310,7 @@ class YosysCellDocumenter(YosysCellGroupDocumenter):
|
|||
|
||||
if self.options.noindex:
|
||||
self.add_line(' :noindex:', sourcename)
|
||||
|
||||
|
||||
def add_content(self, more_content: Any | None) -> None:
|
||||
# set sourcename and add content from attribute documentation
|
||||
sourcename = self.get_sourcename()
|
||||
|
|
@ -360,7 +360,7 @@ class YosysCellSourceDocumenter(YosysCellDocumenter):
|
|||
if isinstance(parent, YosysCellDocumenter):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def add_directive_header(self, sig: str) -> None:
|
||||
domain = getattr(self, 'domain', 'cell')
|
||||
directive = getattr(self, 'directivetype', 'source')
|
||||
|
|
@ -383,7 +383,7 @@ class YosysCellSourceDocumenter(YosysCellDocumenter):
|
|||
|
||||
if self.options.noindex:
|
||||
self.add_line(' :noindex:', sourcename)
|
||||
|
||||
|
||||
def add_content(self, more_content: Any | None) -> None:
|
||||
# set sourcename and add content from attribute documentation
|
||||
sourcename = self.get_sourcename()
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ class YosysCmd:
|
|||
self.source_func = source_func
|
||||
self.experimental_flag = experimental_flag
|
||||
self.internal_flag = internal_flag
|
||||
|
||||
|
||||
class YosysCmdGroupDocumenter(Documenter):
|
||||
objtype = 'cmdgroup'
|
||||
priority = 10
|
||||
|
|
@ -112,7 +112,7 @@ class YosysCmdGroupDocumenter(Documenter):
|
|||
for (name, obj) in cmds_obj.get(self.lib_key, {}).items():
|
||||
self.__cmd_lib[name] = obj
|
||||
return self.__cmd_lib
|
||||
|
||||
|
||||
@classmethod
|
||||
def can_document_member(
|
||||
cls,
|
||||
|
|
@ -128,7 +128,7 @@ class YosysCmdGroupDocumenter(Documenter):
|
|||
self.content_indent = ''
|
||||
self.fullname = self.modname = self.name
|
||||
return True
|
||||
|
||||
|
||||
def import_object(self, raiseerror: bool = False) -> bool:
|
||||
# get cmd
|
||||
try:
|
||||
|
|
@ -140,19 +140,19 @@ class YosysCmdGroupDocumenter(Documenter):
|
|||
|
||||
self.real_modname = self.modname
|
||||
return True
|
||||
|
||||
|
||||
def get_sourcename(self) -> str:
|
||||
return self.env.doc2path(self.env.docname)
|
||||
|
||||
|
||||
def format_name(self) -> str:
|
||||
return self.options.caption or ''
|
||||
|
||||
def format_signature(self, **kwargs: Any) -> str:
|
||||
return self.modname
|
||||
|
||||
|
||||
def add_directive_header(self, sig: str) -> None:
|
||||
pass
|
||||
|
||||
|
||||
def add_content(self, more_content: Any | None) -> None:
|
||||
pass
|
||||
|
||||
|
|
@ -323,7 +323,7 @@ class YosysCmdDocumenter(YosysCmdGroupDocumenter):
|
|||
return self.object.source_file
|
||||
except AttributeError:
|
||||
return super().get_sourcename()
|
||||
|
||||
|
||||
def format_name(self) -> str:
|
||||
return self.object.name
|
||||
|
||||
|
|
@ -347,7 +347,7 @@ class YosysCmdDocumenter(YosysCmdGroupDocumenter):
|
|||
|
||||
if self.options.noindex:
|
||||
self.add_line(' :noindex:', source_name)
|
||||
|
||||
|
||||
def add_content(self, more_content: Any | None) -> None:
|
||||
# set sourcename and add content from attribute documentation
|
||||
domain = getattr(self, 'domain', self.objtype)
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ from sphinx.util.nodes import make_refnode
|
|||
from sphinx.util.docfields import Field, GroupedField
|
||||
from sphinx import addnodes
|
||||
|
||||
class TocNode(ObjectDescription):
|
||||
class TocNode(ObjectDescription):
|
||||
def add_target_and_index(
|
||||
self,
|
||||
name: str,
|
||||
|
|
@ -64,7 +64,7 @@ class NodeWithOptions(TocNode):
|
|||
doc_field_types = [
|
||||
GroupedField('opts', label='Options', names=('option', 'options', 'opt', 'opts')),
|
||||
]
|
||||
|
||||
|
||||
def transform_content(self, contentnode: addnodes.desc_content) -> None:
|
||||
"""hack `:option -thing: desc` into a proper option list with yoscrypt highlighting"""
|
||||
newchildren = []
|
||||
|
|
@ -290,7 +290,7 @@ class CellNode(TocNode):
|
|||
self.env.docname,
|
||||
idx,
|
||||
0))
|
||||
|
||||
|
||||
def transform_content(self, contentnode: addnodes.desc_content) -> None:
|
||||
# Add the cell title to the body
|
||||
if 'title' in self.options:
|
||||
|
|
@ -380,7 +380,7 @@ class CellSourceNode(TocNode):
|
|||
# only add target and index entry if this is the first
|
||||
# description of the object with this name in this desc block
|
||||
self.add_target_and_index(name, sig, signode)
|
||||
|
||||
|
||||
# handle code
|
||||
code = '\n'.join(self.content)
|
||||
literal: Element = nodes.literal_block(code, code)
|
||||
|
|
@ -420,11 +420,11 @@ class CellGroupNode(TocNode):
|
|||
|
||||
class TagIndex(Index):
|
||||
"""A custom directive that creates a tag matrix."""
|
||||
|
||||
|
||||
name = 'tag'
|
||||
localname = 'Tag Index'
|
||||
shortname = 'Tag'
|
||||
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(TagIndex, self).__init__(*args, **kwargs)
|
||||
|
||||
|
|
@ -458,14 +458,14 @@ class TagIndex(Index):
|
|||
objs = {name: (dispname, typ, docname, anchor)
|
||||
for name, dispname, typ, docname, anchor, prio
|
||||
in self.domain.get_objects()}
|
||||
|
||||
|
||||
tmap = {}
|
||||
tags = self.domain.data[f'obj2{self.name}']
|
||||
for name, tags in tags.items():
|
||||
for tag in tags:
|
||||
tmap.setdefault(tag,[])
|
||||
tmap[tag].append(name)
|
||||
|
||||
|
||||
for tag in tmap.keys():
|
||||
lis = content.setdefault(tag, [])
|
||||
objlis = tmap[tag]
|
||||
|
|
@ -480,11 +480,11 @@ class TagIndex(Index):
|
|||
|
||||
return (ret, True)
|
||||
|
||||
class CommandIndex(Index):
|
||||
class CommandIndex(Index):
|
||||
name = 'cmd'
|
||||
localname = 'Command Reference'
|
||||
shortname = 'Command'
|
||||
|
||||
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(CommandIndex, self).__init__(*args, **kwargs)
|
||||
|
||||
|
|
@ -525,7 +525,7 @@ class CommandIndex(Index):
|
|||
lis.append((
|
||||
dispname, 0, docname,
|
||||
anchor,
|
||||
'', '', title
|
||||
'', '', title
|
||||
))
|
||||
ret = [(k, v) for k, v in sorted(content.items())]
|
||||
|
||||
|
|
@ -538,7 +538,7 @@ class CellIndex(CommandIndex):
|
|||
|
||||
class PropIndex(TagIndex):
|
||||
"""A custom directive that creates a properties matrix."""
|
||||
|
||||
|
||||
name = 'prop'
|
||||
localname = 'Property Index'
|
||||
shortname = 'Prop'
|
||||
|
|
@ -659,7 +659,7 @@ class CommandDomain(Domain):
|
|||
else:
|
||||
print(f"Missing ref for {target} in {fromdocname} ")
|
||||
return None
|
||||
|
||||
|
||||
class CellDomain(CommandDomain):
|
||||
name = 'cell'
|
||||
label = 'Yosys internal cells'
|
||||
|
|
@ -730,8 +730,8 @@ def setup(app: Sphinx):
|
|||
('cell-prop', '')
|
||||
|
||||
app.add_role('autoref', autoref)
|
||||
|
||||
|
||||
return {
|
||||
'version': '0.3',
|
||||
'version': '0.3',
|
||||
'parallel_read_safe': False,
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue