diff --git a/rebar.config b/rebar.config index 6cd123e..674cddc 100644 --- a/rebar.config +++ b/rebar.config @@ -16,7 +16,7 @@ {minimum_otp_vsn, "21"}. -{deps, [{katana_code, "0.2.1"}]}. +{deps, [{katana_code, "1.0.1"}]}. {project_plugins, [rebar3_lint, rebar3_hex]}. diff --git a/rebar.lock b/rebar.lock index 69da63e..da2d7bd 100644 --- a/rebar.lock +++ b/rebar.lock @@ -1,8 +1,8 @@ {"1.2.0", -[{<<"katana_code">>,{pkg,<<"katana_code">>,<<"0.2.1">>},0}]}. +[{<<"katana_code">>,{pkg,<<"katana_code">>,<<"1.0.1">>},0}]}. [ {pkg_hash,[ - {<<"katana_code">>, <<"B2195859DF57D8BEBF619A9FD3327CD7D01563A98417156D0F4C5FAB435F2630">>}]}, + {<<"katana_code">>, <<"CB5BA824CAB1B14A4C101D58F353C72AEFAD3B050F9619C6A8359534641255A6">>}]}, {pkg_hash_ext,[ - {<<"katana_code">>, <<"8448AD3F56D9814F98A28BE650F7191BDD506575E345CC16D586660B10F6E992">>}]} + {<<"katana_code">>, <<"79DF283EC5FEC476C7C98B73DCC8B3CF43DAC9769EC49EF4E74B6FC65629A8C7">>}]} ]. diff --git a/test_app/after/src/macros.erl b/test_app/after/src/macros.erl index 4d15bb8..e73a64b 100644 --- a/test_app/after/src/macros.erl +++ b/test_app/after/src/macros.erl @@ -31,4 +31,13 @@ another_hidden_function() -> -define(NO_ARGS(), result). -define(NO_PARENS, no_parens). -other_function ( ? NO_ARGS ( ) , ? NO_PARENS , ? WITH_ARGS ( X ) , ? WITH_ARGS ( ? WITH_ARGS ( ? NO_ARGS ( ) ) ) ) -> { ? NO_ARGS ( ) , ? NO_PARENS , X } . +other_function(?NO_ARGS(), ?NO_PARENS, ?WITH_ARGS(X), ?WITH_ARGS(?WITH_ARGS(?NO_ARGS()))) -> {?NO_ARGS(), ?NO_PARENS, X}. + + +%% Careful with parentheses +-define(Now(), 100). + +-define(Elapsed(Since), (?Now()-Since)). + + +-define(Remains(Since, Remaining), N-?Elapsed(Since)). diff --git a/test_app/after/src/others.erl b/test_app/after/src/others.erl index b309c4c..5a7844e 100644 --- a/test_app/after/src/others.erl +++ b/test_app/after/src/others.erl @@ -5,7 +5,7 @@ strange_infix_operators(A, B) -> bnot (-(A rem B)). --define(OUT_OF_CONTEXT_CLAUSE, true -> false ). +-define(OUT_OF_CONTEXT_CLAUSE, true -> false). -record(rec, {key, value}). diff --git a/test_app/after/src/syntax_tools_test.erl b/test_app/after/src/syntax_tools_test.erl index a95fb35..bb598de 100644 --- a/test_app/after/src/syntax_tools_test.erl +++ b/test_app/after/src/syntax_tools_test.erl @@ -19,10 +19,10 @@ % -?attrib([foo2/2]). -define(macro_simple1, ok). --define(MACRO_SIMPLE2, other). +-define(MACRO_SIMPLE2, (other)). -define(macro_simple3, ?MODULE). -define(macro_simple4, [?macro_simple3, ?MODULE, ?MACRO_SIMPLE2]). --define(macro_simple5, process_info). +-define(macro_simple5, (process_info)). -define(macro_string, "hello world"). -define(macro_argument1(X), X + 3). -define(macro_argument2(X, Y), X + 3 * Y). diff --git a/test_app/src/macros.erl b/test_app/src/macros.erl index 3ecc746..f2a0f2a 100644 --- a/test_app/src/macros.erl +++ b/test_app/src/macros.erl @@ -33,3 +33,7 @@ another_hidden_function() -> other_function(?NO_ARGS(), ?NO_PARENS, ?WITH_ARGS(X), ?WITH_ARGS(?WITH_ARGS(?NO_ARGS()))) -> {?NO_ARGS(), ?NO_PARENS, X}. +%% Careful with parentheses +-define(Now(), 100). +-define(Elapsed(Since), (?Now() - Since)). +-define(Remains(Since, Remaining), N - ?Elapsed(Since)).