diff --git a/src/aeso_parser.erl b/src/aeso_parser.erl index a297bcc..34ff8d5 100644 --- a/src/aeso_parser.erl +++ b/src/aeso_parser.erl @@ -21,7 +21,7 @@ string(String) -> -spec string(string(), compiler:options()) -> parse_result(). -string(String, Opts) -> io:format("STRING WITH OPTS: ~p\n", [Opts]), +string(String, Opts) -> case lists:keyfind(src_file, 1, Opts) of {src_file, File} -> string(String, sets:add_element(File, sets:new()), Opts); false -> string(String, sets:new(), Opts) diff --git a/src/aeso_stdlib.erl b/src/aeso_stdlib.erl index b5cf34c..4458859 100644 --- a/src/aeso_stdlib.erl +++ b/src/aeso_stdlib.erl @@ -38,7 +38,7 @@ namespace Func = private function iter_(n : int, f : 'a => 'a, acc : 'a => 'a) : 'a => 'a = if(n == 0) acc elif(n == 1) comp(f, acc) - else else iter_(n / 2, comp(f, f), if(n mod 2 == 0) acc else comp(f, acc)) + else iter_(n / 2, comp(f, f), if(n mod 2 == 0) acc else comp(f, acc)) function curry2(f : ('a, 'b) => 'c) : 'a => ('b => 'c) = (x) => (y) => f(x, y) @@ -50,19 +50,18 @@ namespace Func = function uncurry3(f : 'a => ('b => ('c => 'd))) : ('a, 'b, 'c) => 'd = (x, y, z) => f(x)(y)(z) -/* TODO : parser fails here, probably a bug - function tuplify2(f : ('a, 'b) => 'c) : (('a, 'b)) => 'c = - (t) => switch(t) - (x, y) => f(x, y) - function tuplify3(f : ('a, 'b, 'c) => 'd) : (('a, 'b, 'c)) => 'd = - (t) => switch(t) - (x, y, z) => f(x, y, z) +// TODO : parser fails here, probably a bug. Uncomment when resolved. +// function tuplify2(f : ('a, 'b) => 'c) : (('a, 'b)) => 'c = +// (t) => switch(t) +// (x, y) => f(x, y) +// function tuplify3(f : ('a, 'b, 'c) => 'd) : (('a, 'b, 'c)) => 'd = +// (t) => switch(t) +// (x, y, z) => f(x, y, z) - function untuplify2(f : (('a, 'b)) => 'c) : ('a, 'b) => 'c = - (x, y) => f((x, y)) - function untuplify3(f : (('a, 'b, 'c)) => 'd) : ('a, 'b, 'c) => 'd = - (x, y, z) => f((x, y, z)) - */ +// function untuplify2(f : (('a, 'b)) => 'c) : ('a, 'b) => 'c = +// (x, y) => f((x, y)) +// function untuplify3(f : (('a, 'b, 'c)) => 'd) : ('a, 'b, 'c) => 'd = +// (x, y, z) => f((x, y, z)) ". std_list() ->"