teal-language / tl

The compiler for Teal, a typed dialect of Lua
MIT License
2.03k stars 101 forks source link

fix string.find signature #674

Closed fperrad closed 12 months ago

fperrad commented 1 year ago

return only 2 integers as start and end position

github-actions[bot] commented 1 year ago

Teal Playground URL: https://674--teal-playground-preview.netlify.app

hishamhm commented 12 months ago

From https://www.lua.org/manual/5.4/manual.html#pdf-string.find :

If the pattern has captures, then in a successful match the captured values are also returned, after the two indices.

That is why the return is of vararg type integer, integer, string...

fperrad commented 12 months ago

sorry for the noise

hishamhm commented 12 months ago

@fperrad no worries! thanks for giving Teal a spin!!