--- /dev/null
+
+from parser import TagsSemantics as _TagsSemantics
+
+class TagsSemantics(_TagsSemantics):
+ def expression(self, ast):
+ if isinstance(ast, str): # name
+ return ast
+ if isinstance(ast, unicode): # name
+ return str(ast)
+ if isinstance(ast, list):
+ ast = tuple(ast)
+ elif not isinstance(ast, tuple):
+ raise TypeError("Expected a list, got %r %s" % (type(ast), ast))
+ if len(ast) == 3:
+ return (ast[1], ast[0], ast[2])
+ return ast
+
+ def expression_parens(self, ast):
+ return ('PARENS', ast[1])
+
+ def name(self, ast):
+ return ('NAME', str(ast))
+
+ def and_op(self, ast):
+ return 'AND'
+
+ def or_op(self, ast):
+ return 'OR'
+
+ def not_op(self, ast):
+ return 'NOT'