Open simonmcconnell opened 2 years ago
I have a some_component.ex where the entire contents are commented out using #. mix surface.convert attempts to convert this file and crashes.
some_component.ex
#
mix surface.convert
mix surface.convert failed for file: lib/logacy_web/components/dropdown_lv.ex ** (Surface.Compiler.ParseError) nofile:16:19: expected attribute name, got: `=` (surface 0.8.1) lib/surface/compiler/tokenizer.ex:531: Surface.Compiler.Tokenizer.handle_attribute/5 (surface 0.8.1) lib/surface/compiler/converter.ex:18: Surface.Compiler.Converter.convert/2 (surface 0.8.1) lib/mix/tasks/surface/surface.convert.ex:75: anonymous fn/5 in Mix.Tasks.Surface.Convert.convert_ex_string!/2 (elixir 1.13.4) lib/regex.ex:739: Regex.apply_list/5 (elixir 1.13.4) lib/regex.ex:734: Regex.apply_list/5 (elixir 1.13.4) lib/regex.ex:669: Regex.replace/4 (elixir 1.13.4) lib/enum.ex:2396: Enum."-reduce/3-lists^foldl/2-0-"/3 (surface 0.8.1) lib/mix/tasks/surface/surface.convert.ex:65: Mix.Tasks.Surface.Convert.convert_file_contents!/3 (surface 0.8.1) lib/mix/tasks/surface/surface.convert.ex:118: Mix.Tasks.Surface.Convert.convert_file/3 (elixir 1.13.4) lib/task/supervised.ex:89: Task.Supervised.invoke_mfa/2 (elixir 1.13.4) lib/task/supervised.ex:34: Task.Supervised.reply/4 (stdlib 4.0.1) proc_lib.erl:240: :proc_lib.init_p_do_apply/3
Commented out lines/files are ignored.
Surface: v0.8.1 LiveView: v0.17.11 Elixir: v1.13.4
I faced the same kind of issue with Sourceror, https://github.com/doorgan/sourceror/issues/57, but in this case it seems that it is directly related to Surface.
Describe the bug
I have a
some_component.ex
where the entire contents are commented out using#
.mix surface.convert
attempts to convert this file and crashes.How to reproduce it
mix surface.convert
The behaviour you expected
Commented out lines/files are ignored.
Your Environment
Surface: v0.8.1 LiveView: v0.17.11 Elixir: v1.13.4