Repository: w3c/webidl2.js
Pull request #198 (2018-06-10 08:33:30)

Add trivia for arguments
Happy to see more and more commits are merged for #185 😍

marcoscaceres: Nearly there 💪

Patch:
diff --git a/lib/webidl2.js b/lib/webidl2.js
index 21bd621..bd013ff 100644
--- a/lib/webidl2.js
+++ b/lib/webidl2.js
@@ -447,19 +447,22 @@
 
     function argument() {
       const start_position = consume_position;
-      const ret = { optional: false, variadic: false, default: null };
+      const ret = { optional: null, variadic: null, default: null, trivia: {} };
       ret.extAttrs = extended_attrs();
-      const opt_token = consume("optional");
-      if (opt_token) {
-        ret.optional = true;
+      const optional = consume("optional");
+      if (optional) {
+        ret.optional = { trivia: optional.trivia };
       }
       ret.idlType = type_with_extended_attributes("argument-type");
       if (!ret.idlType) {
         unconsume(start_position);
         return;
       }
-      if (!ret.optional && consume("...")) {
-        ret.variadic = true;
+      if (!ret.optional) {
+        const variadic = consume("...");
+        if (variadic) {
+          ret.variadic = { trivia: variadic.trivia };
+        }
       }
       const name = consume(ID, ...argumentNameKeywords);
       if (!name) {
@@ -468,6 +471,7 @@
       }
       ret.name = unescape(name.value);
       ret.escapedName = name.value;
+      ret.trivia.name = name.trivia;
       if (ret.optional) {
         ret.default = default_() || null;
       }
@@ -478,12 +482,15 @@
       const ret = [];
       const arg = argument();
       if (!arg) return ret;
+      arg.separator = untyped_consume(",") || null;
       ret.push(arg);
-      while (true) {
-        if (!consume(",")) return ret;
+      while (arg.separator) {
         const nxt = argument() || error("Trailing comma in arguments list");
+        nxt.separator = untyped_consume(",") || null;
         ret.push(nxt);
+        if (!nxt.separator) break;
       }
+      return ret;
     }
 
     function simple_extended_attr() {
diff --git a/lib/writer.js b/lib/writer.js
index fe60bdd..215eacb 100644
--- a/lib/writer.js
+++ b/lib/writer.js
@@ -29,11 +29,12 @@
     };
     function argument(arg) {
       let ret = extended_attributes(arg.extAttrs);
-      if (arg.optional) ret += "optional";
+      if (arg.optional) ret += `${arg.optional.trivia}optional`;
       ret += type(arg.idlType);
-      if (arg.variadic) ret += "...";
-      ret += ` ${arg.escapedName}`;
+      if (arg.variadic) ret += `${arg.variadic.trivia}...`;
+      ret += `${arg.trivia.name}${arg.escapedName}`;
       if (arg.default) ret += ` = ${const_value(arg.default)}`;
+      if (arg.separator) ret += `${arg.separator.trivia}${arg.separator.value}`;
       return ret;
     };
     function make_ext_at(it) {
@@ -42,7 +43,7 @@
         if (it.rhs.type === "identifier-list") ret += `=(${it.rhs.value.join(",")})`;
         else ret += `=${it.rhs.value}`;
       }
-      if (it.arguments) ret += `(${it.arguments.map(argument).join(",")})`;
+      if (it.arguments) ret += `(${it.arguments.map(argument).join("")})`;
       return ret;
     };
     function extended_attributes(eats) {
@@ -59,7 +60,7 @@
         const { body } = it;
         ret += type(body.idlType);
         if (body.name) ret += body.name.trivia + body.name.escaped;
-        ret += `${body.trivia.open}(${body.arguments.map(argument).join(",")}${body.trivia.close})`;
+        ret += `${body.trivia.open}(${body.arguments.map(argument).join("")}${body.trivia.close})`;
       }
       ret += it.trivia.termination + ";";
       return ret;
@@ -138,7 +139,7 @@
     };
     function callback(it) {
       const ret = extended_attributes(it.extAttrs);
-      const args = it.arguments.map(argument).join(",");
+      const args = it.arguments.map(argument).join("");
       return `${ret}callback ${it.name} =${type(it.idlType)}(${args});`;
     };
     function enum_(it) {


Test patch:
diff --git a/test/syntax/json/allowany.json b/test/syntax/json/allowany.json
index 9771519..c769be4 100644
--- a/test/syntax/json/allowany.json
+++ b/test/syntax/json/allowany.json
@@ -77,9 +77,12 @@
                     },
                     "arguments": [
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -97,7 +100,8 @@
                                 }
                             },
                             "name": "b",
