lua icon indicating copy to clipboard operation
lua copied to clipboard

feat: bump luerl to 1.5.0 (#86)

Open bu6n opened this issue 4 months ago • 10 comments

This bumps the luerl dependency to 1.5.0 and makes tests pass again.

Failing tests were either due to:

  • unicode Handling (this PR basically reverses 598e0ae because it seems now handled correctly by luerl)
  • changed error messages

The changelog mentions other things as well, but I'm not sure if these influence this library or not.

closes #86

bu6n avatar Aug 22 '25 11:08 bu6n

Thank you for the PR! Running the tests now

davydog187 avatar Sep 02 '25 17:09 davydog187

I think there might have been some problem with builds.hex.pm right when running the builds. Should they be retried?

bu6n avatar Sep 03 '25 14:09 bu6n

There seem to be a dialyzer check that's not passing. It's related to lib/lua.ex:288:

  defp illegal_index([:_G | keys]), do: illegal_index(keys)
  defp illegal_index(["_G" | keys]), do: illegal_index(keys)

  defp illegal_index(keys) do
    {:illegal_index, nil, Enum.join(keys, ".")}
  end

It seems that :_G cannot match anymore:

lib/lua.ex:288:8:pattern_match
The pattern can never match the type.

Pattern:
[:_G | _keys]

Type:
[
  false
  | nil
  | true
  | binary()
  | number()
  | {:eref, _}
  | {:erl_func, _}
  | {:tref, _}
  | {:usdref, _}
  | {:funref, _, _}
  | {:erl_mfa, _, _, _}
]

Do you think it is safe to just remove the line 288?

bu6n avatar Sep 04 '25 06:09 bu6n

Looking at it once more, it seems that just removing 288 won't be enough, since Enum.join will not work with tuples. What about something like this?

  defp illegal_index(["_G" | keys]), do: illegal_index(keys)

  defp illegal_index(keys) do
    {:illegal_index, nil,
     keys
     |> Enum.map(fn key ->
       if(is_tuple(key)) do
         inspect(key)
       else
         key
       end
     end)
     |> Enum.join(".")}
  end

bu6n avatar Sep 12 '25 04:09 bu6n

@davydog187 what are the chances of this getting merged? Mostly looking at the UTF-8 changes this PR addresses :)

smn avatar Nov 11 '25 16:11 smn

I'll get this pushed through this week. Apologies for the delay, we're on the other side of a big launch and just getting back to OSS

davydog187 avatar Nov 14 '25 22:11 davydog187

hello @bu6n sorry for the delay on reviewing this. It still seems like something is off, given the changes to the tests.

I can take a look if you'd like

davydog187 avatar Nov 20 '25 18:11 davydog187

Ok so there seems to be a regression in Luerl itself, I'll send a patch to Luerl

davydog187 avatar Nov 20 '25 18:11 davydog187

For reference:

 {1, :luerl_scan, {:user, ~c"syntax error near '<\\34>'"}}

davydog187 avatar Nov 20 '25 18:11 davydog187

PR sent upstream to Luerl https://github.com/rvirding/luerl/pull/221

davydog187 avatar Nov 22 '25 21:11 davydog187

thank you!

smn avatar Dec 06 '25 21:12 smn