コード例 #1
0
ファイル: tokenrules.cpp プロジェクト: okknor/edit
namespace tokenizer {
TokenizerMethod tokenRules[] = {
    {   "symbol", create_regex(operator_regex()),
        [](const ematch_result& match, token_list_t& list) {
            list.push_back(Token(token::type::symbol, estring(match[0])));
        }
    },
    {   "number", create_regex("\\d+\\.\\d*"),
        [](const ematch_result& match, token_list_t& list) {
            list.push_back(Token(token::type::number, estring(match[0])));
        }
    },
    {   "integer", create_regex("\\d+"),
        [](const ematch_result& match, token_list_t& list) {
            list.push_back(Token(token::type::integer, estring(match[0])));
        }
    },
    {   "word", create_regex("\\w+"),
        [](const ematch_result& match, token_list_t& list) {
            list.push_back(Token(token::type::word, estring(match[0])));
        }
    },
    {   "text", create_regex("\"([^\"]*)\""),
        [](const ematch_result& match, token_list_t& list) {
            list.push_back(Token(token::type::text, estring(match[1])));
        }
    },
};
unsigned int tokenRulesSize = sizeof(tokenRules) / sizeof(TokenizerMethod);
}
コード例 #2
0
ファイル: encoded_string.cpp プロジェクト: okknor/edit
estring operator+(const std::string& lhs, const estring& rhs) {
	return estring(lhs) + rhs;
}
コード例 #3
0
ファイル: encoded_string.cpp プロジェクト: okknor/edit
estring operator+(const char* lhs, const estring& rhs) {
	return estring(lhs) + rhs;
}
コード例 #4
0
ファイル: encoded_string.cpp プロジェクト: okknor/edit
static estring _to_estring(T val) {
	return estring(std::to_string(val));
}
コード例 #5
0
ファイル: encoded_string.cpp プロジェクト: okknor/edit
estring estring::transcode(std::string encoding) const {
	return estring(begin(), end(), encoding);
}
コード例 #6
0
ファイル: TestCase.cpp プロジェクト: XeanoRRR/mmo-resourse
// Build a message about a failed equality check 
std::string TestCase::notEqualsMessage (double expected, double actual)
{ 
    return "expected: " + estring (expected) + " but was: " + estring (actual); 
}
コード例 #7
0
ファイル: TestCase.cpp プロジェクト: XeanoRRR/mmo-resourse
// Build a message about a failed equality check 
std::string TestCase::notEqualsMessage (long expected, long actual)
{ 
    return "expected: " + estring (expected) + " but was: " + estring (actual); 
}
コード例 #8
0
// Build a message about a failed equality check
std::string TestCase::notEqualsMessage(const void* expected, const void* actual)
{
	return "expected: " + estring(expected) + " but was: " + estring(actual);
}