-                            "escapedName": "b"
+                            "escapedName": "b",
+                            "separator": null
                         }
                     ]
                 },
@@ -140,9 +144,12 @@
                     },
                     "arguments": [
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [
                                 {
                                     "name": "AllowAny",
@@ -167,7 +174,8 @@
                                 }
                             },
                             "name": "s",
-                            "escapedName": "s"
+                            "escapedName": "s",
+                            "separator": null
                         }
                     ]
                 },
diff --git a/test/syntax/json/callback.json b/test/syntax/json/callback.json
index 8381ca5..f9b4780 100644
--- a/test/syntax/json/callback.json
+++ b/test/syntax/json/callback.json
@@ -19,9 +19,12 @@
         },
         "arguments": [
             {
-                "optional": false,
-                "variadic": false,
+                "optional": null,
+                "variadic": null,
                 "default": null,
+                "trivia": {
+                    "name": " "
+                },
                 "extAttrs": [],
                 "idlType": {
                     "type": "argument-type",
@@ -39,7 +42,8 @@
                     }
                 },
                 "name": "status",
-                "escapedName": "status"
+                "escapedName": "status",
+                "separator": null
             }
         ],
         "extAttrs": []
@@ -83,9 +87,12 @@
                     },
                     "arguments": [
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -103,7 +110,8 @@
                                 }
                             },
                             "name": "details",
-                            "escapedName": "details"
+                            "escapedName": "details",
+                            "separator": null
                         }
                     ]
                 },
@@ -143,9 +151,12 @@
         },
         "arguments": [
             {
-                "optional": false,
-                "variadic": false,
+                "optional": null,
+                "variadic": null,
                 "default": null,
+                "trivia": {
+                    "name": " "
+                },
                 "extAttrs": [],
                 "idlType": {
                     "type": "argument-type",
@@ -163,12 +174,19 @@
                     }
                 },
                 "name": "a",
-                "escapedName": "a"
+                "escapedName": "a",
+                "separator": {
+                    "value": ",",
+                    "trivia": ""
+                }
             },
             {
-                "optional": false,
-                "variadic": false,
+                "optional": null,
+                "variadic": null,
                 "default": null,
+                "trivia": {
+                    "name": " "
+                },
                 "extAttrs": [],
                 "idlType": {
                     "type": "argument-type",
@@ -186,7 +204,8 @@
                     }
                 },
                 "name": "b",
-                "escapedName": "b"
+                "escapedName": "b",
+                "separator": null
             }
         ],
         "extAttrs": []
diff --git a/test/syntax/json/constructor.json b/test/syntax/json/constructor.json
index 6de596a..2945902 100644
--- a/test/syntax/json/constructor.json
+++ b/test/syntax/json/constructor.json
@@ -146,9 +146,12 @@
                 "name": "Constructor",
                 "arguments": [
                     {
-                        "optional": false,
-                        "variadic": false,
+                        "optional": null,
+                        "variadic": null,
                         "default": null,
+                        "trivia": {
+                            "name": " "
+                        },
                         "extAttrs": [],
                         "idlType": {
                             "type": "argument-type",
@@ -166,7 +169,8 @@
                             }
                         },
                         "name": "radius",
-                        "escapedName": "radius"
+                        "escapedName": "radius",
+                        "separator": null
                     }
                 ],
                 "type": "extended-attribute",
diff --git a/test/syntax/json/enum.json b/test/syntax/json/enum.json
index ae6b5b3..d578a5e 100644
--- a/test/syntax/json/enum.json
+++ b/test/syntax/json/enum.json
@@ -117,9 +117,12 @@
                     },
                     "arguments": [
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -137,12 +140,19 @@
                                 }
                             },
                             "name": "type",
-                            "escapedName": "type"
+                            "escapedName": "type",
+                            "separator": {
+                                "value": ",",
+                                "trivia": ""
+                            }
                         },
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -160,7 +170,8 @@
                                 }
                             },
                             "name": "size",
-                            "escapedName": "size"
+                            "escapedName": "size",
+                            "separator": null
                         }
                     ]
                 },
