shithub: mc

Download patch

ref: 4a6a372ad70eb3bde6f0fa6bac7760383b6f6ea8
parent: 2ffd051d75978386e2c63b5d0812dd9be982c38c
author: Mura Li <mura_li@castech.com.tw>
date: Tue Apr 14 23:05:34 EDT 2020

Allow optional eol after the commas of function parameters

So we can break long parameters into lines without '\'.

For example,
```
const foo = {a : byte[:], \
	     b : int
}
```
becomes
```
const foo = {a : byte[:],
	     b : int
}
```

--- a/parse/gram.y
+++ b/parse/gram.y
@@ -936,7 +936,7 @@
 		$$.nn = 0;
 		lappend(&$$.nl, &$$.nn, $1);
 	}
-	| params Tcomma fnparam {lappend(&$$.nl, &$$.nn, $3);}
+	| params listsep fnparam {lappend(&$$.nl, &$$.nn, $3);}
 	| /* empty */ {$$.nl = NULL; $$.nn = 0;}
 	;