rewrite the code. better i guess. simpler yet more robust. the idea is each state handles what it is supposed to handle, if something else coming, simply pass it to the next state. brain keeps passing it until someone take it. it works, because in calculator, (normal) state transition goes one way.
test case rewrite ㅋㅋㅋ
memory function added. as far as i know, perfect ㅋㅋㅋ test cases added, coverage not so high, but ok