diff --git a/reverse_polish_notation_evaluator/src/reverse_polish_notation_evaluator.erl b/reverse_polish_notation_evaluator/src/reverse_polish_notation_evaluator.erl index e56b2b5..bb359d5 100644 --- a/reverse_polish_notation_evaluator/src/reverse_polish_notation_evaluator.erl +++ b/reverse_polish_notation_evaluator/src/reverse_polish_notation_evaluator.erl @@ -33,13 +33,10 @@ handle_token(Token, Stack, Position) -> tokenize(Expression) -> Tokens = re:split(Expression, "\\s+"), FilteredTokens = lists:filter(fun(X) -> (X =/= "") and not(lists:member(X, "\s\t\n")) end, Tokens), - io:fwrite("~p~n", [FilteredTokens]), Positions = lists:flatmap(fun(Token) -> case re:run(Expression, utils:re_escape(Token), [global]) of nomatch -> []; - {match, Captured} -> - io:fwrite("~p:~p~n", [utils:re_escape(Token), Captured]), - lists:map(fun({Index, _Length}) -> {Token, Index + 1} end, lists:flatten(Captured)) + {match, Captured} -> lists:map(fun({Index, _Length}) -> {Token, Index + 1} end, lists:flatten(Captured)) end end, FilteredTokens), Positions.