Simple arithmetic expressions solver in swift