Skip to content

Conversation

@bu6n
Copy link

@bu6n bu6n commented Aug 22, 2025

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

@davydog187
Copy link
Contributor

Thank you for the PR! Running the tests now

@bu6n
Copy link
Author

bu6n commented Sep 3, 2025

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

@bu6n
Copy link
Author

bu6n commented Sep 4, 2025

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
Copy link
Author

bu6n commented Sep 12, 2025

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

@smn
Copy link

smn commented Nov 11, 2025

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

@davydog187
Copy link
Contributor

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

{:illegal_index, nil,
keys
|> Enum.map(fn key ->
if(is_tuple(key)) do
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if(is_tuple(key)) do
if is_tuple(key) do

Failed to compile Lua!
Failed to tokenize: illegal token on line 1: \"hi)
Line 1: syntax error near '<\\34>'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

definitely not right

@davydog187
Copy link
Contributor

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
Copy link
Contributor

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

@davydog187
Copy link
Contributor

For reference:

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

@davydog187
Copy link
Contributor

PR sent upstream to Luerl rvirding/luerl#221

davydog187 added a commit that referenced this pull request Dec 6, 2025
@smn
Copy link

smn commented Dec 6, 2025

thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Depend on {:luerl, "<~ 1.5.0"}

3 participants