fix weight calculation, improve assembly output efficiency, improve logging
This commit is contained in:
+3
-3
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user