Current section
7 Versions
Jump to
Current section
7 Versions
Compare versions
22
files changed
+4622
additions
-3912
deletions
| @@ -16,17 +16,17 @@ Although the Cuneiform client application can be imported also directly from Git | |
| 16 16 | |
| 17 17 | #### rebar3 |
| 18 18 | |
| 19 | - To integrate the Cuneiform client application into a rebar3-managed project change the `deps` entry in your application's `rebar.config` file to include the tuple `{cf_client, "0.1.5"}`. |
| 19 | + To integrate the Cuneiform client application into a rebar3-managed project change the `deps` entry in your application's `rebar.config` file to include the tuple `{cf_client, "0.1.6"}`. |
| 20 20 | |
| 21 21 | ```erlang |
| 22 | - {deps, [{cf_client, "0.1.5"}]}. |
| 22 | + {deps, [{cf_client, "0.1.6"}]}. |
| 23 23 | ``` |
| 24 24 | |
| 25 25 | |
| 26 26 | #### mix |
| 27 27 | |
| 28 28 | ```elixir |
| 29 | - {:cf_client, "~> 0.1.5"} |
| 29 | + {:cf_client, "~> 0.1.6"} |
| 30 30 | ``` |
| 31 31 | |
| 32 32 | ### Compiling |
| @@ -1,29 +1,30 @@ | |
| 1 1 | {<<"name">>,<<"cf_client">>}. |
| 2 | - {<<"version">>,<<"0.1.5">>}. |
| 2 | + {<<"version">>,<<"0.1.6">>}. |
| 3 3 | {<<"requirements">>, |
| 4 4 | #{<<"cre">> => |
| 5 5 | #{<<"app">> => <<"cre">>,<<"optional">> => false, |
| 6 | - <<"requirement">> => <<"0.1.6">>}, |
| 6 | + <<"requirement">> => <<"0.1.8">>}, |
| 7 7 | <<"getopt">> => |
| 8 8 | #{<<"app">> => <<"getopt">>,<<"optional">> => false, |
| 9 9 | <<"requirement">> => <<"1.0.1">>}, |
| 10 10 | <<"lib_conf">> => |
| 11 11 | #{<<"app">> => <<"lib_conf">>,<<"optional">> => false, |
| 12 | - <<"requirement">> => <<"0.1.4">>}}}. |
| 12 | + <<"requirement">> => <<"0.1.5">>}}}. |
| 13 13 | {<<"app">>,<<"cf_client">>}. |
| 14 14 | {<<"maintainers">>,[<<"Jorgen Brandt">>]}. |
| 15 15 | {<<"precompiled">>,false}. |
| 16 16 | {<<"description">>,<<"A Cuneiform client implementation.">>}. |
| 17 17 | {<<"files">>, |
| 18 18 | [<<"src/cf_client.app.src">>,<<"LICENSE">>,<<"README.md">>, |
| 19 | - <<"include/cuneiform.hrl">>,<<"rebar.config">>,<<"rebar.lock">>, |
| 20 | - <<"src/cf_client.erl">>,<<"src/cf_client_effi.erl">>, |
| 21 | - <<"src/cf_client_process.erl">>,<<"src/cf_client_sup.erl">>, |
| 22 | - <<"src/cuneiform_format.erl">>,<<"src/cuneiform_lang.erl">>, |
| 23 | - <<"src/cuneiform_parse.erl">>,<<"src/cuneiform_parse.yrl">>, |
| 19 | + <<"include/cuneiform.hrl">>,<<"include/cuneiform_sem_cek.hrl">>, |
| 20 | + <<"rebar.config">>,<<"rebar.lock">>,<<"src/cf_client.erl">>, |
| 21 | + <<"src/cf_client_effi.erl">>,<<"src/cf_client_process.erl">>, |
| 22 | + <<"src/cf_client_sup.erl">>,<<"src/cuneiform_format.erl">>, |
| 23 | + <<"src/cuneiform_lang.erl">>,<<"src/cuneiform_parse.erl">>, |
| 24 | + <<"src/cuneiform_parse.yrl">>,<<"src/cuneiform_preproc.erl">>, |
| 24 25 | <<"src/cuneiform_scan.erl">>,<<"src/cuneiform_scan.xrl">>, |
| 25 | - <<"src/cuneiform_sem.erl">>,<<"src/cuneiform_shell.erl">>, |
| 26 | - <<"src/cuneiform_type.erl">>]}. |
| 26 | + <<"src/cuneiform_sem.erl">>,<<"src/cuneiform_sem_cek.erl">>, |
| 27 | + <<"src/cuneiform_shell.erl">>,<<"src/cuneiform_type.erl">>]}. |
| 27 28 | {<<"licenses">>,[<<"Apache 2.0">>]}. |
| 28 29 | {<<"links">>,[{<<"GitHub">>,<<"https://github.com/joergen7/cf_client/">>}]}. |
| 29 30 | {<<"build_tools">>,[<<"rebar3">>]}. |
| @@ -1,6 +1,6 @@ | |
| 1 1 | %% -*- erlang -*- |
| 2 2 | %% |
| 3 | - %% A Cuneiform client implementation. |
| 3 | + %% cf_client |
| 4 4 | %% |
| 5 5 | %% Copyright 2015-2018 Jörgen Brandt |
| 6 6 | %% |
| @@ -18,7 +18,7 @@ | |
| 18 18 | %% |
| 19 19 | %% ------------------------------------------------------------------- |
| 20 20 | %% @author Jörgen Brandt <joergen.brandt@onlinehome.de> |
| 21 | - %% @version 0.1.5 |
| 21 | + %% @version 0.1.6 |
| 22 22 | %% @copyright 2015-2018 Jörgen Brandt |
| 23 23 | %% |
| 24 24 | %% |
| @@ -64,8 +64,10 @@ | |
| 64 64 | | {'Lst', t()}. |
| 65 65 | |
| 66 66 | -type l() :: 'Bash' |
| 67 | + | 'Elixir' |
| 67 68 | | 'Erlang' |
| 68 69 | | 'Java' |
| 70 | + | 'Javascript' |
| 69 71 | | 'Matlab' |
| 70 72 | | 'Octave' |
| 71 73 | | 'Perl' |
| @@ -73,10 +75,9 @@ | |
| 73 75 | | 'R' |
| 74 76 | | 'Racket'. |
| 75 77 | |
| 76 | - -type lam_ntv_arg() :: {InternalName :: x(), ExternalName :: x(), t()}. |
| 77 | - |
| 78 78 | -type e_bind() :: {x(), e()}. |
| 79 79 | -type r_bind() :: {x(), r()}. |
| 80 | + -type typed_bind() :: {x(), t(), e()}. |
| 80 81 | |
| 81 82 | -type e() :: {str, info(), s()} |
| 82 83 | | {cmp, info(), e(), e()} |
| @@ -88,16 +89,16 @@ | |
| 88 89 | | {conj, info(), e(), e()} |
| 89 90 | | {disj, info(), e(), e()} |
| 90 91 | | {var, info(), x()} |
| 91 | - | {lam_ntv, info(), [lam_ntv_arg()], e()} % binding form |
| 92 | + | {lam_ntv, info(), [t_arg()], e()} % binding form |
| 92 93 | | {lam_frn, info(), x(), [t_arg()], t(), l(), s()} |
| 93 94 | | {app, info(), e(), [e_bind()]} |
| 94 95 | | {fut, info(), t(), hash()} |
| 95 96 | | {null, info(), t()} |
| 96 | - | {cons, info(), t(), e(), e()} |
| 97 | + | {cons, info(), e(), e()} |
| 97 98 | | {append, info(), e, e} |
| 98 99 | | {isnil, info(), e} |
| 99 | - | {for, info(), t(), [e_bind()], e()} % binding form |
| 100 | - | {fold, info(), e_bind(), e_bind(), e()} % binding form |
| 100 | + | {for, info(), t(), [typed_bind()], e()} % binding form |
| 101 | + | {fold, info(), typed_bind(), typed_bind(), e()} % binding form |
| 101 102 | | {rcd, info(), [e_bind()]} |
| 102 103 | | {proj, info(), x(), e()} |
| 103 104 | | {fix, info(), e()} |
| @@ -108,31 +109,6 @@ | |
| 108 109 | -type r() :: {r_var, x(), t()} |
| 109 110 | | {r_rcd, [r_bind()]}. |
| 110 111 | |
| 111 | - -type ctx() :: hole |
| 112 | - | {cmp, info(), ctx(), e()} |
| 113 | - | {cmp, info(), e(), ctx()} |
| 114 | - | {cnd, info(), ctx(), e(), e()} |
| 115 | - | {neg, info(), ctx()} |
| 116 | - | {conj, info(), ctx(), e()} |
| 117 | - | {conj, info(), e(), ctx()} |
| 118 | - | {disj, info(), ctx(), e()} |
| 119 | - | {disj, info(), e(), ctx()} |
| 120 | - | {app, info(), ctx(), [e_bind()]} |
| 121 | - | {app, info(), e(), [{x(), e() | ctx()}]} |
| 122 | - | {cons, info(), t(), ctx(), e()} |
| 123 | - | {cons, info(), t(), e(), ctx()} |
| 124 | - | {append, info(), ctx(), e()} |
| 125 | - | {append, info(), e(), ctx()} |
| 126 | - | {isnil, info(), ctx()} |
| 127 | - | {for, info(), [{x(), e() | ctx()}], e()} |
| 128 | - | {for, info(), [e_bind()], ctx()} |
| 129 | - | {fold, info(), {x(), ctx()}, e_bind(), e()} |
| 130 | - | {fold, info(), e_bind(), {x(), ctx()}, e()} |
| 131 | - | {fold, info(), e_bind(), e_bind(), ctx()} |
| 132 | - | {rcd, info(), [{x(), e() | ctx()}]} |
| 133 | - | {proj, info(), x(), ctx()} |
| 134 | - | {fix, info(), ctx()}. |
| 135 | - |
| 136 112 | -type type_error() :: {unbound_var, info(), x()} |
| 137 113 | | {type_mismatch, info(), {t(), t()}} |
| 138 114 | | {ambiguous_name, info(), x()} |
| @@ -143,7 +119,8 @@ | |
| 143 119 | | {no_native_function_type, info(), t()} |
| 144 120 | | {no_argument, info(), t()} |
| 145 121 | | {no_list_type, info(), t()} |
| 146 | - | {no_comparable_type, info(), t()}. |
| 122 | + | {no_comparable_type, info(), t()} |
| 123 | + | {argument_mismatch, info(), x(), x()}. |
| 147 124 | |
| 148 125 | -type stage() :: load |
| 149 126 | | scan |
| @@ -0,0 +1,83 @@ | |
| 1 | + %% -*- erlang -*- |
| 2 | + %% |
| 3 | + %% cf_client |
| 4 | + %% |
| 5 | + %% Copyright 2015-2018 Jörgen Brandt |
| 6 | + %% |
| 7 | + %% Licensed under the Apache License, Version 2.0 (the "License"); |
| 8 | + %% you may not use this file except in compliance with the License. |
| 9 | + %% You may obtain a copy of the License at |
| 10 | + %% |
| 11 | + %% http://www.apache.org/licenses/LICENSE-2.0 |
| 12 | + %% |
| 13 | + %% Unless required by applicable law or agreed to in writing, software |
| 14 | + %% distributed under the License is distributed on an "AS IS" BASIS, |
| 15 | + %% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 16 | + %% See the License for the specific language governing permissions and |
| 17 | + %% limitations under the License. |
| 18 | + %% |
| 19 | + %% ------------------------------------------------------------------- |
| 20 | + %% @author Jörgen Brandt <joergen.brandt@onlinehome.de> |
| 21 | + %% @version 0.1.6 |
| 22 | + %% @copyright 2015-2018 Jörgen Brandt |
| 23 | + %% |
| 24 | + %% |
| 25 | + %% |
| 26 | + %% |
| 27 | + %% |
| 28 | + %% @end |
| 29 | + %% ------------------------------------------------------------------- |
| 30 | + |
| 31 | + |
| 32 | + %%==================================================================== |
| 33 | + %% Includes |
| 34 | + %%==================================================================== |
| 35 | + |
| 36 | + -include( "cuneiform.hrl" ). |
| 37 | + |
| 38 | + |
| 39 | + %%==================================================================== |
| 40 | + %% Type definitions |
| 41 | + %%==================================================================== |
| 42 | + |
| 43 | + |
| 44 | + %% Environment |
| 45 | + |
| 46 | + -type env() :: #{ x() => {e(), env()} }. |
| 47 | + |
| 48 | + |
| 49 | + %% Continuation Element |
| 50 | + |
| 51 | + -type k() :: {cmp_lhs, info(), e(), env()} |
| 52 | + | {cmp_rhs, info(), e()} |
| 53 | + | {cnd_pred, info(), e(), e(), env()} |
| 54 | + | {neg_op, info()} |
| 55 | + | {conj_lhs, info(), e(), env()} |
| 56 | + | {conj_rhs, info(), e()} |
| 57 | + | {disj_lhs, info(), e(), env()} |
| 58 | + | {disj_rhs, info(), e()} |
| 59 | + | {app_fn, info(), [e_bind()], env()} |
| 60 | + | {app_body, info(), e(), [e_bind()]} |
| 61 | + | {app_arg, info(), e(), [e_bind()], x(), [e_bind()], env()} |
| 62 | + | {cons_hd, info(), e(), env()} |
| 63 | + | {cons_tl, info(), e()} |
| 64 | + | {append_lhs, info(), e(), env()} |
| 65 | + | {append_rhs, info(), e()} |
| 66 | + | {isnil_op, info()} |
| 67 | + | {rcd_field, info(), [e_bind()], x(), [e_bind()], env()} |
| 68 | + | {proj_op, info(), x()} |
| 69 | + | {fix_op, info()} |
| 70 | + | {for_arg, info(), t(), [typed_bind()], x(), t(), [typed_bind()], e(), env()} |
| 71 | + | {fold_acc, info(), x(), t(), typed_bind(), e(), env()} |
| 72 | + | {fold_arg, info(), typed_bind(), x(), t(), e(), env()}. |
| 73 | + |
| 74 | + |
| 75 | + %% Program |
| 76 | + |
| 77 | + -type prog() :: {{e() | {stalled, e()}, env()}, % closure (control string + environment) |
| 78 | + [k()], % continuation |
| 79 | + [e()]}. % foreign function applications |
| 80 | + |
| 81 | + |
| 82 | + |
| 83 | + |
| @@ -2,9 +2,9 @@ | |
| 2 2 | {cover_enabled, true}. |
| 3 3 | |
| 4 4 | {deps, [ |
| 5 | - {cre, "0.1.6"}, |
| 5 | + {cre, "0.1.8"}, |
| 6 6 | {getopt, "1.0.1"}, |
| 7 | - {lib_conf, "0.1.4"} |
| 7 | + {lib_conf, "0.1.5"} |
| 8 8 | ]}. |
| 9 9 | |
| 10 10 | {escript_incl_apps, [cre, gen_pnet, getopt, jsone, lib_combin, lib_conf]}. |
Loading more files…