Skip to content

Commit 134d909

Browse files
authored
Revert for release (#1502)
1 parent 8c15393 commit 134d909

File tree

7 files changed

+38
-41
lines changed

7 files changed

+38
-41
lines changed

lib/live_view_native/swiftui/rules_parser/expressions.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,6 @@ defmodule LiveViewNative.SwiftUI.RulesParser.Expressions do
123123
end
124124

125125
def key_value_pairs(opts \\ []) do
126-
comma_separated_list(key_value_pair(opts), opts)
126+
wrap(comma_separated_list(key_value_pair(opts), opts))
127127
end
128128
end

lib/live_view_native/swiftui/rules_parser/modifiers.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ defmodule LiveViewNative.SwiftUI.RulesParser.Modifiers do
99

1010
defcombinator(
1111
:key_value_list,
12-
enclosed("[", wrap(key_value_pairs(generate_error?: true, allow_empty?: false)), "]",
12+
enclosed("[", key_value_pairs(generate_error?: true, allow_empty?: false), "]",
1313
allow_empty?: false,
1414
error_parser: non_whitespace(also_ignore: String.to_charlist(")],"))
1515
)

lib/live_view_native/swiftui/rules_parser/post_processors.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ defmodule LiveViewNative.SwiftUI.RulesParser.PostProcessors do
154154

155155
def event_to_ast(rest, [opts, name], context, {line, _}, _byte_offset) do
156156
annotations = context_to_annotation(context.context, line)
157-
{rest, [{:__event__, annotations, [name] ++ List.wrap(opts)}], context}
157+
{rest, [{:__event__, annotations, [name, opts]}], context}
158158
end
159159

160160
def add_annotations(rest, parts, context, {line, _}, _byte_offset) do

mix.lock

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,25 +6,25 @@
66
"earmark_parser": {:hex, :earmark_parser, "1.4.41", "ab34711c9dc6212dda44fcd20ecb87ac3f3fce6f0ca2f28d4a00e4154f8cd599", [:mix], [], "hexpm", "a81a04c7e34b6617c2792e291b5a2e57ab316365c2644ddc553bb9ed863ebefa"},
77
"ex_doc": {:hex, :ex_doc, "0.35.1", "de804c590d3df2d9d5b8aec77d758b00c814b356119b3d4455e4b8a8687aecaf", [:mix], [{:earmark_parser, "~> 1.4.39", [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", "2121c6402c8d44b05622677b761371a759143b958c6c19f6558ff64d0aed40df"},
88
"expo": {:hex, :expo, "1.1.0", "f7b9ed7fb5745ebe1eeedf3d6f29226c5dd52897ac67c0f8af62a07e661e5c75", [:mix], [], "hexpm", "fbadf93f4700fb44c331362177bdca9eeb8097e8b0ef525c9cc501cb9917c960"},
9-
"floki": {:hex, :floki, "0.36.3", "1102f93b16a55bc5383b85ae3ec470f82dee056eaeff9195e8afdf0ef2a43c30", [:mix], [], "hexpm", "fe0158bff509e407735f6d40b3ee0d7deb47f3f3ee7c6c182ad28599f9f6b27a"},
9+
"floki": {:hex, :floki, "0.37.0", "b83e0280bbc6372f2a403b2848013650b16640cd2470aea6701f0632223d719e", [:mix], [], "hexpm", "516a0c15a69f78c47dc8e0b9b3724b29608aa6619379f91b1ffa47109b5d0dd3"},
1010
"gettext": {:hex, :gettext, "0.26.2", "5978aa7b21fada6deabf1f6341ddba50bc69c999e812211903b169799208f2a8", [:mix], [{:expo, "~> 0.5.1 or ~> 1.0", [hex: :expo, repo: "hexpm", optional: false]}], "hexpm", "aa978504bcf76511efdc22d580ba08e2279caab1066b76bb9aa81c4a1e0a32a5"},
1111
"jason": {:hex, :jason, "1.4.4", "b9226785a9aa77b6857ca22832cffa5d5011a667207eb2a0ad56adb5db443b8a", [:mix], [{:decimal, "~> 1.0 or ~> 2.0", [hex: :decimal, repo: "hexpm", optional: true]}], "hexpm", "c5eb0cab91f094599f94d55bc63409236a8ec69a21a67814529e8d5f6cc90b3b"},
12-
"live_view_native": {:git, "https://github.com/liveview-native/live_view_native.git", "d782846919e5065909339f240874d14f3c016ae2", []},
13-
"live_view_native_live_form": {:git, "https://github.com/liveview-native/liveview-native-live-form.git", "de83d04d5f586fd20849490daae30a85ad321d77", []},
12+
"live_view_native": {:git, "https://github.com/liveview-native/live_view_native.git", "68118fcaa4a5622054225558302c8a9fbd3b225c", []},
13+
"live_view_native_live_form": {:git, "https://github.com/liveview-native/liveview-native-live-form.git", "0b94bafe184744537a5eb43a2a66339a7e39c8ae", []},
1414
"live_view_native_stylesheet": {:hex, :live_view_native_stylesheet, "0.3.1", "71a1cee29ec3fe0003949250035ec905e6e7c706928e94ff8823be8108267e1b", [:mix], [{:live_view_native, "~> 0.3.1", [hex: :live_view_native, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "ca2a9a47b34be56099d6c1523a2cb69274ba2a5ecff441cacb4b885483fb39b3"},
15-
"live_view_native_test_endpoint": {:git, "https://github.com/liveview-native/live_view_native_test_endpoint.git", "29153c238498426354529ae0816e00a172247bb3", [branch: "main"]},
15+
"live_view_native_test_endpoint": {:git, "https://github.com/liveview-native/live_view_native_test_endpoint.git", "be09319cc2def0e93a2aba79d8db7ba989560afa", [branch: "main"]},
1616
"makeup": {:hex, :makeup, "1.2.1", "e90ac1c65589ef354378def3ba19d401e739ee7ee06fb47f94c687016e3713d1", [:mix], [{:nimble_parsec, "~> 1.4", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "d36484867b0bae0fea568d10131197a4c2e47056a6fbe84922bf6ba71c8d17ce"},
1717
"makeup_eex": {:hex, :makeup_eex, "1.0.0", "436d4c00204c250b17a775d64e197798aaf374627e6a4f2d3fd3074a8db61db4", [:mix], [{:makeup, "~> 1.2.1 or ~> 1.3", [hex: :makeup, repo: "hexpm", optional: false]}, {:makeup_elixir, "~> 1.0", [hex: :makeup_elixir, repo: "hexpm", optional: false]}, {:makeup_html, "~> 0.1.0 or ~> 1.0", [hex: :makeup_html, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.2", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "3bb699bc519e4f509f1bf8a2e0ba0e08429edf3580053cd31a4f9c1bc5da86c8"},
18-
"makeup_elixir": {:hex, :makeup_elixir, "1.0.0", "74bb8348c9b3a51d5c589bf5aebb0466a84b33274150e3b6ece1da45584afc82", [: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", "49159b7d7d999e836bedaf09dcf35ca18b312230cf901b725a64f3f42e407983"},
18+
"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"},
1919
"makeup_erlang": {:hex, :makeup_erlang, "1.0.1", "c7f58c120b2b5aa5fd80d540a89fdf866ed42f1f3994e4fe189abebeab610839", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "8a89a1eeccc2d798d6ea15496a6e4870b75e014d1af514b1b71fa33134f57814"},
2020
"makeup_html": {:hex, :makeup_html, "0.1.2", "19d4050c0978a4f1618ffe43054c0049f91fe5feeb9ae8d845b5dc79c6008ae5", [:mix], [{:makeup, "~> 1.2", [hex: :makeup, repo: "hexpm", optional: false]}], "hexpm", "b7fb9afedd617d167e6644a0430e49c1279764bfd3153da716d4d2459b0998c5"},
2121
"makeup_json": {:hex, :makeup_json, "0.1.1", "44204f3f023ff3daca682cc0b1dc372098514460064599979cb4cde5926cff70", [:mix], [{:makeup, "~> 1.0", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.1", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "3879d78117e37a9b1e567b9cc76c1b5b51b9efc5f4f4301ea5e53fb70c59c718"},
2222
"makeup_swift": {:hex, :makeup_swift, "0.0.2", "d62c7ae04622985806435536f3680b40559a4c426e4c2fc009b7ea610e55358a", [:mix], [{:makeup, "~> 1.1", [hex: :makeup, repo: "hexpm", optional: false]}, {:nimble_parsec, "~> 1.3", [hex: :nimble_parsec, repo: "hexpm", optional: false]}], "hexpm", "8f8e0f47b5a5824bf33ad2a5bf39ef665188af19b3b165f9fe81aa40f09ca7fc"},
2323
"mime": {:hex, :mime, "2.0.6", "8f18486773d9b15f95f4f4f1e39b710045fa1de891fada4516559967276e4dc2", [:mix], [], "hexpm", "c9945363a6b26d747389aac3643f8e0e09d30499a138ad64fe8fd1d13d9b153e"},
2424
"nimble_parsec": {:hex, :nimble_parsec, "1.4.0", "51f9b613ea62cfa97b25ccc2c1b4216e81df970acd8e16e8d1bdc58fef21370d", [:mix], [], "hexpm", "9c565862810fb383e9838c1dd2d7d2c437b3d13b267414ba6af33e50d2d1cf28"},
25-
"phoenix": {:hex, :phoenix, "1.7.16", "b9f7100b06dfe85e1f35e734e4691d736d4738e3cbf83dd11ba1ef7fa021c49e", [:mix], [{:castore, ">= 0.0.0", [hex: :castore, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.1", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: true]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.7", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:plug_crypto, "~> 1.2 or ~> 2.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:websock_adapter, "~> 0.5.3", [hex: :websock_adapter, repo: "hexpm", optional: false]}], "hexpm", "17d3a2909000a8f47c14145f344be2258da425e802fb70cb7dc3e5df24590bb0"},
25+
"phoenix": {:hex, :phoenix, "1.7.18", "5310c21443514be44ed93c422e15870aef254cf1b3619e4f91538e7529d2b2e4", [:mix], [{:castore, ">= 0.0.0", [hex: :castore, repo: "hexpm", optional: false]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix_pubsub, "~> 2.1", [hex: :phoenix_pubsub, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: true]}, {:plug, "~> 1.14", [hex: :plug, repo: "hexpm", optional: false]}, {:plug_cowboy, "~> 2.7", [hex: :plug_cowboy, repo: "hexpm", optional: true]}, {:plug_crypto, "~> 1.2 or ~> 2.0", [hex: :plug_crypto, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}, {:websock_adapter, "~> 0.5.3", [hex: :websock_adapter, repo: "hexpm", optional: false]}], "hexpm", "1797fcc82108442a66f2c77a643a62980f342bfeb63d6c9a515ab8294870004e"},
2626
"phoenix_html": {:hex, :phoenix_html, "4.1.1", "4c064fd3873d12ebb1388425a8f2a19348cef56e7289e1998e2d2fa758aa982e", [:mix], [], "hexpm", "f2f2df5a72bc9a2f510b21497fd7d2b86d932ec0598f0210fed4114adc546c6f"},
27-
"phoenix_live_view": {:hex, :phoenix_live_view, "1.0.0-rc.9", "6d08ce08a091710f15f36cf8249a16ddf59cc7156ad0c57989a2858b8bc94f0b", [:mix], [{:floki, "~> 0.36", [hex: :floki, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix, "~> 1.6.15 or ~> 1.7.0", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 3.3 or ~> 4.0", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: true]}, {:plug, "~> 1.15", [hex: :plug, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "8479ba909b6aeedcef312c030363906a689f96ac42376269a39f10c718746bfe"},
27+
"phoenix_live_view": {:hex, :phoenix_live_view, "1.0.1", "5389a30658176c0de816636ce276567478bffd063c082515a6e8368b8fc9a0db", [:mix], [{:floki, "~> 0.36", [hex: :floki, repo: "hexpm", optional: true]}, {:jason, "~> 1.0", [hex: :jason, repo: "hexpm", optional: true]}, {:phoenix, "~> 1.6.15 or ~> 1.7.0", [hex: :phoenix, repo: "hexpm", optional: false]}, {:phoenix_html, "~> 3.3 or ~> 4.0", [hex: :phoenix_html, repo: "hexpm", optional: false]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}, {:phoenix_view, "~> 2.0", [hex: :phoenix_view, repo: "hexpm", optional: true]}, {:plug, "~> 1.15", [hex: :plug, repo: "hexpm", optional: false]}, {:telemetry, "~> 0.4.2 or ~> 1.0", [hex: :telemetry, repo: "hexpm", optional: false]}], "hexpm", "c0f517e6f290f10dbb94343ac22e0109437fb1fa6f0696e7c73967b789c1c285"},
2828
"phoenix_pubsub": {:hex, :phoenix_pubsub, "2.1.3", "3168d78ba41835aecad272d5e8cd51aa87a7ac9eb836eabc42f6e57538e3731d", [:mix], [], "hexpm", "bba06bc1dcfd8cb086759f0edc94a8ba2bc8896d5331a1e2c2902bf8e36ee502"},
2929
"phoenix_template": {:hex, :phoenix_template, "1.0.4", "e2092c132f3b5e5b2d49c96695342eb36d0ed514c5b252a77048d5969330d639", [:mix], [{:phoenix_html, "~> 2.14.2 or ~> 3.0 or ~> 4.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}], "hexpm", "2c0c81f0e5c6753faf5cca2f229c9709919aba34fab866d3bc05060c9c444206"},
3030
"phoenix_view": {:hex, :phoenix_view, "2.0.4", "b45c9d9cf15b3a1af5fb555c674b525391b6a1fe975f040fb4d913397b31abf4", [:mix], [{:phoenix_html, "~> 2.14.2 or ~> 3.0 or ~> 4.0", [hex: :phoenix_html, repo: "hexpm", optional: true]}, {:phoenix_template, "~> 1.0", [hex: :phoenix_template, repo: "hexpm", optional: false]}], "hexpm", "4e992022ce14f31fe57335db27a28154afcc94e9983266835bb3040243eb620b"},

test/live_view_native/swiftui/rules_parser_test.exs

Lines changed: 23 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,14 @@ defmodule LiveViewNative.SwiftUI.RulesParserTest do
7878

7979
test "parses atoms as an argument value" do
8080
input = "background(content: :star_red)"
81-
output = {:background, [], [{:content, :star_red}]}
81+
output = {:background, [], [[content: :star_red]]}
8282

8383
assert parse(input) == output
8484
end
8585

8686
test "parses string wrapped atoms as an argument value" do
8787
input = "background(content: :\"star-red\")"
88-
output = {:background, [], [{:content, :"star-red"}]}
88+
output = {:background, [], [[content: :"star-red"]]}
8989

9090
assert parse(input) == output
9191
end
@@ -109,27 +109,22 @@ defmodule LiveViewNative.SwiftUI.RulesParserTest do
109109
test "parses chained IMEs" do
110110
input = "font(color: Color.red)"
111111

112-
output = {:font, [], [{:color, {:., [], [:Color, :red]}}]}
112+
output = {:font, [], [[color: {:., [], [:Color, :red]}]]}
113113

114114
assert parse(input) == output
115115

116116
input = "font(color: Color.red.shadow(.thick))"
117117

118118
output =
119119
{:font, [],
120-
[{:color, {:., [], [:Color, {:., [], [:red, {:shadow, [], [{:., [], [nil, :thick]}]}]}]}}]}
120+
[[color: {:., [], [:Color, {:., [], [:red, {:shadow, [], [{:., [], [nil, :thick]}]}]}]}]]}
121121

122122
assert parse(input) == output
123123

124124
input = "foregroundStyle(Color(.displayP3, red: 0.4627, green: 0.8392, blue: 1.0).opacity(0.25))"
125125

126126
output =
127-
{:foregroundStyle, [], [{:., [], [{:Color, [], [
128-
{:., [], [nil, :displayP3]},
129-
{:red, 0.4627},
130-
{:green, 0.8392},
131-
{:blue, 1.0}
132-
]}, {:opacity, [], [0.25]}]}]}
127+
{:foregroundStyle, [], [{:., [], [{:Color, [], [{:., [], [nil, :displayP3]}, [red: 0.4627, green: 0.8392, blue: 1.0]]}, {:opacity, [], [0.25]}]}]}
133128

134129
assert parse(input) == output
135130
end
@@ -152,15 +147,15 @@ defmodule LiveViewNative.SwiftUI.RulesParserTest do
152147
assert parse(input) == output
153148

154149
input = ~s/Gradient(colors: [0, 1, 2])/
155-
output = {:Gradient, [], [{:colors, [0, 1, 2]}]}
150+
output = {:Gradient, [], [[colors: [0, 1, 2]]]}
156151
assert parse(input) == output
157152

158153
input = ~s/Gradient(colors: [Color.red, Color.blue])/
159-
output = {:Gradient, [], [{:colors, [{:., [], [:Color, :red]}, {:., [], [:Color, :blue]}]}]}
154+
output = {:Gradient, [], [[colors: [{:., [], [:Color, :red]}, {:., [], [:Color, :blue]}]]]}
160155
assert parse(input) == output
161156

162157
input = ~s/Gradient(colors: ["red", "blue"])/
163-
output = {:Gradient, [], [{:colors, ["red", "blue"]}]}
158+
output = {:Gradient, [], [[colors: ["red", "blue"]]]}
164159
assert parse(input) == output
165160
end
166161

@@ -182,11 +177,11 @@ defmodule LiveViewNative.SwiftUI.RulesParserTest do
182177
output =
183178
{:color, [],
184179
[
185-
{
186-
:color,
180+
[
181+
color:
187182
{:., [],
188183
[nil, {:., [], [:foo, {:., [], [:bar, {:., [], [{:baz, [], [1, 2]}, :qux]}]}]}]}
189-
}
184+
]
190185
]}
191186

192187
assert parse(input) == output
@@ -231,7 +226,7 @@ defmodule LiveViewNative.SwiftUI.RulesParserTest do
231226

232227
test "parses key/value pairs" do
233228
input = ~s|foo(bar: "baz", qux: .quux)|
234-
output = {:foo, [], [{:bar, "baz"}, {:qux, {:., [], [nil, :quux]}}]}
229+
output = {:foo, [], [[bar: "baz", qux: {:., [], [nil, :quux]}]]}
235230

236231
assert parse(input) == output
237232
end
@@ -367,21 +362,21 @@ defmodule LiveViewNative.SwiftUI.RulesParserTest do
367362
describe "helper functions" do
368363
test "event" do
369364
input = ~s{searchable(change: event("search-event", throttle: 10_000))}
370-
output = {:searchable, [], [{:change, {:__event__, [], ["search-event", {:throttle, 10_000}]}}]}
365+
output = {:searchable, [], [[change: {:__event__, [], ["search-event", [throttle: 10_000]]}]]}
371366

372367
assert parse(input) == output
373368
end
374369

375370
test "event with no arguments" do
376371
input = ~s{searchable(change: event("search-event"))}
377-
output = {:searchable, [], [{:change, {:__event__, [], ["search-event"]}}]}
372+
output = {:searchable, [], [[change: {:__event__, [], ["search-event"]}]]}
378373

379374
assert parse(input) == output
380375
end
381376

382377
test "gesture" do
383378
input = ~s{offset(x: gesture_state(:drag, .translation.width))}
384-
output = {:offset, [], [{:x, {:__gesture_state__, [], [:drag, {:., [], [nil, {:., [], [:translation, :width]}]}]}}]}
379+
output = {:offset, [], [[x: {:__gesture_state__, [], [:drag, {:., [], [nil, {:., [], [:translation, :width]}]}]}]]}
385380

386381
assert parse(input) == output
387382

@@ -574,8 +569,8 @@ defmodule LiveViewNative.SwiftUI.RulesParserTest do
574569
assert String.trim(error.description) == error_prefix
575570
end
576571

577-
test "invalid number" do
578-
input = "abc(def: 11, b: 1lineWidth)"
572+
test "invalid keyword pair: invalid value" do
573+
input = "abc(def: 11, b: [lineWidth: 1lineWidth])"
579574

580575
error =
581576
assert_raise SyntaxError, fn ->
@@ -586,8 +581,8 @@ defmodule LiveViewNative.SwiftUI.RulesParserTest do
586581
"""
587582
Unsupported input:
588583
|
589-
1 | abc(def: 11, b: 1lineWidth)
590-
| ^^^^^^^^^
584+
1 | abc(def: 11, b: [lineWidth: 1lineWidth])
585+
| ^^^^^^^^^
591586
|
592587
593588
Invalid suffix on number
@@ -597,8 +592,8 @@ defmodule LiveViewNative.SwiftUI.RulesParserTest do
597592
assert String.trim(error.description) == error_prefix
598593
end
599594

600-
test "invalid atom" do
601-
input = "abc(def: 11, b: :1)"
595+
test "invalid keyword pair: invalid value (2)" do
596+
input = "abc(def: 11, b: [lineWidth: :1])"
602597

603598
error =
604599
assert_raise SyntaxError, fn ->
@@ -609,8 +604,8 @@ defmodule LiveViewNative.SwiftUI.RulesParserTest do
609604
"""
610605
Unsupported input:
611606
|
612-
1 | abc(def: 11, b: :1)
613-
| ^
607+
1 | abc(def: 11, b: [lineWidth: :1])
608+
| ^
614609
|
615610
616611
Expected an atom, but got ‘1’

test/support/live/inline_live.ex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ defmodule LiveViewNativeTest.SwiftUI.InlineLive do
2424
formats: [:swiftui],
2525
layouts: [
2626
swiftui: {LiveViewNativeTest.SwiftUI.Layouts.SwiftUI, :app}
27-
]
27+
],
28+
dispatch_to: &Module.concat/2
2829

2930
def mount(_params, _session, socket) do
3031
{:ok, assign(socket, :count, 100)}

test/support/live/template_live.ex

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ defmodule LiveViewNativeTest.SwiftUI.TemplateLive do
1212
formats: [:swiftui],
1313
layouts: [
1414
swiftui: {LiveViewNativeTest.SwiftUI.Layouts.SwiftUI, :app}
15-
]
15+
],
16+
dispatch_to: &Module.concat/2
1617

1718
def mount(_params, _session, socket) do
1819
{:ok, assign(socket, :count, 100)}
1920
end
2021

2122
def render(assigns), do: ~H""
22-
end
23+
end

0 commit comments

Comments
 (0)