9using namespace shader::parser;
10using namespace shader;
351;1;1;1;1;1;1;1;1;1;1+1;)";
36 EXPECT_EQ(Lexer(input, err_handler).token_types_str(), expect);
44 string scopes = R
"(GABbcmmmbbcm)";
63t<BA>;t<A<>>;t<>;tA<1,1>;AwA;AWA;AGA;AEA;ALA;A5A;A6A;)";
64 EXPECT_EQ(Lexer(input, err_handler).token_types_str(), expect);
77 EXPECT_EQ(Lexer(input, err_handler).token_types_str(), expect);
92 EXPECT_EQ(Lexer(input, err_handler).token_types_str(), expect);
101 string expect_scopes = R
"(GNN)";
108 int i = 0, u = 2, v = {1.0f};
118AA(AA=1){AA=1,A=1,A={1};{A=A=A,AP;i(AEA){r;}}})";
119 EXPECT_EQ(Lexer(input, err_handler).token_types_str(), expect);
153match(, const, bool, , foo, , ;)
154match([a], , int, , bar, [0], ;)
157 Parser parser(input, err_handler);
160 parser().foreach_declaration([&](Scope attributes,
163 Scope template_scope,
168 result += string(attributes.str()) +
", ";
169 result += string(const_tok.str()) +
", ";
170 result += string(type.str()) +
", ";
171 result += string(template_scope.str()) +
", ";
172 result += string(name.str()) +
", ";
174 result += string(decl_end.str()) +
")\n";
181TEST(shader_tool, Cleanup)
206 auto [
output, _, error] = process_test_string(input);
#define EXPECT_EQ(result, expect)
TEST(shader_tool, ExpressionParser)
EXPECT_EQ(BLI_expr_pylike_eval(expr, nullptr, 0, &result), EXPR_PYLIKE_INVALID)
Token(const TokenBuffer *buf, int32_t index)