swift-syntax icon indicating copy to clipboard operation
swift-syntax copied to clipboard

Detect missing comma in function declaration

Open flashspys opened this issue 1 year ago • 0 comments

This PR will make the Parser capable of detect and recover from a missing comma in a function declaration. The motivating example was the following:

func a(foo: Bar foo2: Bar2) {}

 --- Before Diagnostics
 
 1 │ func a(foo: Bar foo2: Bar2) {}
   ∣                 ╰─ unexpected text 'foo2: Bar2' in parameter clause

 
 --- After Diagnostics
 
 1 │ func a(foo: Bar foo2: Bar2) {}
   ∣                 ╰─ expected ',' in function parameter

flashspys avatar Oct 06 '22 15:10 flashspys