Skip to content

Commit

Permalink
fix path
Browse files Browse the repository at this point in the history
  • Loading branch information
5HT committed Sep 13, 2017
1 parent 76695cc commit cec0607
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions include/io.hrl
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
-define(SRC, (application:get_env(macbert,out,"apps/roster/priv/macbert/"))).

-record(error, {code=[] :: [] | binary()}).
-record(ok, {code=[] :: [] | binary()}).
-record(io, {code=[] :: [] | #ok{} | #error{},
Expand Down
4 changes: 3 additions & 1 deletion src/macbert_swift.erl
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
-module(macbert_swift).
-export([parse_transform/2]).
-compile(export_all).
-define(SRC, "priv/macbert/").
-include("io.hrl").

parse_transform(Forms, _Options) -> switch(directives(Forms)), Forms.
directives(Forms) -> lists:flatten([ form(F) || F <- Forms ]).

switch(List) ->
% io:format("Decoder: ~p~n",[ file:get_cwd()]),
file:write_file(?SRC++"Source/Decoder.swift",
iolist_to_binary(lists:concat([
"func parseObject(name: String, body:[Model], tuple: BertTuple) -> AnyObject?\n"
Expand All @@ -26,6 +27,7 @@ act(List,Name,Args,Field,I,Fun) ->
?MODULE:Fun(Name,Args,{Field,Args}),"\n"]).

case_rec({Atom,T}) ->
% io:format("Rec: ~p~n",[{Atom,T}]),
List = atom_to_list(Atom),
Lower = string:to_lower(List),
Var = "a" ++ List,
Expand Down

0 comments on commit cec0607

Please sign in to comment.