neolithos / neolua

A Lua implementation for the Dynamic Language Runtime (DLR).
https://neolua.codeplex.com/
Apache License 2.0
466 stars 76 forks source link

+ operator to concat strings #132

Closed lofcz closed 2 years ago

lofcz commented 3 years ago

NeoLua Version: 1.3.13

I'm looking to allow string concat via + operator.

eg:

test = "hello" + "world"

could you point me to a relevant points in codebase? I'm a bit lost in it.

neolithos commented 3 years ago

Lua syntax is:

test = "hello" .. "world";

Why would you change this?

lofcz commented 3 years ago

I've built JS-flavoured lua using Moonsharp, most of the things can be transpiled to valid Lua but I need to make a bunch of tweaks on the implementation level (this, zero-indexing of tables and a few more things). I'm looking to switch from Moonsharp due to perf reasons (it's a great lib other than that) and Neolua seems like a perfect fit due to DLR.

neolithos commented 3 years ago

You need a closer look to:

https://github.com/neolithos/neolua/blob/15df6e595fcb9f209d99e02b29b4fdc744dbe73f/NeoLua/Parser.Emit.cs#L139-L144