<commit_before>// -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
// vi: set ts=2 noet:
//
// Copyright (c) 2016 <NAME> <<EMAIL>>
//
// All rights reserved. Use of this source code is governed by a
// MIT license that can be found in the LICENSE file.

/// @file   binder/function.cpp
/// @brief  Binding generation for static and member functions
/// @author <NAME>

#include <function.hpp>

#include <class.hpp>
#include <fmt/format.h>
#include <type.hpp>
#include <util.hpp>

#include <clang/AST/ASTContext.h>
#include <clang/AST/DeclCXX.h>

#include <clang/AST/ExprCXX.h>

//#include <tsl/robin_map.h>

#include <vector>


using namespace llvm;
using namespace clang;

using std::pair;
using std::string;
using std::tuple;
using std::unordered_map;
using std::vector;

using namespace fmt::literals;

namespace binder {

static std::map<string, string > const cpp_python_operator_map{
	{"operator+", "__add__"}, //
	{"operator-", "__sub__"}, //
	{"operator*", "__mul__"}, //
	{"operator/", "__truediv__"}, //

	{"operator+=", "__iadd__"}, //
	{"operator-=", "__isub__"}, //
	{"operator*=", "__imul__"}, //
	{"operator/=", "__idiv__"}, //

	{"operator()", "__call__"}, //
	{"operator==", "__eq__"}, //
	{"operator!=", "__ne__"}, //
	{"operator[]", "__getitem__"}, //
	{"operator=", "assign"}, //
	{"operator++", "plus_plus"}, //
	{"operator--", "minus_minus"}, //

	{"operator->", "arrow"}, //
};

// Generate function argument list separate by comma: int, bool, std::string
string function_arguments(clang::FunctionDecl const *record)
{
	string r;<commit_msg>switching to `__itruediv__`<commit_after>// -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
// vi: set ts=2 noet:
//
// Copyright (c) 2016 <NAME> <<EMAIL>>
//
// All rights reserved. Use of this source code is governed by a
// MIT license that can be found in the LICENSE file.

/// @file   binder/function.cpp
/// @brief  Binding generation for static and member functions
/// @author <NAME>

#include <function.hpp>

#include <class.hpp>
#include <fmt/format.h>
#include <type.hpp>
#include <util.hpp>

#include <clang/AST/ASTContext.h>
#include <clang/AST/DeclCXX.h>

#include <clang/AST/ExprCXX.h>

//#include <tsl/robin_map.h>

#include <vector>


using namespace llvm;
using namespace clang;

using std::pair;
using std::string;
using std::tuple;
using std::unordered_map;
using std::vector;

using namespace fmt::literals;

namespace binder {

static std::map<string, string > const cpp_python_operator_map{
	{"operator+", "__add__"}, //
	{"operator-", "__sub__"}, //
	{"operator*", "__mul__"}, //
	{"operator/", "__truediv__"}, //

	{"operator+=", "__iadd__"}, //
	{"operator-=", "__isub__"}, //
	{"operator*=", "__imul__"}, //
	{"operator/=", "__itruediv__"}, //

	{"operator()", "__call__"}, //
	{"operator==", "__eq__"}, //
	{"operator!=", "__ne__"}, //
	{"operator[]", "__getitem__"}, //
	{"operator=", "assign"}, //
	{"operator++", "plus_plus"}, //
	{"operator--", "minus_minus"}, //

	{"operator->", "arrow"}, //
};

// Generate function argument list separate by comma: int, bool, std::string
string function_arguments(clang::FunctionDecl const *record)
{
	string r;
{'fraction_non_alphanumeric': 0.21604938271604937, 'fraction_numerical': 0.003703703703703704, 'mean_word_length': 4.287112561174552, 'pattern_counts': {'":': 0, '<': 33, '<?xml version=': 0, '>': 35, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6301663', 'n_tokens_mistral': 1153, 'n_tokens_neox': 1155, 'n_words': 279}