fix regex escaping
fix as-statement regex
surface resolve errors better
resolve bugs in previous commits