Add new loop tests

This commit is contained in:
Sahil Jain
2025-06-30 20:57:21 +05:30
parent a4a6a24f3e
commit a93fd14672
5 changed files with 116 additions and 3 deletions

View File

@@ -30,14 +30,23 @@ public:
{
if (m_ptr > -1)
m_stack[m_ptr--] = nullptr;
else {
#ifdef BLOCK_DEBUG
fprintf(stderr, "pop from empty stack\n");
#endif
}
}
PycRef<ASTNode> top() const
{
if (m_ptr > -1)
return m_stack[m_ptr];
else
else {
#ifdef BLOCK_DEBUG
fprintf(stderr, "top on empty stack\n");
#endif
return nullptr;
}
}
bool empty() const