diff options
Diffstat (limited to '')
-rw-r--r-- | calc.erl | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -9,6 +9,8 @@ num([Current|Input], Num) when ($0 =< Current) and ($9 >= Current) -> num(Input, Num ++ [Current]); num([Head|_], "-") -> {error, {unexpected, list_to_atom([Head])}}; +num(Input, []) -> + {ok, {Input, []}}; num(Input, Num) -> {ok, {Input, list_to_integer(Num)}}. |