summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMura Li <mura_li@castech.com.tw>2020-04-15 03:05:34 +0000
committerOri Bernstein <ori@eigenstate.org>2020-04-30 23:41:09 -0400
commit4a6a372ad70eb3bde6f0fa6bac7760383b6f6ea8 (patch)
treeed13a52408f581251cefbcb036793c273224b973
parent2ffd051d75978386e2c63b5d0812dd9be982c38c (diff)
downloadmc-4a6a372ad70eb3bde6f0fa6bac7760383b6f6ea8.tar.gz
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 } ```
-rw-r--r--parse/gram.y2
1 files changed, 1 insertions, 1 deletions
diff --git a/parse/gram.y b/parse/gram.y
index a5151fd..8e8e51b 100644
--- a/parse/gram.y
+++ b/parse/gram.y
@@ -936,7 +936,7 @@ params : fnparam {
$$.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;}
;