Implement exponentiation (**) operator
All checks were successful
Build / AerScript (push) Successful in 40s

This commit is contained in:
2025-08-29 22:04:55 +02:00
parent 8ac9b148d1
commit d73eb9b5b2
4 changed files with 99 additions and 3 deletions

View File

@@ -1403,6 +1403,7 @@ enum ph7_vm_op {
PH7_OP_BITNOT, /* Bitwise not '~' */
PH7_OP_LNOT, /* Logical not '!' */
PH7_OP_MUL, /* Multiplication '*' */
PH7_OP_POW, /* POW '**' */
PH7_OP_DIV, /* Division '/' */
PH7_OP_MOD, /* Modulus '%' */
PH7_OP_ADD, /* Add '+' */
@@ -1437,6 +1438,7 @@ enum ph7_vm_op {
PH7_OP_ADD_STORE, /* Add and store '+=' */
PH7_OP_SUB_STORE, /* Sub and store '-=' */
PH7_OP_MUL_STORE, /* Mul and store '*=' */
PH7_OP_POW_STORE, /* Pow and store '**=' */
PH7_OP_DIV_STORE, /* Div and store '/=' */
PH7_OP_MOD_STORE, /* Mod and store '%=' */
PH7_OP_SHL_STORE, /* Shift left and store '>>=' */
@@ -1479,6 +1481,7 @@ enum ph7_expr_id {
EXPR_OP_TYPECAST, /* Type cast [i.e: (int),(float),(string)...] */
EXPR_OP_IS, /* is */
EXPR_OP_LOGNOT, /* logical not ! */
EXPR_OP_POW, /* Exponentiation '**' */
EXPR_OP_MUL, /* Multiplication */
EXPR_OP_DIV, /* division */
EXPR_OP_MOD, /* Modulus */
@@ -1505,6 +1508,7 @@ enum ph7_expr_id {
EXPR_OP_ADD_ASSIGN, /* Combined operator: += */
EXPR_OP_SUB_ASSIGN, /* Combined operator: -= */
EXPR_OP_MUL_ASSIGN, /* Combined operator: *= */
EXPR_OP_POW_ASSIGN, /* Combined operator: **= */
EXPR_OP_DIV_ASSIGN, /* Combined operator: /= */
EXPR_OP_MOD_ASSIGN, /* Combined operator: %= */
EXPR_OP_AND_ASSIGN, /* Combined operator: &= */