Files
Pyarmor-Static-Unpack-1shot/ASTNode.cpp

208 lines
4.6 KiB
C++
Raw Permalink Normal View History

2009-07-26 10:07:13 +00:00
#include "ASTNode.h"
#include "bytecode.h"
2009-07-26 10:07:13 +00:00
/* ASTNodeList */
void ASTNodeList::removeLast()
{
list_t::iterator it = m_nodes.end();
--it;
m_nodes.erase(it);
}
void ASTNodeList::removeFirst()
{
m_nodes.erase(m_nodes.begin());
}
/* ASTUnary */
const char* ASTUnary::op_str() const
{
static const char* s_op_strings[] = {
"+", "-", "~", "not "
};
return s_op_strings[op()];
}
/* ASTBinary */
const char* ASTBinary::op_str() const
{
static const char* s_op_strings[] = {
".", " ** ", " * ", " / ", " // ", " % ", " + ", " - ",
" << ", " >> ", " & ", " ^ ", " | ", " and ", " or ", " @ ",
" += ", " -= ", " *= ", " /= ", " %= ", " **= ", " <<= ",
Squash merge of #348 (Plus some whitespace cleanup) commit ca302777438a6ac0ff00b9dbc87d2cf9e816b807 Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Thu Jun 1 14:55:26 2023 -0400 Test commit 1764514e1dc4018abf050e2e2c3378b6ebaca2a2 Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Thu Jun 1 14:46:49 2023 -0400 Semi-Support commit 104fa62355a18a071dae2d09db00af3b2fd22b6c Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Thu Jun 1 14:46:30 2023 -0400 Semi-Support commit 0809a71c725e3a92ece9348265f26f72fdb6664d Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Thu Jun 1 14:46:11 2023 -0400 Semi-Support commit bdf1695a57d2ad9eb1505a92ff4fa46c6f5ea90f Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Thu Jun 1 00:06:34 2023 -0400 Updated Test commit ea69a0b3be10568b70d02d744174e3bfc1d3546a Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Thu Jun 1 00:06:23 2023 -0400 Updated Test commit ecde2146208ea7a533267ace7293a49ce7a132bb Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Thu Jun 1 00:06:12 2023 -0400 Updated Test commit d5bbbe6224fc0aa8c5c3bc39b4f8845c8f941c7f Author: TheHellTower <thehelltower@tuta.io> Date: Wed May 31 23:59:46 2023 -0400 Feat: @zrax Co-authored-by: Michael Hansen <zrax0111@gmail.com> commit f8d2299d14a3a0f69b40486006d629ccc5c719df Author: TheHellTower <thehelltower@tuta.io> Date: Wed May 31 23:59:03 2023 -0400 Feat: @zrax Co-authored-by: Michael Hansen <zrax0111@gmail.com> commit 3fa8691f4c379dd10026227778ac60587fd07e68 Author: TheHellTower <thehelltower@tuta.io> Date: Wed May 31 23:58:53 2023 -0400 Feat: @zrax Co-authored-by: Michael Hansen <zrax0111@gmail.com> commit 6af17f0cffee31bc03ed8151e82b1720119d6a8d Author: TheHellTower <thehelltower@tuta.io> Date: Wed May 31 23:58:45 2023 -0400 Feat: @zrax Co-authored-by: Michael Hansen <zrax0111@gmail.com> commit c7c76097fce1f45da0308b9f5e9cfffb5a323fd9 Author: TheHellTower <thehelltower@tuta.io> Date: Wed May 31 16:55:20 2023 -0400 Remove `iostream` commit 2edaec022f8cbcb36bffd7ec86b5f71b391fb372 Author: TheHellTower <thehelltower@tuta.io> Date: Wed May 31 16:54:48 2023 -0400 Mistake commit a36d4c5e62afe24691701f6d0b7c758b4113db91 Author: TheHellTower <thehelltower@tuta.io> Date: Wed May 31 16:52:12 2023 -0400 Remove `iostream` commit 1c3a5b02c95352a8e90247757df17d1563698fb6 Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Wed May 31 16:43:30 2023 -0400 Should be a bit better commit 11603f1bb244c4d60ec34b675e1cd9c10945abf5 Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Wed May 31 04:07:47 2023 -0400 Update commit 689b544fc1023ec60e4df257f3448064fdf84c2b Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Wed May 31 04:07:38 2023 -0400 Update commit 20bc5b820fb2ef6fd9199546e11ac02d78e5b6da Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Wed May 31 04:07:24 2023 -0400 Update commit c01e8251fac1577d25ab440ade4bfe2b42eb1860 Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Wed May 31 04:05:28 2023 -0400 Format problem ? commit f35c494dd0d943323ec899cd8b2a236d11de67fc Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Wed May 31 04:02:03 2023 -0400 Fix commit 7f3265e4192e2b6eec81dc30a630691cead59694 Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Mon May 29 00:57:01 2023 -0400 BINARY_OP | Simplified commit 045a6041f7a5abb7b5cdeaa4882b2620462e1927 Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Mon May 29 00:56:53 2023 -0400 BINARY_OP | Simplified commit 0bfb76280e466e15c32ef42851d9981b9df57059 Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Mon May 29 00:56:41 2023 -0400 BINARY_OP | Simplified commit 31159d69e8f802d7955244b258795563018c3eda Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Mon May 29 00:50:19 2023 -0400 Fix Matching... commit e4a978aeadebe9c574856c30928ec58da9e32639 Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Mon May 29 00:50:06 2023 -0400 Fix Matching... commit d7a1b25b8f85886fcdc0a7c10c885e7e9e011281 Author: TheHellTower <thehelltower@tuta.io> Date: Mon May 29 00:41:43 2023 -0400 Add `BINARY_OP` support commit 6527299a67f043eb2b63e13ae43c4e9f060456e2 Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Mon May 29 00:40:32 2023 -0400 Add `BINARY_OP` test tokenized commit c053cab7895f49a085a0797a98e28e87f4874d39 Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Mon May 29 00:40:11 2023 -0400 Add `BINARY_OP` test commit e32f006f90a4e450099edd7d2f0bdbb0f1bbc612 Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Mon May 29 00:39:53 2023 -0400 Add `BINARY_OP` test compiled Closes #333 Closes #348 Co-authored-by: TheHellTower <dontbeshybuddy@gmail.com>
2023-06-01 13:18:22 -07:00
" >>= ", " &= ", " ^= ", " |= ", " //= ", " @= ", " <INVALID> "
};
return s_op_strings[op()];
}
ASTBinary::BinOp ASTBinary::from_opcode(int opcode)
{
switch (opcode) {
case Pyc::BINARY_ADD:
return BIN_ADD;
case Pyc::BINARY_AND:
return BIN_AND;
case Pyc::BINARY_DIVIDE:
return BIN_DIVIDE;
case Pyc::BINARY_FLOOR_DIVIDE:
return BIN_FLOOR_DIVIDE;
case Pyc::BINARY_LSHIFT:
return BIN_LSHIFT;
case Pyc::BINARY_MODULO:
return BIN_MODULO;
case Pyc::BINARY_MULTIPLY:
return BIN_MULTIPLY;
case Pyc::BINARY_OR:
return BIN_OR;
case Pyc::BINARY_POWER:
return BIN_POWER;
case Pyc::BINARY_RSHIFT:
return BIN_RSHIFT;
case Pyc::BINARY_SUBTRACT:
return BIN_SUBTRACT;
case Pyc::BINARY_TRUE_DIVIDE:
return BIN_DIVIDE;
case Pyc::BINARY_XOR:
return BIN_XOR;
case Pyc::BINARY_MATRIX_MULTIPLY:
return BIN_MAT_MULTIPLY;
case Pyc::INPLACE_ADD:
return BIN_IP_ADD;
case Pyc::INPLACE_AND:
return BIN_IP_AND;
case Pyc::INPLACE_DIVIDE:
return BIN_IP_DIVIDE;
case Pyc::INPLACE_FLOOR_DIVIDE:
return BIN_IP_FLOOR_DIVIDE;
case Pyc::INPLACE_LSHIFT:
return BIN_IP_LSHIFT;
case Pyc::INPLACE_MODULO:
return BIN_IP_MODULO;
case Pyc::INPLACE_MULTIPLY:
return BIN_IP_MULTIPLY;
case Pyc::INPLACE_OR:
return BIN_IP_OR;
case Pyc::INPLACE_POWER:
return BIN_IP_POWER;
case Pyc::INPLACE_RSHIFT:
return BIN_IP_RSHIFT;
case Pyc::INPLACE_SUBTRACT:
return BIN_IP_SUBTRACT;
case Pyc::INPLACE_TRUE_DIVIDE:
return BIN_IP_DIVIDE;
case Pyc::INPLACE_XOR:
return BIN_IP_XOR;
case Pyc::INPLACE_MATRIX_MULTIPLY:
return BIN_IP_MAT_MULTIPLY;
default:
return BIN_INVALID;
}
}
ASTBinary::BinOp ASTBinary::from_binary_op(int operand)
Squash merge of #348 (Plus some whitespace cleanup) commit ca302777438a6ac0ff00b9dbc87d2cf9e816b807 Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Thu Jun 1 14:55:26 2023 -0400 Test commit 1764514e1dc4018abf050e2e2c3378b6ebaca2a2 Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Thu Jun 1 14:46:49 2023 -0400 Semi-Support commit 104fa62355a18a071dae2d09db00af3b2fd22b6c Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Thu Jun 1 14:46:30 2023 -0400 Semi-Support commit 0809a71c725e3a92ece9348265f26f72fdb6664d Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Thu Jun 1 14:46:11 2023 -0400 Semi-Support commit bdf1695a57d2ad9eb1505a92ff4fa46c6f5ea90f Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Thu Jun 1 00:06:34 2023 -0400 Updated Test commit ea69a0b3be10568b70d02d744174e3bfc1d3546a Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Thu Jun 1 00:06:23 2023 -0400 Updated Test commit ecde2146208ea7a533267ace7293a49ce7a132bb Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Thu Jun 1 00:06:12 2023 -0400 Updated Test commit d5bbbe6224fc0aa8c5c3bc39b4f8845c8f941c7f Author: TheHellTower <thehelltower@tuta.io> Date: Wed May 31 23:59:46 2023 -0400 Feat: @zrax Co-authored-by: Michael Hansen <zrax0111@gmail.com> commit f8d2299d14a3a0f69b40486006d629ccc5c719df Author: TheHellTower <thehelltower@tuta.io> Date: Wed May 31 23:59:03 2023 -0400 Feat: @zrax Co-authored-by: Michael Hansen <zrax0111@gmail.com> commit 3fa8691f4c379dd10026227778ac60587fd07e68 Author: TheHellTower <thehelltower@tuta.io> Date: Wed May 31 23:58:53 2023 -0400 Feat: @zrax Co-authored-by: Michael Hansen <zrax0111@gmail.com> commit 6af17f0cffee31bc03ed8151e82b1720119d6a8d Author: TheHellTower <thehelltower@tuta.io> Date: Wed May 31 23:58:45 2023 -0400 Feat: @zrax Co-authored-by: Michael Hansen <zrax0111@gmail.com> commit c7c76097fce1f45da0308b9f5e9cfffb5a323fd9 Author: TheHellTower <thehelltower@tuta.io> Date: Wed May 31 16:55:20 2023 -0400 Remove `iostream` commit 2edaec022f8cbcb36bffd7ec86b5f71b391fb372 Author: TheHellTower <thehelltower@tuta.io> Date: Wed May 31 16:54:48 2023 -0400 Mistake commit a36d4c5e62afe24691701f6d0b7c758b4113db91 Author: TheHellTower <thehelltower@tuta.io> Date: Wed May 31 16:52:12 2023 -0400 Remove `iostream` commit 1c3a5b02c95352a8e90247757df17d1563698fb6 Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Wed May 31 16:43:30 2023 -0400 Should be a bit better commit 11603f1bb244c4d60ec34b675e1cd9c10945abf5 Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Wed May 31 04:07:47 2023 -0400 Update commit 689b544fc1023ec60e4df257f3448064fdf84c2b Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Wed May 31 04:07:38 2023 -0400 Update commit 20bc5b820fb2ef6fd9199546e11ac02d78e5b6da Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Wed May 31 04:07:24 2023 -0400 Update commit c01e8251fac1577d25ab440ade4bfe2b42eb1860 Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Wed May 31 04:05:28 2023 -0400 Format problem ? commit f35c494dd0d943323ec899cd8b2a236d11de67fc Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Wed May 31 04:02:03 2023 -0400 Fix commit 7f3265e4192e2b6eec81dc30a630691cead59694 Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Mon May 29 00:57:01 2023 -0400 BINARY_OP | Simplified commit 045a6041f7a5abb7b5cdeaa4882b2620462e1927 Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Mon May 29 00:56:53 2023 -0400 BINARY_OP | Simplified commit 0bfb76280e466e15c32ef42851d9981b9df57059 Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Mon May 29 00:56:41 2023 -0400 BINARY_OP | Simplified commit 31159d69e8f802d7955244b258795563018c3eda Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Mon May 29 00:50:19 2023 -0400 Fix Matching... commit e4a978aeadebe9c574856c30928ec58da9e32639 Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Mon May 29 00:50:06 2023 -0400 Fix Matching... commit d7a1b25b8f85886fcdc0a7c10c885e7e9e011281 Author: TheHellTower <thehelltower@tuta.io> Date: Mon May 29 00:41:43 2023 -0400 Add `BINARY_OP` support commit 6527299a67f043eb2b63e13ae43c4e9f060456e2 Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Mon May 29 00:40:32 2023 -0400 Add `BINARY_OP` test tokenized commit c053cab7895f49a085a0797a98e28e87f4874d39 Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Mon May 29 00:40:11 2023 -0400 Add `BINARY_OP` test commit e32f006f90a4e450099edd7d2f0bdbb0f1bbc612 Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Mon May 29 00:39:53 2023 -0400 Add `BINARY_OP` test compiled Closes #333 Closes #348 Co-authored-by: TheHellTower <dontbeshybuddy@gmail.com>
2023-06-01 13:18:22 -07:00
{
switch (operand) {
case 0:
return BIN_ADD;
case 1:
return BIN_AND;
case 2:
return BIN_FLOOR_DIVIDE;
Squash merge of #348 (Plus some whitespace cleanup) commit ca302777438a6ac0ff00b9dbc87d2cf9e816b807 Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Thu Jun 1 14:55:26 2023 -0400 Test commit 1764514e1dc4018abf050e2e2c3378b6ebaca2a2 Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Thu Jun 1 14:46:49 2023 -0400 Semi-Support commit 104fa62355a18a071dae2d09db00af3b2fd22b6c Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Thu Jun 1 14:46:30 2023 -0400 Semi-Support commit 0809a71c725e3a92ece9348265f26f72fdb6664d Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Thu Jun 1 14:46:11 2023 -0400 Semi-Support commit bdf1695a57d2ad9eb1505a92ff4fa46c6f5ea90f Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Thu Jun 1 00:06:34 2023 -0400 Updated Test commit ea69a0b3be10568b70d02d744174e3bfc1d3546a Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Thu Jun 1 00:06:23 2023 -0400 Updated Test commit ecde2146208ea7a533267ace7293a49ce7a132bb Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Thu Jun 1 00:06:12 2023 -0400 Updated Test commit d5bbbe6224fc0aa8c5c3bc39b4f8845c8f941c7f Author: TheHellTower <thehelltower@tuta.io> Date: Wed May 31 23:59:46 2023 -0400 Feat: @zrax Co-authored-by: Michael Hansen <zrax0111@gmail.com> commit f8d2299d14a3a0f69b40486006d629ccc5c719df Author: TheHellTower <thehelltower@tuta.io> Date: Wed May 31 23:59:03 2023 -0400 Feat: @zrax Co-authored-by: Michael Hansen <zrax0111@gmail.com> commit 3fa8691f4c379dd10026227778ac60587fd07e68 Author: TheHellTower <thehelltower@tuta.io> Date: Wed May 31 23:58:53 2023 -0400 Feat: @zrax Co-authored-by: Michael Hansen <zrax0111@gmail.com> commit 6af17f0cffee31bc03ed8151e82b1720119d6a8d Author: TheHellTower <thehelltower@tuta.io> Date: Wed May 31 23:58:45 2023 -0400 Feat: @zrax Co-authored-by: Michael Hansen <zrax0111@gmail.com> commit c7c76097fce1f45da0308b9f5e9cfffb5a323fd9 Author: TheHellTower <thehelltower@tuta.io> Date: Wed May 31 16:55:20 2023 -0400 Remove `iostream` commit 2edaec022f8cbcb36bffd7ec86b5f71b391fb372 Author: TheHellTower <thehelltower@tuta.io> Date: Wed May 31 16:54:48 2023 -0400 Mistake commit a36d4c5e62afe24691701f6d0b7c758b4113db91 Author: TheHellTower <thehelltower@tuta.io> Date: Wed May 31 16:52:12 2023 -0400 Remove `iostream` commit 1c3a5b02c95352a8e90247757df17d1563698fb6 Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Wed May 31 16:43:30 2023 -0400 Should be a bit better commit 11603f1bb244c4d60ec34b675e1cd9c10945abf5 Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Wed May 31 04:07:47 2023 -0400 Update commit 689b544fc1023ec60e4df257f3448064fdf84c2b Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Wed May 31 04:07:38 2023 -0400 Update commit 20bc5b820fb2ef6fd9199546e11ac02d78e5b6da Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Wed May 31 04:07:24 2023 -0400 Update commit c01e8251fac1577d25ab440ade4bfe2b42eb1860 Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Wed May 31 04:05:28 2023 -0400 Format problem ? commit f35c494dd0d943323ec899cd8b2a236d11de67fc Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Wed May 31 04:02:03 2023 -0400 Fix commit 7f3265e4192e2b6eec81dc30a630691cead59694 Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Mon May 29 00:57:01 2023 -0400 BINARY_OP | Simplified commit 045a6041f7a5abb7b5cdeaa4882b2620462e1927 Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Mon May 29 00:56:53 2023 -0400 BINARY_OP | Simplified commit 0bfb76280e466e15c32ef42851d9981b9df57059 Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Mon May 29 00:56:41 2023 -0400 BINARY_OP | Simplified commit 31159d69e8f802d7955244b258795563018c3eda Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Mon May 29 00:50:19 2023 -0400 Fix Matching... commit e4a978aeadebe9c574856c30928ec58da9e32639 Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Mon May 29 00:50:06 2023 -0400 Fix Matching... commit d7a1b25b8f85886fcdc0a7c10c885e7e9e011281 Author: TheHellTower <thehelltower@tuta.io> Date: Mon May 29 00:41:43 2023 -0400 Add `BINARY_OP` support commit 6527299a67f043eb2b63e13ae43c4e9f060456e2 Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Mon May 29 00:40:32 2023 -0400 Add `BINARY_OP` test tokenized commit c053cab7895f49a085a0797a98e28e87f4874d39 Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Mon May 29 00:40:11 2023 -0400 Add `BINARY_OP` test commit e32f006f90a4e450099edd7d2f0bdbb0f1bbc612 Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Mon May 29 00:39:53 2023 -0400 Add `BINARY_OP` test compiled Closes #333 Closes #348 Co-authored-by: TheHellTower <dontbeshybuddy@gmail.com>
2023-06-01 13:18:22 -07:00
case 3:
return BIN_LSHIFT;
case 4:
return BIN_MAT_MULTIPLY;
case 5:
return BIN_MULTIPLY;
case 6:
return BIN_MODULO;
case 7:
return BIN_OR;
case 8:
return BIN_POWER;
case 9:
return BIN_RSHIFT;
case 10:
return BIN_SUBTRACT;
case 11:
return BIN_DIVIDE;
case 12:
return BIN_XOR;
case 13:
return BIN_IP_ADD;
case 14:
return BIN_IP_AND;
case 15:
return BIN_IP_FLOOR_DIVIDE;
Squash merge of #348 (Plus some whitespace cleanup) commit ca302777438a6ac0ff00b9dbc87d2cf9e816b807 Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Thu Jun 1 14:55:26 2023 -0400 Test commit 1764514e1dc4018abf050e2e2c3378b6ebaca2a2 Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Thu Jun 1 14:46:49 2023 -0400 Semi-Support commit 104fa62355a18a071dae2d09db00af3b2fd22b6c Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Thu Jun 1 14:46:30 2023 -0400 Semi-Support commit 0809a71c725e3a92ece9348265f26f72fdb6664d Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Thu Jun 1 14:46:11 2023 -0400 Semi-Support commit bdf1695a57d2ad9eb1505a92ff4fa46c6f5ea90f Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Thu Jun 1 00:06:34 2023 -0400 Updated Test commit ea69a0b3be10568b70d02d744174e3bfc1d3546a Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Thu Jun 1 00:06:23 2023 -0400 Updated Test commit ecde2146208ea7a533267ace7293a49ce7a132bb Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Thu Jun 1 00:06:12 2023 -0400 Updated Test commit d5bbbe6224fc0aa8c5c3bc39b4f8845c8f941c7f Author: TheHellTower <thehelltower@tuta.io> Date: Wed May 31 23:59:46 2023 -0400 Feat: @zrax Co-authored-by: Michael Hansen <zrax0111@gmail.com> commit f8d2299d14a3a0f69b40486006d629ccc5c719df Author: TheHellTower <thehelltower@tuta.io> Date: Wed May 31 23:59:03 2023 -0400 Feat: @zrax Co-authored-by: Michael Hansen <zrax0111@gmail.com> commit 3fa8691f4c379dd10026227778ac60587fd07e68 Author: TheHellTower <thehelltower@tuta.io> Date: Wed May 31 23:58:53 2023 -0400 Feat: @zrax Co-authored-by: Michael Hansen <zrax0111@gmail.com> commit 6af17f0cffee31bc03ed8151e82b1720119d6a8d Author: TheHellTower <thehelltower@tuta.io> Date: Wed May 31 23:58:45 2023 -0400 Feat: @zrax Co-authored-by: Michael Hansen <zrax0111@gmail.com> commit c7c76097fce1f45da0308b9f5e9cfffb5a323fd9 Author: TheHellTower <thehelltower@tuta.io> Date: Wed May 31 16:55:20 2023 -0400 Remove `iostream` commit 2edaec022f8cbcb36bffd7ec86b5f71b391fb372 Author: TheHellTower <thehelltower@tuta.io> Date: Wed May 31 16:54:48 2023 -0400 Mistake commit a36d4c5e62afe24691701f6d0b7c758b4113db91 Author: TheHellTower <thehelltower@tuta.io> Date: Wed May 31 16:52:12 2023 -0400 Remove `iostream` commit 1c3a5b02c95352a8e90247757df17d1563698fb6 Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Wed May 31 16:43:30 2023 -0400 Should be a bit better commit 11603f1bb244c4d60ec34b675e1cd9c10945abf5 Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Wed May 31 04:07:47 2023 -0400 Update commit 689b544fc1023ec60e4df257f3448064fdf84c2b Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Wed May 31 04:07:38 2023 -0400 Update commit 20bc5b820fb2ef6fd9199546e11ac02d78e5b6da Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Wed May 31 04:07:24 2023 -0400 Update commit c01e8251fac1577d25ab440ade4bfe2b42eb1860 Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Wed May 31 04:05:28 2023 -0400 Format problem ? commit f35c494dd0d943323ec899cd8b2a236d11de67fc Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Wed May 31 04:02:03 2023 -0400 Fix commit 7f3265e4192e2b6eec81dc30a630691cead59694 Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Mon May 29 00:57:01 2023 -0400 BINARY_OP | Simplified commit 045a6041f7a5abb7b5cdeaa4882b2620462e1927 Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Mon May 29 00:56:53 2023 -0400 BINARY_OP | Simplified commit 0bfb76280e466e15c32ef42851d9981b9df57059 Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Mon May 29 00:56:41 2023 -0400 BINARY_OP | Simplified commit 31159d69e8f802d7955244b258795563018c3eda Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Mon May 29 00:50:19 2023 -0400 Fix Matching... commit e4a978aeadebe9c574856c30928ec58da9e32639 Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Mon May 29 00:50:06 2023 -0400 Fix Matching... commit d7a1b25b8f85886fcdc0a7c10c885e7e9e011281 Author: TheHellTower <thehelltower@tuta.io> Date: Mon May 29 00:41:43 2023 -0400 Add `BINARY_OP` support commit 6527299a67f043eb2b63e13ae43c4e9f060456e2 Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Mon May 29 00:40:32 2023 -0400 Add `BINARY_OP` test tokenized commit c053cab7895f49a085a0797a98e28e87f4874d39 Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Mon May 29 00:40:11 2023 -0400 Add `BINARY_OP` test commit e32f006f90a4e450099edd7d2f0bdbb0f1bbc612 Author: TheHellTower <dontbeshybuddy@gmail.com> Date: Mon May 29 00:39:53 2023 -0400 Add `BINARY_OP` test compiled Closes #333 Closes #348 Co-authored-by: TheHellTower <dontbeshybuddy@gmail.com>
2023-06-01 13:18:22 -07:00
case 16:
return BIN_IP_LSHIFT;
case 17:
return BIN_MAT_MULTIPLY;
case 18:
return BIN_IP_MULTIPLY;
case 19:
return BIN_IP_MODULO;
case 20:
return BIN_IP_OR;
case 21:
return BIN_IP_POWER;
case 22:
return BIN_IP_RSHIFT;
case 23:
return BIN_IP_SUBTRACT;
case 24:
return BIN_IP_DIVIDE;
case 25:
return BIN_IP_XOR;
default:
return BIN_INVALID; // Return BIN_INVALID for out-of-range operand
}
}
2009-07-26 10:07:13 +00:00
/* ASTCompare */
const char* ASTCompare::op_str() const
{
static const char* s_cmp_strings[] = {
" < ", " <= ", " == ", " != ", " > ", " >= ", " in ", " not in ", " is ", " is not ",
2009-07-26 10:07:13 +00:00
"<EXCEPTION MATCH>", "<BAD>"
};
return s_cmp_strings[op()];
2009-07-26 10:07:13 +00:00
}
2010-12-20 22:58:44 -08:00
/* ASTKeyword */
const char* ASTKeyword::word_str() const
{
static const char* s_word_strings[] = {
"pass", "break", "continue"
};
return s_word_strings[key()];
}
2010-12-20 22:58:44 -08:00
/* ASTBlock */
void ASTBlock::removeLast()
{
list_t::iterator it = m_nodes.end();
--it;
m_nodes.erase(it);
}
void ASTBlock::removeFirst()
{
m_nodes.erase(m_nodes.begin());
2010-12-20 22:58:44 -08:00
}
const char* ASTBlock::type_str() const
{
static const char* s_type_strings[] = {
"", "if", "else", "elif", "try", "CONTAINER", "except",
"finally", "while", "for", "with", "async for"
2010-12-20 22:58:44 -08:00
};
return s_type_strings[blktype()];
2010-12-20 22:58:44 -08:00
}