aboutsummaryrefslogtreecommitdiff
path: root/lib/main.ex
diff options
context:
space:
mode:
Diffstat (limited to 'lib/main.ex')
-rw-r--r--lib/main.ex7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/main.ex b/lib/main.ex
index 5418da5..99c25ca 100644
--- a/lib/main.ex
+++ b/lib/main.ex
@@ -1,7 +1,8 @@
defmodule ElixirMathParser.Main do
def process_parse({:error, result}) do
- IO.puts("\nParse error")
- IO.inspect(result)
+ {line, _file, errors} = result
+ err = Enum.join(errors)
+ err <> " (line " <> to_string(line) <> ")"
end
def process_parse({:ok, tree}) do
@@ -26,7 +27,7 @@ defmodule ElixirMathParser.Main do
res = process_parse(:elixir_math_parser.parse(tokens))
if res != :ok do
- IO.puts(res)
+ IO.puts(:stderr, "\n" <> res)
end
end
end