Skip to content

Commit

Permalink
misc: remove unused name argument from builtin attribute parsing (#3545)
Browse files Browse the repository at this point in the history
The previous PR removes the last use of this parameter.

Note stacked PR
  • Loading branch information
superlopuh authored Nov 29, 2024
1 parent 993542d commit cc60fc2
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions xdsl/parser/attribute_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ def _parse_int_or_question(self, context_msg: str = "") -> int | Literal["?"]:
return v
self.raise_error("Expected an integer literal or `?`" + context_msg)

def _parse_strided_layout_attr(self, name: Span) -> Attribute:
def _parse_strided_layout_attr(self) -> Attribute:
"""
Parse a strided layout attribute parameters.
| `<` `[` comma-separated-int-or-question `]`
Expand Down Expand Up @@ -694,7 +694,7 @@ def _parse_optional_builtin_parametrized_attr(self) -> Attribute | None:
if name.text not in parsers:
return None
self._consume_token(Token.Kind.BARE_IDENT)
return parsers[name.text](name)
return parsers[name.text]()

def _parse_builtin_dense_attr_hex(
self,
Expand Down Expand Up @@ -866,10 +866,10 @@ def parse_dense_int_or_fp_elements_attr(

return DenseIntOrFPElementsAttr.from_list(type, data_values)

def _parse_builtin_dense_attr(self, _name: Span) -> DenseIntOrFPElementsAttr:
def _parse_builtin_dense_attr(self) -> DenseIntOrFPElementsAttr:
return self.parse_dense_int_or_fp_elements_attr(None)

def _parse_builtin_opaque_attr(self, _name: Span):
def _parse_builtin_opaque_attr(self):
str_lit_list = self.parse_comma_separated_list(
self.Delimiter.ANGLE, self.parse_str_literal
)
Expand All @@ -885,7 +885,7 @@ def _parse_builtin_opaque_attr(self, _name: Span):

return OpaqueAttr.from_strings(*str_lit_list, type=type)

def _parse_builtin_dense_resource_attr(self, _name: Span) -> DenseResourceAttr:
def _parse_builtin_dense_resource_attr(self) -> DenseResourceAttr:
self.parse_characters("<", " in dense_resource attribute")
resource_handle = self.parse_identifier(" for resource handle")
self.parse_characters(">", " in dense_resource attribute")
Expand Down Expand Up @@ -920,7 +920,7 @@ def _parse_typed_integer(

return res

def _parse_builtin_densearray_attr(self, name: Span) -> DenseArrayBase | None:
def _parse_builtin_densearray_attr(self) -> DenseArrayBase | None:
self.parse_characters("<", " in dense array")
pos = self.pos
element_type = self.parse_attribute()
Expand Down Expand Up @@ -955,13 +955,13 @@ def _parse_builtin_densearray_attr(self, name: Span) -> DenseArrayBase | None:

return res

def _parse_builtin_affine_map(self, _name: Span) -> AffineMapAttr:
def _parse_builtin_affine_map(self) -> AffineMapAttr:
self.parse_characters("<", " in affine_map attribute")
affine_map = self.parse_affine_map()
self.parse_characters(">", " in affine_map attribute")
return AffineMapAttr(affine_map)

def _parse_builtin_affine_set(self, _name: Span) -> AffineSetAttr:
def _parse_builtin_affine_set(self) -> AffineSetAttr:
self.parse_characters("<", " in affine_set attribute")
affine_set = self.parse_affine_set()
self.parse_characters(">", " in affine_set attribute")
Expand Down

0 comments on commit cc60fc2

Please sign in to comment.