diff --git a/test/syntax/json/equivalent-decl.json b/test/syntax/json/equivalent-decl.json
index 081e655..0770fa8 100644
--- a/test/syntax/json/equivalent-decl.json
+++ b/test/syntax/json/equivalent-decl.json
@@ -75,9 +75,12 @@
                     },
                     "arguments": [
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -95,7 +98,8 @@
                                 }
                             },
                             "name": "propertyName",
-                            "escapedName": "propertyName"
+                            "escapedName": "propertyName",
+                            "separator": null
                         }
                     ]
                 },
@@ -140,9 +144,12 @@
                     },
                     "arguments": [
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -160,12 +167,19 @@
                                 }
                             },
                             "name": "propertyName",
-                            "escapedName": "propertyName"
+                            "escapedName": "propertyName",
+                            "separator": {
+                                "value": ",",
+                                "trivia": ""
+                            }
                         },
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -183,7 +197,8 @@
                                 }
                             },
                             "name": "propertyValue",
-                            "escapedName": "propertyValue"
+                            "escapedName": "propertyValue",
+                            "separator": null
                         }
                     ]
                 },
@@ -277,9 +292,12 @@
                     },
                     "arguments": [
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -297,7 +315,8 @@
                                 }
                             },
                             "name": "propertyName",
-                            "escapedName": "propertyName"
+                            "escapedName": "propertyName",
+                            "separator": null
                         }
                     ]
                 },
@@ -340,9 +359,12 @@
                     },
                     "arguments": [
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -360,12 +382,19 @@
                                 }
                             },
                             "name": "propertyName",
-                            "escapedName": "propertyName"
+                            "escapedName": "propertyName",
+                            "separator": {
+                                "value": ",",
+                                "trivia": ""
+                            }
                         },
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -383,7 +412,8 @@
                                 }
                             },
                             "name": "propertyValue",
-                            "escapedName": "propertyValue"
+                            "escapedName": "propertyValue",
+                            "separator": null
                         }
                     ]
                 },
@@ -424,9 +454,12 @@
                     "name": null,
                     "arguments": [
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -444,7 +477,8 @@
                                 }
                             },
                             "name": "propertyName",
-                            "escapedName": "propertyName"
+                            "escapedName": "propertyName",
+                            "separator": null
                         }
                     ]
                 },
@@ -485,9 +519,12 @@
                     "name": null,
                     "arguments": [
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -505,12 +542,19 @@
                                 }
                             },
                             "name": "propertyName",
-                            "escapedName": "propertyName"
+                            "escapedName": "propertyName",
+                            "separator": {
+                                "value": ",",
+                                "trivia": ""
+                            }
                         },
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -528,7 +572,8 @@
                                 }
                             },
                             "name": "propertyValue",
-                            "escapedName": "propertyValue"
+                            "escapedName": "propertyValue",
+                            "separator": null
                         }
                     ]
                 },
diff --git a/test/syntax/json/extended-attributes.json b/test/syntax/json/extended-attributes.json
index e7a8e45..78c51d4 100644
--- a/test/syntax/json/extended-attributes.json
+++ b/test/syntax/json/extended-attributes.json
@@ -232,9 +232,12 @@
                 "name": "Constructor",
                 "arguments": [
                     {
-                        "optional": false,
-                        "variadic": false,
+                        "optional": null,
+                        "variadic": null,
                         "default": null,
+                        "trivia": {
+                            "name": " "
+                        },
                         "extAttrs": [],
                         "idlType": {
                             "type": "argument-type",
@@ -252,7 +255,8 @@
                             }
                         },
                         "name": "radius",
-                        "escapedName": "radius"
+                        "escapedName": "radius",
+                        "separator": null
                     }
                 ],
                 "type": "extended-attribute",
diff --git a/test/syntax/json/getter-setter.json b/test/syntax/json/getter-setter.json
index 2536730..2490726 100644
--- a/test/syntax/json/getter-setter.json
+++ b/test/syntax/json/getter-setter.json
@@ -71,9 +71,12 @@
                     "name": null,
                     "arguments": [
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -91,7 +94,8 @@
                                 }
                             },
                             "name": "propertyName",
-                            "escapedName": "propertyName"
+                            "escapedName": "propertyName",
+                            "separator": null
                         }
                     ]
                 },
