aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--calc.erl2
1 files changed, 2 insertions, 0 deletions
diff --git a/calc.erl b/calc.erl
index 04ac38f..4869104 100644
--- a/calc.erl
+++ b/calc.erl
@@ -17,6 +17,8 @@ num(Input, Num) ->
%% bracket := [-] ( '(' sum '}' | num )
bracket([$-|Input]) ->
case bracket(Input) of
+ {ok, {Tail, []}} ->
+ {error, {expected_number, {before, Tail}}};
{ok, {Tail, Result}} ->
{ok, {Tail, -1 * Result}};
{error, Why} ->