Change metamethod names
This commit is contained in:
parent
22063462a9
commit
38622ccbec
6
ast.c
6
ast.c
@ -18,9 +18,9 @@ static const char *OP_NAMES[] = {
|
||||
};
|
||||
|
||||
const char *binop_method_names[BINOP_XOR+1] = {
|
||||
[BINOP_POWER]="__pow", [BINOP_MULT]="__mul", [BINOP_DIVIDE]="__div",
|
||||
[BINOP_MOD]="__mod", [BINOP_MOD1]="__mod1", [BINOP_PLUS]="__add", [BINOP_MINUS]="__sub",
|
||||
[BINOP_CONCAT]="__concat", [BINOP_LSHIFT]="__lshift", [BINOP_RSHIFT]="__rshift",
|
||||
[BINOP_POWER]="__power", [BINOP_MULT]="__multiply", [BINOP_DIVIDE]="__divide",
|
||||
[BINOP_MOD]="__mod", [BINOP_MOD1]="__mod1", [BINOP_PLUS]="__add", [BINOP_MINUS]="__subtract",
|
||||
[BINOP_CONCAT]="__concatenate", [BINOP_LSHIFT]="__left_shift", [BINOP_RSHIFT]="__right_shift",
|
||||
[BINOP_AND]="__and", [BINOP_OR]="__or", [BINOP_XOR]="__xor",
|
||||
};
|
||||
|
||||
|
@ -2,19 +2,19 @@ struct Vec2(x,y:Int):
|
||||
func __add(a,b:Vec2; inline)->Vec2:
|
||||
return Vec2(a.x+b.x, a.y+b.y)
|
||||
|
||||
func __sub(a,b:Vec2; inline)->Vec2:
|
||||
func __subtract(a,b:Vec2; inline)->Vec2:
|
||||
return Vec2(a.x-b.x, a.y-b.y)
|
||||
|
||||
func __mul(a,b:Vec2; inline)->Int:
|
||||
func __multiply(a,b:Vec2; inline)->Int:
|
||||
return a.x*b.x + a.y*b.y
|
||||
|
||||
func __mul2(a:Vec2,b:Int; inline)->Vec2:
|
||||
func __multiply2(a:Vec2,b:Int; inline)->Vec2:
|
||||
return Vec2(a.x*b, a.y*b)
|
||||
|
||||
func __mul3(a:Int,b:Vec2; inline)->Vec2:
|
||||
func __multiply3(a:Int,b:Vec2; inline)->Vec2:
|
||||
return Vec2(a*b.x, a*b.y)
|
||||
|
||||
func __mul4(a,b:Vec2; inline)->Vec2:
|
||||
func __multiply4(a,b:Vec2; inline)->Vec2:
|
||||
return Vec2(a.x*b.x, a.y*b.y)
|
||||
|
||||
func __negative(v:Vec2; inline)->Vec2:
|
||||
|
Loading…
Reference in New Issue
Block a user