fix weight calculation, improve assembly output efficiency, improve logging

This commit is contained in:
2026-11-08 15:03:23 +02:00
parent 81deb637c0
commit e8f3f76117
4 changed files with 47 additions and 12 deletions
+3 -3
View File
@@ -30,7 +30,7 @@ public:
NOP // not an operator
};
static int weight_op(Operator o)
[[nodiscard]] static int weight_op(Operator o)
{
switch (o)
{
@@ -408,7 +408,7 @@ public:
}
}
int weight()
int weight() const
{
int w = 0;
@@ -424,7 +424,7 @@ public:
if (o.t == Token::OPERATOR)
{
Token::weight_op(o.v.o);
w += Token::weight_op(o.v.o);
}
return w;