本文整理汇总了C++中Symbols::init方法的典型用法代码示例。如果您正苦于以下问题:C++ Symbols::init方法的具体用法?C++ Symbols::init怎么用?C++ Symbols::init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Symbols
的用法示例。
在下文中一共展示了Symbols::init方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sym
TEST(Symbol, Test){
Symbols symbols;
Scanner::Plugins::Symbol sym(symbols);
symbols.init();
Scanner::StringCharacterWell mcw_1("string"), mcw_2("$4518"), mcw_3("+"), mcw_4("++"), mcw_5("+++"), mcw_6("==="), mcw_7("[]ll");
CHECK(sym.type() == Scanner::TokenType::TOKEN_TYPE_SYMBOL);
CHECK(!sym.matches(mcw_1));
CHECK(sym.get(mcw_1) == Scanner::Token(Scanner::TokenType::TOKEN_TYPE_NONE, ""));
mcw_1.commit();
CHECK(mcw_1.dump() == "string");
CHECK(!sym.matches(mcw_2));
CHECK(sym.get(mcw_2) == Scanner::Token(Scanner::TokenType::TOKEN_TYPE_NONE, ""));
mcw_2.commit();
CHECK(mcw_2.dump() == "$4518");
CHECK(sym.matches(mcw_3));
CHECK(sym.get(mcw_3) == Scanner::Token(Scanner::TokenType::TOKEN_TYPE_SYMBOL, "+"));
mcw_3.commit();
CHECK(mcw_3.dump() == "");
CHECK(sym.matches(mcw_4));
CHECK(sym.get(mcw_4) == Scanner::Token(Scanner::TokenType::TOKEN_TYPE_SYMBOL, "++"));
mcw_4.commit();
CHECK(mcw_4.dump() == "");
CHECK(sym.matches(mcw_5));
CHECK(sym.get(mcw_5) == Scanner::Token(Scanner::TokenType::TOKEN_TYPE_SYMBOL, "++"));
mcw_5.commit();
CHECK(mcw_5.dump() == "+");
CHECK(sym.matches(mcw_6));
CHECK(sym.get(mcw_6) == Scanner::Token(Scanner::TokenType::TOKEN_TYPE_SYMBOL, "==="));
mcw_6.commit();
CHECK(mcw_6.dump() == "");
CHECK(sym.matches(mcw_7));
CHECK(sym.get(mcw_7) == Scanner::Token(Scanner::TokenType::TOKEN_TYPE_SYMBOL, "[]"));
mcw_7.commit();
CHECK(mcw_7.dump() == "ll");
}