oasm 0.1.4__tar.gz → 0.1.5__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: oasm
3
- Version: 0.1.4
3
+ Version: 0.1.5
4
4
  Summary: Open ASseMbly tools
5
5
  Author-email: nzturn <nzturn@gmail.com>
6
6
  Keywords: asm,dsl
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "oasm" # 包名(需确保在PyPI唯一)
3
- version = "0.1.4" # 初始版本号
3
+ version = "0.1.5" # 初始版本号
4
4
  authors = [
5
5
  { name = "nzturn", email = "nzturn@gmail.com" },
6
6
  ]
@@ -1395,31 +1395,19 @@ class WithPass(ast.NodeTransformer):
1395
1395
  Else = self.env['Else']
1396
1396
  if type(Else) is not str:
1397
1397
  Else = 'Else'
1398
- Elif = self.env['Elif']
1399
- if type(Elif) is not str:
1400
- Elif = 'Elif'
1401
1398
  if isinstance(node.test, ast.Call) and node.test.func.id == '_':
1402
1399
  node.test.func.id = If
1403
1400
  elif RegQ(node.test, self.regq):
1404
1401
  node.test = ast.Call(func=ast.Name(id=If, ctx=ast.Load(), lineno=node.lineno, col_offset = node.col_offset), args=[node.test], keywords=[], lineno=node.lineno, col_offset = node.col_offset)
1405
1402
  if isinstance(node.test, ast.Call) and node.test.func.id == If:
1406
1403
  withs = [ast.With(items=[ast.withitem(context_expr = node.test)], body=node.body, lineno=node.lineno, col_offset = node.col_offset)]
1407
- for i in range(len(node.orelse)):
1408
- orelse = node.orelse[i]
1409
- if isinstance(orelse, ast.With) \
1410
- and isinstance(orelse.items[0].context_expr, ast.Call):
1411
- if orelse.items[0].context_expr.func.id == If:
1412
- orelse.items[0].context_expr.func.id = Elif
1413
- withs.append(orelse)
1414
- else:
1415
- orelse = ast.With(items=[\
1416
- ast.withitem(context_expr = \
1417
- ast.Call(func=ast.Name(id=Else, ctx=ast.Load(), lineno=node.lineno, col_offset = node.col_offset),\
1418
- args=[], keywords=[], lineno=node.lineno, col_offset = node.col_offset),\
1419
- lineno=node.lineno, col_offset = node.col_offset)], \
1420
- body=node.orelse[i:], lineno=node.lineno, col_offset = node.col_offset)
1421
- withs.append(orelse)
1422
- break
1404
+ if len(node.orelse):
1405
+ withs.append(ast.With(items=[\
1406
+ ast.withitem(context_expr = \
1407
+ ast.Call(func=ast.Name(id=Else, ctx=ast.Load(), lineno=node.lineno, col_offset = node.col_offset),\
1408
+ args=[], keywords=[], lineno=node.lineno, col_offset = node.col_offset),\
1409
+ lineno=node.lineno, col_offset = node.col_offset)], \
1410
+ body=node.orelse, lineno=node.lineno, col_offset = node.col_offset))
1423
1411
  return withs
1424
1412
  return node
1425
1413
  def visit_While(self, node):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: oasm
3
- Version: 0.1.4
3
+ Version: 0.1.5
4
4
  Summary: Open ASseMbly tools
5
5
  Author-email: nzturn <nzturn@gmail.com>
6
6
  Keywords: asm,dsl
File without changes
File without changes
File without changes