@@ -132,9 +136,12 @@
                     "name": null,
                     "arguments": [
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -152,12 +159,19 @@
                                 }
                             },
                             "name": "propertyName",
-                            "escapedName": "propertyName"
+                            "escapedName": "propertyName",
+                            "separator": {
+                                "value": ",",
+                                "trivia": ""
+                            }
                         },
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -175,7 +189,8 @@
                                 }
                             },
                             "name": "propertyValue",
-                            "escapedName": "propertyValue"
+                            "escapedName": "propertyValue",
+                            "separator": null
                         }
                     ]
                 },
diff --git a/test/syntax/json/identifier-qualified-names.json b/test/syntax/json/identifier-qualified-names.json
index b0770a1..9b00203 100644
--- a/test/syntax/json/identifier-qualified-names.json
+++ b/test/syntax/json/identifier-qualified-names.json
@@ -58,9 +58,12 @@
                     },
                     "arguments": [
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -78,7 +81,8 @@
                                 }
                             },
                             "name": "interface",
-                            "escapedName": "_interface"
+                            "escapedName": "_interface",
+                            "separator": null
                         }
                     ]
                 },
@@ -119,9 +123,12 @@
                     "name": null,
                     "arguments": [
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -139,7 +146,8 @@
                                 }
                             },
                             "name": "keyName",
-                            "escapedName": "keyName"
+                            "escapedName": "keyName",
+                            "separator": null
                         }
                     ]
                 },
@@ -276,9 +284,12 @@
                     },
                     "arguments": [
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -298,7 +309,8 @@
                                 }
                             },
                             "name": "callback",
-                            "escapedName": "callback"
+                            "escapedName": "callback",
+                            "separator": null
                         }
                     ]
                 },
diff --git a/test/syntax/json/implements.json b/test/syntax/json/implements.json
index cde5c75..6e13ac2 100644
--- a/test/syntax/json/implements.json
+++ b/test/syntax/json/implements.json
@@ -89,9 +89,12 @@
                     },
                     "arguments": [
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -109,12 +112,19 @@
                                 }
                             },
                             "name": "type",
-                            "escapedName": "type"
+                            "escapedName": "type",
+                            "separator": {
+                                "value": ",",
+                                "trivia": ""
+                            }
                         },
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -132,12 +142,19 @@
                                 }
                             },
                             "name": "listener",
-                            "escapedName": "listener"
+                            "escapedName": "listener",
+                            "separator": {
+                                "value": ",",
+                                "trivia": ""
+                            }
                         },
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -155,7 +172,8 @@
                                 }
                             },
                             "name": "useCapture",
-                            "escapedName": "useCapture"
+                            "escapedName": "useCapture",
+                            "separator": null
                         }
                     ]
                 },
diff --git a/test/syntax/json/indexed-properties.json b/test/syntax/json/indexed-properties.json
index c772164..7a1dfa8 100644
--- a/test/syntax/json/indexed-properties.json
+++ b/test/syntax/json/indexed-properties.json
@@ -75,9 +75,12 @@
                     },
                     "arguments": [
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -98,7 +101,8 @@
                                 }
                             },
                             "name": "index",
-                            "escapedName": "index"
+                            "escapedName": "index",
+                            "separator": null
                         }
                     ]
                 },
@@ -143,9 +147,12 @@
                     },
                     "arguments": [
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -166,12 +173,19 @@
                                 }
                             },
                             "name": "index",
-                            "escapedName": "index"
+                            "escapedName": "index",
+                            "separator": {
+                                "value": ",",
+                                "trivia": ""
+                            }
                         },
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -189,7 +203,8 @@
                                 }
                             },
                             "name": "value",
-                            "escapedName": "value"
+                            "escapedName": "value",
+                            "separator": null
                         }
                     ]
                 },
@@ -234,9 +249,12 @@
                     },
                     "arguments": [
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -257,7 +275,8 @@
                                 }
                             },
                             "name": "index",
-                            "escapedName": "index"
+                            "escapedName": "index",
+                            "separator": null
                         }
                     ]
                 },
@@ -302,9 +321,12 @@
                     },
                     "arguments": [
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -322,7 +344,8 @@
                                 }
                             },
                             "name": "name",
-                            "escapedName": "name"
+                            "escapedName": "name",
+                            "separator": null
                         }
                     ]
                 },
@@ -367,9 +390,12 @@
                     },
                     "arguments": [
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -387,12 +413,19 @@
                                 }
                             },
                             "name": "name",
