Lines Matching full:sema
24 class MockSema : public Parser::Sema {
76 MockSema Sema;
77 Sema.parse("0");
78 Sema.parse("123");
79 Sema.parse("0x1f");
80 Sema.parse("12345678901");
81 Sema.parse("1a1");
82 EXPECT_EQ(5U, Sema.Values.size());
83 EXPECT_EQ(0U, Sema.Values[0].getUnsigned());
84 EXPECT_EQ(123U, Sema.Values[1].getUnsigned());
85 EXPECT_EQ(31U, Sema.Values[2].getUnsigned());
86 EXPECT_EQ("1:1: Error parsing unsigned token: <12345678901>", Sema.Errors[3]);
87 EXPECT_EQ("1:1: Error parsing unsigned token: <1a1>", Sema.Errors[4]);
91 MockSema Sema;
92 Sema.parse("\"Foo\"");
93 Sema.parse("\"\"");
94 Sema.parse("\"Baz");
95 EXPECT_EQ(3ULL, Sema.Values.size());
96 EXPECT_EQ("Foo", Sema.Values[0].getString());
97 EXPECT_EQ("", Sema.Values[1].getString());
98 EXPECT_EQ("1:1: Error parsing string token: <\"Baz>", Sema.Errors[2]);
119 MockSema Sema;
120 const uint64_t ExpectedFoo = Sema.expectMatcher("Foo");
121 const uint64_t ExpectedBar = Sema.expectMatcher("Bar");
122 const uint64_t ExpectedBaz = Sema.expectMatcher("Baz");
123 Sema.parse(" Foo ( Bar ( 17), Baz( \n \"B A,Z\") ) .bind( \"Yo!\") ");
124 for (size_t i = 0, e = Sema.Errors.size(); i != e; ++i) {
125 EXPECT_EQ("", Sema.Errors[i]);
128 EXPECT_EQ(1ULL, Sema.Values.size());
129 EXPECT_EQ(ExpectedFoo, getSingleMatcher(Sema.Values[0])->getID());
131 EXPECT_EQ(3ULL, Sema.Matchers.size());
132 const MockSema::MatcherInfo Bar = Sema.Matchers[0];
138 const MockSema::MatcherInfo Baz = Sema.Matchers[1];
144 const MockSema::MatcherInfo Foo = Sema.Matchers[2];
187 NamedSema Sema;
190 "functionDecl(param0, hasParameter(1, hasName(nameX)))", &Sema,