add bit of code ready for IntClass with an eq function
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 1 Apr 2020 15:43:16 +0000 (16:43 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Wed, 1 Apr 2020 15:43:16 +0000 (16:43 +0100)
src/soc/decoder/pseudo/parser.py

index 62793f761fd65d779071f2a8529ae05c31ab2c6d..1db988e7dad4765fa033447f950dd7a402130f0e 100644 (file)
@@ -24,6 +24,10 @@ def Assign(left, right):
     names = []
     if isinstance(left, ast.Name):
         # Single assignment on left
+        # XXX when doing IntClass, which will have an "eq" function,
+        # this is how to access it
+        #   eq = ast.Attribute(left, "eq")   # get eq fn
+        #   return ast.Call(eq, [right], []) # now call left.eq(right)
         return ast.Assign([ast.Name(left.id, ast.Store())], right)
     elif isinstance(left, ast.Tuple):
         # List of things - make sure they are Name nodes