A numerical technique is presented for solving a two-dimensional edge-type scattering problem where the scatterer has several edge points. The technique is based on the mode-matching method with a singular-smoothing procedure. Analytical foundations of the technique, including convergence theorem, are described, and a computer-aided numerical algorithm is developed. To show the validity of the technique, plane wave diffraction by a trapezoid grating is analyzed. Numerical data on the speed of convergence show the effectiveness of the technique.