Data update
This commit is contained in:
parent
61b93a2cd1
commit
5af6d93694
858 changed files with 20572 additions and 2082 deletions
|
|
@ -0,0 +1,13 @@
|
|||
defmodule Ast do
|
||||
def main do
|
||||
expr = IO.gets("Give an expression:\n") |> String.Chars.to_string |> String.trim
|
||||
case Code.string_to_quoted(expr) do
|
||||
{:ok, ast} ->
|
||||
IO.puts("AST is: " <> inspect(ast))
|
||||
{result, _} = Code.eval_quoted(ast)
|
||||
IO.puts("Result = #{result}")
|
||||
{:error, {_meta, message_info, _token}} ->
|
||||
IO.puts(message_info)
|
||||
end
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue