From ed984a0a478a0d157edfcd2277754e3897c28771 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Wed, 1 Apr 2020 16:43:16 +0100 Subject: [PATCH] add bit of code ready for IntClass with an eq function --- src/soc/decoder/pseudo/parser.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/soc/decoder/pseudo/parser.py b/src/soc/decoder/pseudo/parser.py index 62793f76..1db988e7 100644 --- a/src/soc/decoder/pseudo/parser.py +++ b/src/soc/decoder/pseudo/parser.py @@ -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 -- 2.30.2