-                            "escapedName": "name"
+                            "escapedName": "name",
+                            "separator": {
+                                "value": ",",
+                                "trivia": ""
+                            }
                         },
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -410,7 +443,8 @@
                                 }
                             },
                             "name": "value",
-                            "escapedName": "value"
+                            "escapedName": "value",
+                            "separator": null
                         }
                     ]
                 },
@@ -455,9 +489,12 @@
                     },
                     "arguments": [
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -475,7 +512,8 @@
                                 }
                             },
                             "name": "name",
-                            "escapedName": "name"
+                            "escapedName": "name",
+                            "separator": null
                         }
                     ]
                 },
diff --git a/test/syntax/json/namedconstructor.json b/test/syntax/json/namedconstructor.json
index ce9eba1..6906f2f 100644
--- a/test/syntax/json/namedconstructor.json
+++ b/test/syntax/json/namedconstructor.json
@@ -32,9 +32,12 @@
                 "name": "NamedConstructor",
                 "arguments": [
                     {
-                        "optional": false,
-                        "variadic": false,
+                        "optional": null,
+                        "variadic": null,
                         "default": null,
+                        "trivia": {
+                            "name": " "
+                        },
                         "extAttrs": [],
                         "idlType": {
                             "type": "argument-type",
@@ -52,7 +55,8 @@
                             }
                         },
                         "name": "src",
-                        "escapedName": "src"
+                        "escapedName": "src",
+                        "separator": null
                     }
                 ],
                 "type": "extended-attribute",
diff --git a/test/syntax/json/namespace.json b/test/syntax/json/namespace.json
index 41e01ed..bae362e 100644
--- a/test/syntax/json/namespace.json
+++ b/test/syntax/json/namespace.json
@@ -70,9 +70,12 @@
                     },
                     "arguments": [
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -90,12 +93,19 @@
                                 }
                             },
                             "name": "x",
-                            "escapedName": "x"
+                            "escapedName": "x",
+                            "separator": {
+                                "value": ",",
+                                "trivia": ""
+                            }
                         },
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -113,7 +123,8 @@
                                 }
                             },
                             "name": "y",
-                            "escapedName": "y"
+                            "escapedName": "y",
+                            "separator": null
                         }
                     ]
                 },
@@ -156,9 +167,12 @@
                     },
                     "arguments": [
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -176,12 +190,19 @@
                                 }
                             },
                             "name": "x",
-                            "escapedName": "x"
+                            "escapedName": "x",
+                            "separator": {
+                                "value": ",",
+                                "trivia": ""
+                            }
                         },
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -199,7 +220,8 @@
                                 }
                             },
                             "name": "y",
-                            "escapedName": "y"
+                            "escapedName": "y",
+                            "separator": null
                         }
                     ]
                 },
diff --git a/test/syntax/json/nointerfaceobject.json b/test/syntax/json/nointerfaceobject.json
index fdc88ed..704f799 100644
--- a/test/syntax/json/nointerfaceobject.json
+++ b/test/syntax/json/nointerfaceobject.json
@@ -38,9 +38,12 @@
                     },
                     "arguments": [
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -61,7 +64,8 @@
                                 }
                             },
                             "name": "key",
-                            "escapedName": "key"
+                            "escapedName": "key",
+                            "separator": null
                         }
                     ]
                 },
diff --git a/test/syntax/json/nullableobjects.json b/test/syntax/json/nullableobjects.json
index 550b8d7..fd31a33 100644
--- a/test/syntax/json/nullableobjects.json
+++ b/test/syntax/json/nullableobjects.json
@@ -68,9 +68,12 @@
                     },
                     "arguments": [
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -90,7 +93,8 @@
                                 }
                             },
                             "name": "x",
-                            "escapedName": "x"
+                            "escapedName": "x",
+                            "separator": null
                         }
                     ]
                 },
@@ -133,9 +137,12 @@
                     },
                     "arguments": [
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -155,7 +162,8 @@
                                 }
                             },
                             "name": "x",
-                            "escapedName": "x"
+                            "escapedName": "x",
+                            "separator": null
                         }
                     ]
                 },
