mirror of
https://github.com/Reuh/anselme.git
synced 2025-10-27 16:49:31 +00:00
Fix + operator overloading
This commit is contained in:
parent
ec18d2e611
commit
9028970440
3 changed files with 14 additions and 12 deletions
|
|
@ -133,12 +133,14 @@ functions = {
|
|||
-- arithmetic
|
||||
["+"] = {
|
||||
{
|
||||
arity = 2, types = { "number", "number" }, return_type = "number",
|
||||
value = function(a, b) return a + b end
|
||||
},
|
||||
{
|
||||
arity = 2, types = { "string", "string" }, return_type = "string",
|
||||
value = function(a, b) return a .. b end
|
||||
arity = 2,
|
||||
value = function(a, b)
|
||||
if type(a) == "string" then
|
||||
return a .. b
|
||||
else
|
||||
return a + b
|
||||
end
|
||||
end
|
||||
}
|
||||
},
|
||||
["-"] = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue