basic function. TODO: entry case: 1. left'[['; 2. '[[]]'surrounded; 3. space wrapped;