diff --git a/test/syntax/json/operation-optional-arg.json b/test/syntax/json/operation-optional-arg.json
index b82a9fe..2e45341 100644
--- a/test/syntax/json/operation-optional-arg.json
+++ b/test/syntax/json/operation-optional-arg.json
@@ -38,9 +38,12 @@
                     },
                     "arguments": [
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -58,12 +61,19 @@
                                 }
                             },
                             "name": "v1",
-                            "escapedName": "v1"
+                            "escapedName": "v1",
+                            "separator": {
+                                "value": ",",
+                                "trivia": ""
+                            }
                         },
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -81,12 +91,19 @@
                                 }
                             },
                             "name": "v2",
-                            "escapedName": "v2"
+                            "escapedName": "v2",
+                            "separator": {
+                                "value": ",",
+                                "trivia": ""
+                            }
                         },
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -104,15 +121,24 @@
                                 }
                             },
                             "name": "v3",
-                            "escapedName": "v3"
+                            "escapedName": "v3",
+                            "separator": {
+                                "value": ",",
+                                "trivia": ""
+                            }
                         },
                         {
-                            "optional": true,
-                            "variadic": false,
+                            "optional": {
+                                "trivia": " "
+                            },
+                            "variadic": null,
                             "default": {
                                 "type": "number",
                                 "value": "3.5"
                             },
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -130,7 +156,8 @@
                                 }
                             },
                             "name": "alpha",
-                            "escapedName": "alpha"
+                            "escapedName": "alpha",
+                            "separator": null
                         }
                     ]
                 },
diff --git a/test/syntax/json/overloading.json b/test/syntax/json/overloading.json
index 1d0bd74..dc409b0 100644
--- a/test/syntax/json/overloading.json
+++ b/test/syntax/json/overloading.json
@@ -68,9 +68,12 @@
                     },
                     "arguments": [
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -88,7 +91,8 @@
                                 }
                             },
                             "name": "x",
-                            "escapedName": "x"
+                            "escapedName": "x",
+                            "separator": null
                         }
                     ]
                 },
@@ -131,9 +135,12 @@
                     },
                     "arguments": [
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -151,7 +158,8 @@
                                 }
                             },
                             "name": "x",
-                            "escapedName": "x"
+                            "escapedName": "x",
+                            "separator": null
                         }
                     ]
                 },
@@ -210,9 +218,12 @@
                     },
                     "arguments": [
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -230,7 +241,8 @@
                                 }
                             },
                             "name": "a",
-                            "escapedName": "a"
+                            "escapedName": "a",
+                            "separator": null
                         }
                     ]
                 },
@@ -273,9 +285,12 @@
                     },
                     "arguments": [
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [
                                 {
                                     "name": "AllowAny",
@@ -300,12 +315,19 @@
                                 }
                             },
                             "name": "a",
-                            "escapedName": "a"
+                            "escapedName": "a",
+                            "separator": {
+                                "value": ",",
+                                "trivia": ""
+                            }
                         },
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -323,12 +345,21 @@
                                 }
                             },
                             "name": "b",
-                            "escapedName": "b"
+                            "escapedName": "b",
+                            "separator": {
+                                "value": ",",
+                                "trivia": ""
+                            }
                         },
                         {
-                            "optional": false,
-                            "variadic": true,
+                            "optional": null,
+                            "variadic": {
+                                "trivia": ""
+                            },
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -346,7 +377,8 @@
                                 }
                             },
                             "name": "c",
-                            "escapedName": "c"
+                            "escapedName": "c",
+                            "separator": null
                         }
                     ]
                 },
@@ -428,9 +460,12 @@
                     },
                     "arguments": [
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -448,12 +483,19 @@
                                 }
                             },
                             "name": "a",
-                            "escapedName": "a"
+                            "escapedName": "a",
+                            "separator": {
+                                "value": ",",
+                                "trivia": ""
+                            }
                         },
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -471,12 +513,21 @@
                                 }
                             },
                             "name": "b",
-                            "escapedName": "b"
+                            "escapedName": "b",
+                            "separator": {
+                                "value": ",",
+                                "trivia": ""
+                            }
                         },
                         {
-                            "optional": true,
-                            "variadic": false,
+                            "optional": {
+                                "trivia": " "
+                            },
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -494,12 +545,21 @@
                                 }
                             },
                             "name": "c",
