Added a function for memory size alignment

This commit is contained in:
2025-04-15 11:08:33 +02:00
parent 19a8154e06
commit 80aa833a9b
5 changed files with 44 additions and 0 deletions

View File

@ -117,6 +117,9 @@ func TestParse(t *testing.T) {
{"Dereferencing 2", "[a+b]", "(@ (+ a b))"},
{"Dereferencing 3", "[a+b]=c", "(= (@ (+ a b)) c)"},
{"Dereferencing 3", "[a+b]=c+d", "(= (@ (+ a b)) (+ c d))"},
{"Assign bitwise OR", "a|=b", "(|= a b)"},
{"Assign bitwise OR 2", "a|=b<<c", "(|= a (<< b c))"},
}
for _, test := range tests {

View File

@ -51,6 +51,9 @@ var Operators = [64]Operator{
token.MulAssign: {"*=", math.MinInt8, 2},
token.DivAssign: {"/=", math.MinInt8, 2},
token.ModAssign: {"%=", math.MinInt8, 2},
token.AndAssign: {"&=", math.MinInt8, 2},
token.OrAssign: {"|=", math.MinInt8, 2},
token.XorAssign: {"^=", math.MinInt8, 2},
token.ShrAssign: {">>=", math.MinInt8, 2},
token.ShlAssign: {"<<=", math.MinInt8, 2},
}