Skip to content

Commit 5bf2069

Browse files
authored
chore: upgrade to Luerl 1.5.1 (#94)
1 parent ddbe111 commit 5bf2069

File tree

6 files changed

+21
-22
lines changed

6 files changed

+21
-22
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
77

88
## Unreleased
99

10+
11+
## [v0.4.0] - 2025-12-06
12+
13+
### Changed
14+
- Upgrade to Luerl 1.5.1
15+
16+
### Fixed
17+
- Warnings on Elixir 1.19
18+
1019
## [v0.3.0] - 2025-06-09
1120

1221
### Added

guides/working-with-lua.livemd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
```elixir
66
Mix.install([
7-
{:lua, "~> 0.3.0"}
7+
{:lua, "~> 0.4.0"}
88
])
99
```
1010

lib/lua.ex

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ defmodule Lua do
9090
end
9191

9292
chunk =
93-
case :luerl_comp.string(String.to_charlist(code), [:return]) do
93+
case :luerl_comp.string(code, [:return]) do
9494
{:ok, chunk} -> %Lua.Chunk{instructions: chunk}
9595
{:error, error, _warnings} -> raise Lua.CompilerException, error
9696
end
@@ -283,7 +283,6 @@ defmodule Lua do
283283
end
284284
end
285285

286-
defp illegal_index([:_G | keys]), do: illegal_index(keys)
287286
defp illegal_index(["_G" | keys]), do: illegal_index(keys)
288287

289288
defp illegal_index(keys) do
@@ -367,10 +366,6 @@ defmodule Lua do
367366
def eval!(%__MODULE__{state: state} = lua, script, opts) when is_binary(script) do
368367
opts = Keyword.validate!(opts, decode: true)
369368

370-
# Luerl does some weird things with UTF8 encoding
371-
# when its a binary see https://github.com/rvirding/luerl/issues/197
372-
script = String.to_charlist(script)
373-
374369
func =
375370
if opts[:decode] do
376371
&:luerl.do_dec/2
@@ -449,8 +444,6 @@ defmodule Lua do
449444
450445
"""
451446
def parse_chunk(code) do
452-
code = String.to_charlist(code)
453-
454447
case :luerl_comp.string(code, [:return]) do
455448
{:ok, chunk} ->
456449
{:ok, %Lua.Chunk{instructions: chunk}}

mix.exs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ defmodule Lua.MixProject do
22
use Mix.Project
33

44
@url "https://github.com/tv-labs/lua"
5-
@version "0.3.0"
5+
@version "0.4.0"
66

77
def project do
88
[
@@ -55,7 +55,7 @@ defmodule Lua.MixProject do
5555
# Run "mix help deps" to learn about dependencies.
5656
defp deps do
5757
[
58-
{:luerl, "~> 1.4.1"},
58+
{:luerl, "~> 1.5.1"},
5959
{:ex_doc, "~> 0.38", only: :dev, runtime: false},
6060
{:dialyxir, "~> 1.4", only: [:dev, :test], runtime: false}
6161
]

mix.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
%{
2-
"dialyxir": {:hex, :dialyxir, "1.4.5", "ca1571ac18e0f88d4ab245f0b60fa31ff1b12cbae2b11bd25d207f865e8ae78a", [:mix], [{:erlex, ">= 0.2.7", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "b0fb08bb8107c750db5c0b324fa2df5ceaa0f9307690ee3c1f6ba5b9eb5d35c3"},
2+
"dialyxir": {:hex, :dialyxir, "1.4.7", "dda948fcee52962e4b6c5b4b16b2d8fa7d50d8645bbae8b8685c3f9ecb7f5f4d", [:mix], [{:erlex, ">= 0.2.8", [hex: :erlex, repo: "hexpm", optional: false]}], "hexpm", "b34527202e6eb8cee198efec110996c25c5898f43a4094df157f8d28f27d9efe"},
33
"earmark_parser": {:hex, :earmark_parser, "1.4.44", "f20830dd6b5c77afe2b063777ddbbff09f9759396500cdbe7523efd58d7a339c", [:mix], [], "hexpm", "4778ac752b4701a5599215f7030989c989ffdc4f6df457c5f36938cc2d2a2750"},
4-
"erlex": {:hex, :erlex, "0.2.7", "810e8725f96ab74d17aac676e748627a07bc87eb950d2b83acd29dc047a30595", [:mix], [], "hexpm", "3ed95f79d1a844c3f6bf0cea61e0d5612a42ce56da9c03f01df538685365efb0"},
5-
"ex_doc": {:hex, :ex_doc, "0.38.1", "bae0a0bd5b5925b1caef4987e3470902d072d03347114ffe03a55dbe206dd4c2", [:mix], [{:earmark_parser, "~> 1.4.44", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "754636236d191b895e1e4de2ebb504c057fe1995fdfdd92e9d75c4b05633008b"},
6-
"luerl": {:hex, :luerl, "1.4.1", "0018b5002849a3ba401bc2dc5a67e45de4c404aacfd1b9d3c2fc50fde599ff12", [:rebar3], [], "hexpm", "618ff8967d23d8f8d5800a3784625aeafba7fa42648fd9af4f05fcd1383cb860"},
4+
"erlex": {:hex, :erlex, "0.2.8", "cd8116f20f3c0afe376d1e8d1f0ae2452337729f68be016ea544a72f767d9c12", [:mix], [], "hexpm", "9d66ff9fedf69e49dc3fd12831e12a8a37b76f8651dd21cd45fcf5561a8a7590"},
5+
"ex_doc": {:hex, :ex_doc, "0.39.2", "da5549bbce34c5fb0811f829f9f6b7a13d5607b222631d9e989447096f295c57", [:mix], [{:earmark_parser, "~> 1.4.44", [hex: :earmark_parser, repo: "hexpm", optional: false]}, {:makeup_c, ">= 0.1.0", [hex: :makeup_c, repo: "hexpm", optional: true]}, {:makeup_elixir, "~> 0.14 or ~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_erlang, "~> 0.1 or ~> 1.0", [hex: :makeup_erlang, repo: "hexpm", optional: false]}, {:makeup_html, ">= 0.1.0", [hex: :makeup_html, repo: "hexpm", optional: true]}], "hexpm", "62665526a88c207653dbcee2aac66c2c229d7c18a70ca4ffc7f74f9e01324daa"},
6+
"luerl": {:hex, :luerl, "1.5.1", "f6700420950fc6889137e7a0c11c4a8467dea04a8c23f707a40d83566d14e786", [:rebar3], [], "hexpm", "abf88d849baa0d5dca93b245a8688d4de2ee3d588159bb2faf51e15946509390"},
77
"makeup": {:hex, :makeup, "1.2.1", "e90ac1c65589ef354378def3ba19d401e739ee7ee06fb47f94c687016e3713d1", [:mix], [{:nimble_parsec, "~> 1.4", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "d36484867b0bae0fea568d10131197a4c2e47056a6fbe84922bf6ba71c8d17ce"},
88
"makeup_elixir": {:hex, :makeup_elixir, "1.0.1", "e928a4f984e795e41e3abd27bfc09f51db16ab8ba1aebdba2b3a575437efafc2", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2.3 or ~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "7284900d412a3e5cfd97fdaed4f5ed389b8f2b4cb49efc0eb3bd10e2febf9507"},
99
"makeup_erlang": {:hex, :makeup_erlang, "1.0.2", "03e1804074b3aa64d5fad7aa64601ed0fb395337b982d9bcf04029d68d51b6a7", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "af33ff7ef368d5893e4a267933e7744e46ce3cf1f61e2dccf53a111ed3aa3727"},

test/lua_test.exs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ defmodule LuaTest do
4747
message = """
4848
Failed to compile Lua!
4949
50-
Failed to tokenize: illegal token on line 1: \"hi)
50+
Line 1: syntax error near '\"'
5151
"""
5252

5353
assert_raise Lua.CompilerException, message, fn ->
@@ -121,8 +121,7 @@ defmodule LuaTest do
121121
error = """
122122
Failed to compile Lua!
123123
124-
Failed to tokenize: illegal token on line 1: '
125-
124+
Line 1: syntax error near '''
126125
"""
127126

128127
assert_raise Lua.CompilerException, error, fn ->
@@ -666,8 +665,7 @@ defmodule LuaTest do
666665
error = """
667666
Failed to compile Lua!
668667
669-
Failed to tokenize: illegal token on line 1: ")
670-
668+
Line 1: syntax error near '\"'
671669
"""
672670

673671
assert_raise Lua.CompilerException, error, fn ->
@@ -679,8 +677,7 @@ defmodule LuaTest do
679677
error = """
680678
Failed to compile Lua!
681679
682-
Failed to tokenize: illegal token on line 1: "yuup)
683-
680+
Line 1: syntax error near '\"'
684681
"""
685682

686683
assert_raise Lua.CompilerException, error, fn ->

0 commit comments

Comments
 (0)