-                            "escapedName": "c"
+                            "escapedName": "c",
+                            "separator": {
+                                "value": ",",
+                                "trivia": ""
+                            }
                         },
                         {
-                            "optional": false,
-                            "variadic": true,
+                            "optional": null,
+                            "variadic": {
+                                "trivia": ""
+                            },
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -517,7 +577,8 @@
                                 }
                             },
                             "name": "d",
-                            "escapedName": "d"
+                            "escapedName": "d",
+                            "separator": null
                         }
                     ]
                 },
diff --git a/test/syntax/json/overridebuiltins.json b/test/syntax/json/overridebuiltins.json
index 7685f91..94c30d8 100644
--- a/test/syntax/json/overridebuiltins.json
+++ b/test/syntax/json/overridebuiltins.json
@@ -75,9 +75,12 @@
                     },
                     "arguments": [
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -95,7 +98,8 @@
                                 }
                             },
                             "name": "key",
-                            "escapedName": "key"
+                            "escapedName": "key",
+                            "separator": null
                         }
                     ]
                 },
diff --git a/test/syntax/json/record.json b/test/syntax/json/record.json
index 3f8460b..ddb9d02 100644
--- a/test/syntax/json/record.json
+++ b/test/syntax/json/record.json
@@ -38,9 +38,12 @@
                     },
                     "arguments": [
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -120,7 +123,8 @@
                                 }
                             },
                             "name": "param",
-                            "escapedName": "param"
+                            "escapedName": "param",
+                            "separator": null
                         }
                     ]
                 },
@@ -259,9 +263,12 @@
                 "name": "Constructor",
                 "arguments": [
                     {
-                        "optional": false,
-                        "variadic": false,
+                        "optional": null,
+                        "variadic": null,
                         "default": null,
+                        "trivia": {
+                            "name": " "
+                        },
                         "extAttrs": [],
                         "idlType": {
                             "type": "argument-type",
@@ -319,7 +326,8 @@
                             }
                         },
                         "name": "init",
-                        "escapedName": "init"
+                        "escapedName": "init",
+                        "separator": null
                     }
                 ],
                 "type": "extended-attribute",
diff --git a/test/syntax/json/reg-operations.json b/test/syntax/json/reg-operations.json
index ce9e811..a1c8880 100644
--- a/test/syntax/json/reg-operations.json
+++ b/test/syntax/json/reg-operations.json
@@ -159,9 +159,12 @@
                     },
                     "arguments": [
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -179,7 +182,8 @@
                                 }
                             },
                             "name": "size",
-                            "escapedName": "size"
+                            "escapedName": "size",
+                            "separator": null
                         }
                     ]
                 },
@@ -222,9 +226,12 @@
                     },
                     "arguments": [
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -245,12 +252,19 @@
                                 }
                             },
                             "name": "width",
-                            "escapedName": "width"
+                            "escapedName": "width",
+                            "separator": {
+                                "value": ",",
+                                "trivia": ""
+                            }
                         },
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -271,7 +285,8 @@
                                 }
                             },
                             "name": "height",
-                            "escapedName": "height"
+                            "escapedName": "height",
+                            "separator": null
                         }
                     ]
                 },
diff --git a/test/syntax/json/sequence.json b/test/syntax/json/sequence.json
index 953dfd4..50ed736 100644
--- a/test/syntax/json/sequence.json
+++ b/test/syntax/json/sequence.json
@@ -38,9 +38,12 @@
                     },
                     "arguments": [
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -80,7 +83,8 @@
                                 }
                             },
                             "name": "coordinates",
-                            "escapedName": "coordinates"
+                            "escapedName": "coordinates",
+                            "separator": null
                         }
                     ]
                 },
@@ -200,9 +204,12 @@
                     },
                     "arguments": [
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -249,7 +256,8 @@
                                 }
                             },
                             "name": "arg",
-                            "escapedName": "arg"
+                            "escapedName": "arg",
+                            "separator": null
                         }
                     ]
                 },
diff --git a/test/syntax/json/static.json b/test/syntax/json/static.json
index 1ba5521..11f98fe 100644
--- a/test/syntax/json/static.json
+++ b/test/syntax/json/static.json
@@ -179,9 +179,12 @@
                     },
                     "arguments": [
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -199,12 +202,19 @@
                                 }
                             },
                             "name": "c1",
-                            "escapedName": "c1"
+                            "escapedName": "c1",
+                            "separator": {
+                                "value": ",",
+                                "trivia": ""
+                            }
                         },
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -222,12 +232,19 @@
                                 }
                             },
                             "name": "c2",
