2 from parser import TagsSemantics as _TagsSemantics
4 class TagsSemantics(_TagsSemantics):
5 def expression(self, ast):
6 if isinstance(ast, str): # name
8 if isinstance(ast, unicode): # name
10 if isinstance(ast, list):
12 elif not isinstance(ast, tuple):
13 raise TypeError("Expected a list, got %r %s" % (type(ast), ast))
15 return (ast[1], ast[0], ast[2])
18 def expression_parens(self, ast):
19 return ('PARENS', ast[1])
22 return ('NAME', str(ast))
24 def and_op(self, ast):
30 def not_op(self, ast):