add a[b[x]] test

This commit is contained in:
pikastech 2022-07-11 17:20:23 +08:00
parent 9256a87258
commit 06a77caca9

View File

@ -3516,4 +3516,25 @@ TEST(parser, branket_issue3) {
args_deinit(buffs);
EXPECT_EQ(pikaMemNow(), 0);
}
#endif
#endif
#if PIKA_SYNTAX_SLICE_ENABLE
TEST(parser, branket_issue4) {
pikaMemInfo.heapUsedMax = 0;
Args* buffs = New_strBuff();
char* lines = "a = b[c[y]]\n";
__platform_printf("%s\n", lines);
char* pikaAsm = Parser_multiLineToAsm(buffs, lines);
__platform_printf("%s", pikaAsm);
EXPECT_STREQ(pikaAsm,
"B0\n"
"1 REF b\n"
"2 REF c\n"
"2 REF y\n"
"1 SLC \n"
"0 SLC \n"
"0 OUT a\n");
args_deinit(buffs);
EXPECT_EQ(pikaMemNow(), 0);
}
#endif