-                            "escapedName": "c2"
+                            "escapedName": "c2",
+                            "separator": {
+                                "value": ",",
+                                "trivia": ""
+                            }
                         },
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -245,7 +262,8 @@
                                 }
                             },
                             "name": "c3",
-                            "escapedName": "c3"
+                            "escapedName": "c3",
+                            "separator": null
                         }
                     ]
                 },
diff --git a/test/syntax/json/treatasnull.json b/test/syntax/json/treatasnull.json
index f540bf8..1ec7366 100644
--- a/test/syntax/json/treatasnull.json
+++ b/test/syntax/json/treatasnull.json
@@ -98,9 +98,12 @@
                     },
                     "arguments": [
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [
                                 {
                                     "name": "TreatNullAs",
@@ -128,7 +131,8 @@
                                 }
                             },
                             "name": "breedName",
-                            "escapedName": "breedName"
+                            "escapedName": "breedName",
+                            "separator": null
                         }
                     ]
                 },
diff --git a/test/syntax/json/treatasundefined.json b/test/syntax/json/treatasundefined.json
index dd3108a..d31d555 100644
--- a/test/syntax/json/treatasundefined.json
+++ b/test/syntax/json/treatasundefined.json
@@ -98,9 +98,12 @@
                     },
                     "arguments": [
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [
                                 {
                                     "name": "TreatUndefinedAs",
@@ -128,7 +131,8 @@
                                 }
                             },
                             "name": "breedName",
-                            "escapedName": "breedName"
+                            "escapedName": "breedName",
+                            "separator": null
                         }
                     ]
                 },
diff --git a/test/syntax/json/typedef.json b/test/syntax/json/typedef.json
index 6795e1d..11e4f36 100644
--- a/test/syntax/json/typedef.json
+++ b/test/syntax/json/typedef.json
@@ -264,9 +264,12 @@
                     },
                     "arguments": [
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -284,7 +287,8 @@
                                 }
                             },
                             "name": "p",
-                            "escapedName": "p"
+                            "escapedName": "p",
+                            "separator": null
                         }
                     ]
                 },
@@ -327,9 +331,12 @@
                     },
                     "arguments": [
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -347,7 +354,8 @@
                                 }
                             },
                             "name": "ps",
-                            "escapedName": "ps"
+                            "escapedName": "ps",
+                            "separator": null
                         }
                     ]
                 },
diff --git a/test/syntax/json/typesuffixes.json b/test/syntax/json/typesuffixes.json
index da79fba..e6d5b5c 100644
--- a/test/syntax/json/typesuffixes.json
+++ b/test/syntax/json/typesuffixes.json
@@ -38,9 +38,12 @@
                     },
                     "arguments": [
                         {
-                            "optional": false,
-                            "variadic": false,
+                            "optional": null,
+                            "variadic": null,
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -84,7 +87,8 @@
                                 }
                             },
                             "name": "foo",
-                            "escapedName": "foo"
+                            "escapedName": "foo",
+                            "separator": null
                         }
                     ]
                 },
diff --git a/test/syntax/json/variadic-operations.json b/test/syntax/json/variadic-operations.json
index b27c848..171ba30 100644
--- a/test/syntax/json/variadic-operations.json
+++ b/test/syntax/json/variadic-operations.json
@@ -73,9 +73,14 @@
                     },
                     "arguments": [
                         {
-                            "optional": false,
-                            "variadic": true,
+                            "optional": null,
+                            "variadic": {
+                                "trivia": ""
+                            },
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -93,7 +98,8 @@
                                 }
                             },
                             "name": "ints",
-                            "escapedName": "ints"
+                            "escapedName": "ints",
+                            "separator": null
                         }
                     ]
                 },
@@ -136,9 +142,14 @@
                     },
                     "arguments": [
                         {
-                            "optional": false,
-                            "variadic": true,
+                            "optional": null,
+                            "variadic": {
+                                "trivia": ""
+                            },
                             "default": null,
+                            "trivia": {
+                                "name": " "
+                            },
                             "extAttrs": [],
                             "idlType": {
                                 "type": "argument-type",
@@ -156,7 +167,8 @@
                                 }
                             },
                             "name": "ints",
-                            "escapedName": "ints"
+                            "escapedName": "ints",
+                            "separator": null
                         }
                     ]
                 },