Skip to content

Commit 4b9b07f

Browse files
committed
Now using erlang-types, processes, and tailored libraries
1 parent b4db016 commit 4b9b07f

35 files changed

+210
-1734
lines changed

.babelrc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"presets": ["react", "es2015", "stage-0"],
2+
"plugins": ["transform-es2015-modules-commonjs"]
33
}

lib/elixir_script/translator/kernel/special_forms/fn.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ defmodule ElixirScript.Translator.Function do
114114
JS.call_expression(
115115
JS.member_expression(
116116
@patterns,
117-
JS.identifier("make_case")
117+
JS.identifier("clause")
118118
),
119119
arguments
120120
)

lib/elixir_script/translator/rewriter.ex

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,10 @@ defmodule ElixirScript.Translator.Rewriter do
249249
{:||, [], [left, right]}
250250
end
251251

252+
def rewrite({{:., _, [:erlang, :or]}, _, [left, right]}) do
253+
{:||, [], [left, right]}
254+
end
255+
252256
def rewrite({{:., _, [:erlang, :andalso]}, _, [left, right]}) do
253257
{:&&, [], [left, right]}
254258
end

mix.lock

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
%{"benchfella": {:hex, :benchfella, "0.3.1"},
2-
"bunt": {:hex, :bunt, "0.1.5"},
3-
"certifi": {:hex, :certifi, "0.3.0"},
4-
"credo": {:hex, :credo, "0.2.6"},
2+
"bunt": {:hex, :bunt, "0.1.5", "c378ea1698232597d3778e4b83234dcea4a60e7c28114b0fe53657a2c0d8885e", [:mix], []},
3+
"certifi": {:hex, :certifi, "0.3.0", "389d4b126a47895fe96d65fcf8681f4d09eca1153dc2243ed6babad0aac1e763", [:rebar3], []},
4+
"credo": {:hex, :credo, "0.2.6", "d6c28e2074bfbfe4918a9918f131d69e14c05f8c04db69170e9d77b4bb33d995", [:mix], [{:bunt, "~> 0.1.4", [hex: :bunt, optional: false]}]},
55
"dogma": {:hex, :dogma, "0.0.7"},
6-
"earmark": {:hex, :earmark, "0.2.1"},
7-
"estree": {:hex, :estree, "2.3.0"},
8-
"ex_doc": {:hex, :ex_doc, "0.11.4"},
9-
"excoveralls": {:hex, :excoveralls, "0.5.1"},
10-
"exjsx": {:hex, :exjsx, "3.2.0"},
11-
"fs": {:hex, :fs, "0.9.2"},
12-
"hackney": {:hex, :hackney, "1.4.8"},
13-
"idna": {:hex, :idna, "1.0.3"},
6+
"earmark": {:hex, :earmark, "0.2.1", "ba6d26ceb16106d069b289df66751734802777a3cbb6787026dd800ffeb850f3", [:mix], []},
7+
"estree": {:hex, :estree, "2.3.0", "96a190aee9b7ecb05a9486fe0f1e0a912c98b2d98419a84c74956687b6e53c71", [:mix], []},
8+
"ex_doc": {:hex, :ex_doc, "0.11.4", "a064bdb720594c3745b94709b17ffb834fd858b4e0c1f48f37c0d92700759e02", [:mix], [{:earmark, "~> 0.1.17 or ~> 0.2", [hex: :earmark, optional: true]}]},
9+
"excoveralls": {:hex, :excoveralls, "0.5.1", "5b55d62b384c7edda8b26b52b1a9fc9358fec2e6b157a81071de5cb8a42e4721", [:mix], [{:hackney, ">= 0.12.0", [hex: :hackney, optional: false]}, {:exjsx, "~> 3.0", [hex: :exjsx, optional: false]}]},
10+
"exjsx": {:hex, :exjsx, "3.2.0", "7136cc739ace295fc74c378f33699e5145bead4fdc1b4799822d0287489136fb", [:mix], [{:jsx, "~> 2.6.2", [hex: :jsx, optional: false]}]},
11+
"fs": {:hex, :fs, "0.9.2", "ed17036c26c3f70ac49781ed9220a50c36775c6ca2cf8182d123b6566e49ec59", [:rebar], []},
12+
"hackney": {:hex, :hackney, "1.4.8", "c8c6977ed55cc5095e3929f6d94a6f732dd2e31ae42a7b9236d5574ec3f5be13", [:rebar3], [{:ssl_verify_hostname, "1.0.5", [hex: :ssl_verify_hostname, optional: false]}, {:mimerl, "1.0.2", [hex: :mimerl, optional: false]}, {:idna, "1.0.3", [hex: :idna, optional: false]}, {:certifi, "0.3.0", [hex: :certifi, optional: false]}]},
13+
"idna": {:hex, :idna, "1.0.3", "d456a8761cad91c97e9788c27002eb3b773adaf5c893275fc35ba4e3434bbd9b", [:rebar3], []},
1414
"inflex": {:hex, :inflex, "1.5.0"},
15-
"jsx": {:hex, :jsx, "2.6.2"},
16-
"mimerl": {:hex, :mimerl, "1.0.2"},
15+
"jsx": {:hex, :jsx, "2.6.2", "213721e058da0587a4bce3cc8a00ff6684ced229c8f9223245c6ff2c88fbaa5a", [:mix, :rebar], []},
16+
"mimerl": {:hex, :mimerl, "1.0.2", "993f9b0e084083405ed8252b99460c4f0563e41729ab42d9074fd5e52439be88", [:rebar3], []},
1717
"poison": {:hex, :poison, "1.5.0"},
1818
"shouldi": {:hex, :shouldi, "0.2.3"},
19-
"ssl_verify_hostname": {:hex, :ssl_verify_hostname, "1.0.5"}}
19+
"ssl_verify_hostname": {:hex, :ssl_verify_hostname, "1.0.5", "2e73e068cd6393526f9fa6d399353d7c9477d6886ba005f323b592d389fb47be", [:make], []}}

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "elixirscript",
3-
"version": "0.14.1",
3+
"version": "0.21.0",
44
"description": "Convert Elixir to JavaScript",
55
"main": "elixir.js",
66
"bin": {
@@ -19,7 +19,9 @@
1919
"author": "",
2020
"license": "MIT",
2121
"dependencies": {
22-
"erlang-processes": "bryanjos/processes"
22+
"erlang-types": "^1.0.0",
23+
"erlang-processes": "bryanjos/processes",
24+
"tailored": "bryanjos/tailored"
2325
},
2426
"devDependencies": {
2527
"babel": "^6.5.2",

rollup.config.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ export default {
1010
plugins: [
1111
nodeResolve({ jsnext: true }),
1212
babel({
13-
presets: ["react"],
14-
plugins: ["transform-class-properties"],
1513
babelrc: false
1614
})
1715
]

src/javascript/lib/core.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,20 @@
11
import Processes from 'erlang-processes';
2-
import { Tuple, PID, Integer, Float } from './core/primitives';
3-
import BitString from './core/bit_string';
4-
import Patterns from './core/patterns';
2+
import Patterns from 'tailored';
3+
import ErlangTypes from 'erlang-types';
54
import Functions from './core/functions';
65
import SpecialForms from './core/special_forms';
76

87
let processes = new Processes.ProcessSystem();
98

9+
class Integer {}
10+
class Float {}
11+
1012
export default {
1113
ProcessSystem: Processes.ProcessSystem,
1214
processes: processes,
13-
Tuple,
14-
PID,
15-
BitString,
15+
Tuple: ErlangTypes.Tuple,
16+
PID: ErlangTypes.PID,
17+
BitString: ErlangTypes.BitString,
1618
Patterns,
1719
Integer,
1820
Float,

0 commit comments

Comments
 (0)