diff --git a/ast_generator/ast_generator.py b/ast_generator/ast_generator.py index 7e6000b..c23e64f 100644 --- a/ast_generator/ast_generator.py +++ b/ast_generator/ast_generator.py @@ -357,20 +357,23 @@ class AstGenerator: self.current_ast_element = parent def generate_unary(self, op, op_type=ANY_TYPE): + """ + @brief Generate a unary operation + + @param op_type: the type of the expression + """ parent = self.current_ast_element args = [ ("op", op), ("type", op_type), ] - element = build_xml_element(args, name=GAZ_UNARY_OPERATOR_TAG) - self.current_ast_element.append(element) - self.current_ast_element = element + self.make_element(GAZ_UNARY_OPERATOR_TAG, args) self.generate_xhs(GAZ_RHS_TAG, op_type) self.current_ast_element = parent - def generate_routine_call(self): + def generate_routine_call(self): # we should generate a test case with arbitrary number of args pass def generate_conditional(self):