@@ -407,6 +407,18 @@ defmodule ElixirScript.Translator.Rewriter do
407407 quote do: Elixir.Core.Functions . filtermap ( unquote ( fun ) , unquote ( list ) )
408408 end
409409
410+ def rewrite ( { { :. , _ , [ :lists , :concat ] } , _ , [ things ] } ) do
411+ quote do: unquote ( things ) . join ( "" )
412+ end
413+
414+ def rewrite ( { { :. , _ , [ :erlang , :binary_to_atom ] } , _ , [ binary , _ ] } ) do
415+ quote do: Symbol . for ( unquote ( binary ) )
416+ end
417+
418+ def rewrite ( { { :. , _ , [ :erlang , :binary_to_existing_atom ] } , _ , [ binary , _ ] } ) do
419+ quote do: Symbol . for ( unquote ( binary ) )
420+ end
421+
410422 def rewrite ( { { :. , _ , [ :erlang , :list_to_atom ] } , _ , [ char_list ] } ) do
411423 quote do: Symbol . for ( unquote ( char_list ) )
412424 end
@@ -431,6 +443,50 @@ defmodule ElixirScript.Translator.Rewriter do
431443 quote do: parseInt ( unquote ( list ) , unquote ( base ) )
432444 end
433445
446+ def rewrite ( { { :. , _ , [ :erlang , :integer_to_binary ] } , _ , [ integer ] } ) do
447+ quote do: unquote ( integer ) . toString ( )
448+ end
449+
450+ def rewrite ( { { :. , _ , [ :erlang , :integer_to_binary ] } , _ , [ integer , base ] } ) do
451+ quote do: unquote ( integer ) . toString ( unquote ( base ) )
452+ end
453+
454+ def rewrite ( { { :. , _ , [ :erlang , :integer_to_list ] } , _ , [ integer ] } ) do
455+ quote do: unquote ( integer ) . toString ( )
456+ end
457+
458+ def rewrite ( { { :. , _ , [ :erlang , :integer_to_list ] } , _ , [ integer , base ] } ) do
459+ quote do: unquote ( integer ) . toString ( unquote ( base ) )
460+ end
461+
462+ def rewrite ( { { :. , _ , [ :erlang , :float_to_binary ] } , _ , [ float ] } ) do
463+ quote do: unquote ( float ) . toString ( )
464+ end
465+
466+ def rewrite ( { { :. , _ , [ :erlang , :float_to_binary ] } , _ , [ float , base ] } ) do
467+ quote do: unquote ( float ) . toString ( unquote ( base ) )
468+ end
469+
470+ def rewrite ( { { :. , _ , [ :erlang , :float_to_list ] } , _ , [ float ] } ) do
471+ quote do: unquote ( float ) . toString ( )
472+ end
473+
474+ def rewrite ( { { :. , _ , [ :erlang , :float_to_list ] } , _ , [ float , base ] } ) do
475+ quote do: unquote ( float ) . toString ( unquote ( base ) )
476+ end
477+
478+ def rewrite ( { { :. , _ , [ :erlang , :binary_to_float ] } , _ , [ binary ] } ) do
479+ quote do: parseFloat ( unquote ( binary ) )
480+ end
481+
482+ def rewrite ( { { :. , _ , [ :erlang , :binary_to_integer ] } , _ , [ binary ] } ) do
483+ quote do: parseInt ( unquote ( binary ) )
484+ end
485+
486+ def rewrite ( { { :. , _ , [ :erlang , :binary_to_integer ] } , _ , [ binary , base ] } ) do
487+ quote do: parseInt ( unquote ( binary ) , unquote ( base ) )
488+ end
489+
434490 def rewrite ( { { :. , _ , [ :maps , :is_key ] } , _ , [ key , map ] } ) do
435491 quote do: unquote ( key ) in Elixir.Core.Functions . get_object_keys ( unquote ( map ) )
436492 end
@@ -447,5 +503,16 @@ defmodule ElixirScript.Translator.Rewriter do
447503 quote do: Elixir.Core.Functions . maps_find ( unquote ( key ) , unquote ( map ) )
448504 end
449505
506+ def rewrite ( { { :. , _ , [ :maps , :remove ] } , _ , [ key , map ] } ) do
507+ quote do: Elixir.Core.Functions . delete_property_from_map ( unquote ( map ) , unquote ( key ) )
508+ end
509+
510+ def rewrite ( { { :. , _ , [ :maps , :fold ] } , _ , [ fun , init , map ] } ) do
511+ quote do: Elixir.Core.Functions . maps_fold ( unquote ( fun ) , unquote ( init ) , unquote ( map ) )
512+ end
513+
514+ def rewrite ( { { :. , _ , [ :maps , :from_list ] } , _ , [ list ] } ) do
515+ quote do: Elixir.Core.Functions . maps_fold ( unquote ( list ) )
516+ end
450517
451518end
0 commit comments