Repository: w3c/webidl2.js
Pull request #192 (2018-06-09 06:36:20)

Add trivia for idlTypes
These four commits are mutually related (so I couldn't fix writer.js for each commit), but still each commit has its own baseline changes.


Patch:
diff --git a/lib/webidl2.js b/lib/webidl2.js
index 12dfe74..a03b71b 100644
--- a/lib/webidl2.js
+++ b/lib/webidl2.js
@@ -195,9 +195,13 @@
 
     const EMPTY_IDLTYPE = Object.freeze({
       generic: null,
-      nullable: false,
+      nullable: null,
       union: false,
       idlType: null,
+      baseName: null,
+      prefix: null,
+      postfix: null,
+      separator: null,
       extAttrs: []
     });
 
@@ -248,6 +252,15 @@
       }
     }
 
+    /** Use when the target token is intended to be exposed via API */
+    function untyped_consume(...args) {
+      const token = consume(...args);
+      if (token) {
+        const { value, trivia } = token;
+        return { value, trivia };
+      }
+    }
+
     function unescape(identifier) {
       return identifier.startsWith('_') ? identifier.slice(1) : identifier;
     }
@@ -268,31 +281,46 @@
     }
 
     function integer_type() {
-      let ret = "";
-      if (consume("unsigned")) ret = "unsigned ";
-      if (consume("short")) return ret + "short";
-      if (consume("long")) {
-        ret += "long";
-        if (consume("long")) return ret + " long";
-        return ret;
+      const prefix = untyped_consume("unsigned") || null;
+      const base = untyped_consume("short", "long");
+      if (base) {
+        const postfix = untyped_consume("long") || null;
+        return {
+          idlType: [prefix, base, postfix].filter(t => t).map(t => t.value).join(' '),
+          prefix,
+          postfix,
+          baseName: base.value,
+          trivia: { base: base.trivia }
+        };
       }
-      if (ret) error("Failed to parse integer type");
+      if (prefix) error("Failed to parse integer type");
     }
 
     function float_type() {
-      let ret = "";
-      if (consume("unrestricted")) ret = "unrestricted ";
-      if (consume("float")) return ret + "float";
-      if (consume("double")) return ret + "double";
-      if (ret) error("Failed to parse float type");
+      const prefix = untyped_consume("unrestricted") || null;
+      const base = untyped_consume("float", "double");
+      if (base) {
+        return {
+          idlType: [prefix, base].filter(t => t).map(t => t.value).join(' '),
+          prefix,
+          baseName: base.value,
+          trivia: { base: base.trivia }
+        }
+      }
+      if (prefix) error("Failed to parse float type");
     }
 
     function primitive_type() {
       const num_type = integer_type() || float_type();
       if (num_type) return num_type;
-      if (consume("boolean")) return "boolean";
-      if (consume("byte")) return "byte";
-      if (consume("octet")) return "octet";
+      const base = consume("boolean", "byte", "octet");
+      if (base) {
+        return {
+          idlType: base.value,
+          baseName: base.value,
+          trivia: { base: base.trivia }
+        }
+      }
     }
 
     function const_value() {
@@ -307,7 +335,10 @@
     }
 
     function type_suffix(obj) {
-      obj.nullable = !!consume("?");
+      const nullable = consume("?");
+      if (nullable) {
+        obj.nullable = { trivia: nullable.trivia };
+      }
       if (probe("?")) error("Can't nullable more than once");
     }
 
@@ -316,8 +347,13 @@
       if (!name) {
         return;
       }
-      const ret = { generic: name.type };
-      consume("<") || error(`No opening bracket after ${name.type}`);
+      const ret = {
+        baseName: name.value,
+        generic: { value: name.value, trivia: {} },
+        trivia: { base: name.trivia }
+      };
+      const open = consume("<") || error(`No opening bracket after ${name.type}`);
+      ret.generic.trivia.open = open.trivia;
       switch (name.type) {
         case "Promise":
           if (probe("[")) error("Promise type cannot have extended attribute");
@@ -332,36 +368,42 @@
           ret.idlType = [];
           const keyType = consume(...stringTypes);
           if (!keyType) error(`Record key must be a string type`);
-          ret.idlType.push(Object.assign({ type: typeName }, EMPTY_IDLTYPE, { idlType: keyType.value }));
-          consume(",") || error("Missing comma after record key type");
+          const separator = untyped_consume(",") || error("Missing comma after record key type");
+          ret.idlType.push(Object.assign({ type: typeName }, EMPTY_IDLTYPE, {
+            baseName: keyType.value,
+            idlType: keyType.value,
+            separator,
+            trivia: {
+              base: keyType.trivia
+            }
+          }));
           const valueType = type_with_extended_attributes(typeName) || error("Error parsing generic type record");
           ret.idlType.push(valueType);
           break;
       }
       if (!ret.idlType) error(`Error parsing generic type ${name.type}`);
-      consume(">") || error(`Missing closing bracket after ${name.type}`);
-      if (name.type === "Promise" && probe("?")) {
-        error("Promise type cannot be nullable");
-      }
-      type_suffix(ret);
+      const close = consume(">") || error(`Missing closing bracket after ${name.type}`);
+      ret.generic.trivia.close = close.trivia;
       return ret;
     }
 
     function single_type(typeName) {
-      const ret = Object.assign({ type: typeName || null }, EMPTY_IDLTYPE);
-      const generic = generic_type(typeName);
-      if (generic) {
-        return Object.assign(ret, generic);
-      }
-      const prim = primitive_type();
+      const ret = Object.assign({ type: typeName || null }, EMPTY_IDLTYPE, { trivia: {} });
+      const base = generic_type(typeName) || primitive_type();
       let name;
-      if (prim) {
-        ret.idlType = prim;
-      } else if (name = consume(ID, ...stringTypes)) {
-        ret.idlType = name.value;
-        if (probe("<")) error(`Unsupported generic type ${name.value}`);
+      if (base) {
+        Object.assign(ret, base);
       } else {
-        return;
+        const name = consume(ID, ...stringTypes);
+        if (!name) {
+          return;
+        }
+        ret.baseName = ret.idlType = name.value;
+        ret.trivia.base = name.trivia;
+        if (probe("<")) error(`Unsupported generic type ${name.value}`);
+      }
+      if (ret.generic && ret.generic.value === "Promise" && probe("?")) {
+        error("Promise type cannot be nullable");
       }
       type_suffix(ret);
       if (ret.nullable && ret.idlType === "any") error("Type any cannot be made nullable");
@@ -369,16 +411,24 @@
     }
 
     function union_type(typeName) {
-      if (!consume("(")) return;
-      const ret = Object.assign({ type: typeName || null }, EMPTY_IDLTYPE, { union: true, idlType: [] });
-      do {
+      const open = consume("(");
+      if (!open) return;
+      const trivia = { open: open.trivia };
+      const ret = Object.assign({ type: typeName || null }, EMPTY_IDLTYPE, { union: true, idlType: [], trivia });
+      while (true) {
         const typ = type_with_extended_attributes() || error("No type after open parenthesis or 'or' in union type");
         ret.idlType.push(typ);
-      } while (consume("or"));
+        const or = untyped_consume("or");
+        if (or) {
+          typ.separator = or;
+        }
+        else break;
+      }
       if (ret.idlType.length < 2) {
         error("At least two types are expected in a union type but found less");
       }
-      if (!consume(")")) error("Unterminated union type");
+      const close = consume(")") || error("Unterminated union type");
+      trivia.close = close.trivia;
       type_suffix(ret);
       return ret;
     }
@@ -507,9 +557,9 @@
       let typ = primitive_type();
       if (!typ) {
         typ = consume(ID) || error("No type for const");
-        typ = typ.value;
+        typ = { idlType: type.value }
       }
-      ret.idlType = Object.assign({ type: "const-type" }, EMPTY_IDLTYPE, { idlType: typ });
+      ret.idlType = Object.assign({ type: "const-type" }, EMPTY_IDLTYPE, typ);
       type_suffix(ret.idlType);
       const name = consume(ID) || error("No name for const");
       ret.name = name.value;
@@ -589,8 +639,10 @@
         return;
       }
       ret.idlType = type_with_extended_attributes("attribute-type") || error("No type in attribute");
-      if (ret.idlType.generic === "sequence") error("Attributes cannot accept sequence types");
-      if (ret.idlType.generic === "record") error("Attributes cannot accept record types");
+      switch (ret.idlType.generic && ret.idlType.generic.value) {
+        case "sequence":
+        case "record": error(`Attributes cannot accept ${ret.idlType.generic.value} types`);
+      }
       const name = consume(ID, "required") || error("No name in attribute");
       ret.name = unescape(name.value);
       ret.escapedName = name.value;
@@ -603,8 +655,13 @@
       if (typ) {
         return typ;
       }
-      if (consume("void")) {
-        return Object.assign({ type: "return-type" }, EMPTY_IDLTYPE, { idlType: "void" });
+      const voidToken = consume("void");
+      if (voidToken) {
+        return Object.assign({ type: "return-type" }, EMPTY_IDLTYPE, {
+          idlType: "void",
+          baseName: "void",
+          trivia: { base: voidToken.trivia }
+        });
       }
     }
 
diff --git a/lib/writer.js b/lib/writer.js
index a34c88c..541f0ba 100644
--- a/lib/writer.js
+++ b/lib/writer.js
@@ -3,12 +3,17 @@
 (() => {
   function write(ast) {
     function type(it) {
-      if (typeof it === "string") return it;
       let ret = extended_attributes(it.extAttrs);
-      if (it.union) ret += `(${it.idlType.map(type).join(" or ")})`;
-      else if (it.generic) ret += `${it.generic}<${it.idlType.map(type).join(", ")}>`;
-      else ret += type(it.idlType);
-      if (it.nullable) ret += "?";
+      if (it.prefix) ret += it.prefix.trivia + it.prefix.value;
+      if (it.union) ret += `${it.trivia.open}(${it.idlType.map(type).join("")}${it.trivia.close})`;
+      else if (it.generic) ret += `${it.trivia.base}${it.generic.value}${it.generic.trivia.open}<${it.idlType.map(type).join("")}${it.generic.trivia.close}>`;
+      else {
+        ret += it.trivia.base;
+        ret += typeof it.idlType === "string" ? it.baseName : type(it.idlType);
+      }
+      if (it.postfix) ret += it.postfix.trivia + it.postfix.value;
+      if (it.nullable) ret += `${it.nullable.trivia}?`;
+      if (it.separator) ret += it.separator.trivia + it.separator.value;
 
       return ret;
     };
@@ -24,7 +29,7 @@
     };
     function argument(arg) {
       let ret = extended_attributes(arg.extAttrs);
-      if (arg.optional) ret += "optional ";
+      if (arg.optional) ret += "optional";
       ret += type(arg.idlType);
       if (arg.variadic) ret += "...";
       ret += ` ${arg.escapedName}`;
@@ -49,7 +54,7 @@
       let ret = extended_attributes(it.extAttrs);
       if (it.stringifier && !it.idlType) return "stringifier;";
       for (const mod of ["getter", "setter", "deleter", "stringifier", "static"]) {
-        if (it[mod]) ret += mod + " ";
+        if (it[mod]) ret += mod;
       }
       ret += type(it.idlType) + " ";
       if (it.name) ret += it.escapedName;
@@ -63,7 +68,7 @@
       if (it.stringifier) ret += "stringifier ";
       if (it.inherit) ret += "inherit ";
       if (it.readonly) ret += "readonly ";
-      ret += `attribute ${type(it.idlType)} ${it.escapedName};`;
+      ret += `attribute${type(it.idlType)} ${it.escapedName};`;
       return ret;
     };
 
@@ -102,7 +107,7 @@
     };
     function field(it) {
       let ret = extended_attributes(it.extAttrs);
-      if (it.required) ret += "required ";
+      if (it.required) ret += "required";
       ret += `${type(it.idlType)} ${it.escapedName}`;
       if (it.default) ret += ` = ${const_value(it.default)}`;
       ret += ";";
@@ -110,12 +115,11 @@
     };
     function const_(it) {
       const ret = extended_attributes(it.extAttrs);
-      return `${ret}const ${type(it.idlType)} ${it.name} = ${const_value(it.value)};`;
+      return `${ret}const${type(it.idlType)} ${it.name} = ${const_value(it.value)};`;
     };
     function typedef(it) {
       let ret = extended_attributes(it.extAttrs);
-      ret += `typedef ${extended_attributes(it.typeExtAttrs)}`;
-      return `${ret}${type(it.idlType)} ${it.name};`;
+      return `${ret}typedef${type(it.idlType)} ${it.name};`;
     };
     function implements_(it) {
       const ret = extended_attributes(it.extAttrs);
@@ -128,7 +132,7 @@
     function callback(it) {
       const ret = extended_attributes(it.extAttrs);
       const args = it.arguments.map(argument).join(",");
-      return `${ret}callback ${it.name} = ${type(it.idlType)}(${args});`;
+      return `${ret}callback ${it.name} =${type(it.idlType)}(${args});`;
     };
     function enum_(it) {
       const ext = extended_attributes(it.extAttrs);
@@ -137,7 +141,7 @@
     };
     function iterable_like(it) {
       const readonly = it.readonly ? "readonly " : "";
-      return `${readonly}${it.type}<${it.idlType.map(type).join(", ")}>;`;
+      return `${readonly}${it.type}<${it.idlType.map(type).join(",")}>;`;
     };
     function callbackInterface(it) {
       return `callback${interface_(it)}`;


Test patch:
diff --git a/test/syntax/json/allowany.json b/test/syntax/json/allowany.json
index f0b9337..9398f31 100644
--- a/test/syntax/json/allowany.json
+++ b/test/syntax/json/allowany.json
@@ -14,10 +14,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "void",
-                    "extAttrs": []
+                    "baseName": "void",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n  "
+                    }
                 },
                 "name": "g",
                 "escapedName": "g",
@@ -34,10 +41,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "void",
-                    "extAttrs": []
+                    "baseName": "void",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n  "
+                    }
                 },
                 "name": "g",
                 "escapedName": "g",
@@ -50,10 +64,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "B",
-                            "extAttrs": []
+                            "baseName": "B",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         },
                         "name": "b",
                         "escapedName": "b"
@@ -71,10 +92,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "void",
-                    "extAttrs": []
+                    "baseName": "void",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n  "
+                    }
                 },
                 "name": "g",
                 "escapedName": "g",
@@ -94,10 +122,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "DOMString",
-                            "extAttrs": []
+                            "baseName": "DOMString",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": " "
+                            }
                         },
                         "name": "s",
                         "escapedName": "s"
diff --git a/test/syntax/json/attributes.json b/test/syntax/json/attributes.json
index 6b5d932..bbc73db 100644
--- a/test/syntax/json/attributes.json
+++ b/test/syntax/json/attributes.json
@@ -13,10 +13,20 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "unsigned short",
-                    "extAttrs": []
+                    "baseName": "short",
+                    "prefix": {
+                        "value": "unsigned",
+                        "trivia": " "
+                    },
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "age",
                 "escapedName": "age",
@@ -31,10 +41,17 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "any",
-                    "extAttrs": []
+                    "baseName": "any",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "required",
                 "escapedName": "required",
diff --git a/test/syntax/json/callback.json b/test/syntax/json/callback.json
index ecc7126..5ee3035 100644
--- a/test/syntax/json/callback.json
+++ b/test/syntax/json/callback.json
@@ -5,10 +5,17 @@
         "idlType": {
             "type": "return-type",
             "generic": null,
-            "nullable": false,
+            "nullable": null,
             "union": false,
             "idlType": "void",
-            "extAttrs": []
+            "baseName": "void",
+            "prefix": null,
+            "postfix": null,
+            "separator": null,
+            "extAttrs": [],
+            "trivia": {
+                "base": " "
+            }
         },
         "arguments": [
             {
@@ -19,10 +26,17 @@
                 "idlType": {
                     "type": "argument-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "DOMString",
-                    "extAttrs": []
+                    "baseName": "DOMString",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": ""
+                    }
                 },
                 "name": "status",
                 "escapedName": "status"
@@ -45,10 +59,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "void",
-                    "extAttrs": []
+                    "baseName": "void",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n  "
+                    }
                 },
                 "name": "eventOccurred",
                 "escapedName": "eventOccurred",
@@ -61,10 +82,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "DOMString",
-                            "extAttrs": []
+                            "baseName": "DOMString",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         },
                         "name": "details",
                         "escapedName": "details"
@@ -89,10 +117,17 @@
         "idlType": {
             "type": "return-type",
             "generic": null,
-            "nullable": false,
+            "nullable": null,
             "union": false,
             "idlType": "boolean",
-            "extAttrs": []
+            "baseName": "boolean",
+            "prefix": null,
+            "postfix": null,
+            "separator": null,
+            "extAttrs": [],
+            "trivia": {
+                "base": " "
+            }
         },
         "arguments": [
             {
@@ -103,10 +138,17 @@
                 "idlType": {
                     "type": "argument-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "any",
-                    "extAttrs": []
+                    "baseName": "any",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": ""
+                    }
                 },
                 "name": "a",
                 "escapedName": "a"
@@ -119,10 +161,17 @@
                 "idlType": {
                     "type": "argument-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "any",
-                    "extAttrs": []
+                    "baseName": "any",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "b",
                 "escapedName": "b"
diff --git a/test/syntax/json/constants.json b/test/syntax/json/constants.json
index 9446673..435fa1a 100644
--- a/test/syntax/json/constants.json
+++ b/test/syntax/json/constants.json
@@ -9,10 +9,17 @@
                 "idlType": {
                     "type": "const-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "boolean",
-                    "extAttrs": []
+                    "baseName": "boolean",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "DEBUG",
                 "value": {
@@ -26,10 +33,17 @@
                 "idlType": {
                     "type": "const-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "short",
-                    "extAttrs": []
+                    "baseName": "short",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "negative",
                 "value": {
@@ -43,10 +57,17 @@
                 "idlType": {
                     "type": "const-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "octet",
-                    "extAttrs": []
+                    "baseName": "octet",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "LF",
                 "value": {
@@ -60,10 +81,20 @@
                 "idlType": {
                     "type": "const-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "unsigned long",
-                    "extAttrs": []
+                    "baseName": "long",
+                    "prefix": {
+                        "value": "unsigned",
+                        "trivia": " "
+                    },
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "BIT_MASK",
                 "value": {
@@ -77,10 +108,17 @@
                 "idlType": {
                     "type": "const-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "float",
-                    "extAttrs": []
+                    "baseName": "float",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "AVOGADRO",
                 "value": {
@@ -94,10 +132,20 @@
                 "idlType": {
                     "type": "const-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "unrestricted float",
-                    "extAttrs": []
+                    "baseName": "float",
+                    "prefix": {
+                        "value": "unrestricted",
+                        "trivia": " "
+                    },
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "sobig",
                 "value": {
@@ -111,10 +159,20 @@
                 "idlType": {
                     "type": "const-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "unrestricted double",
-                    "extAttrs": []
+                    "baseName": "double",
+                    "prefix": {
+                        "value": "unrestricted",
+                        "trivia": " "
+                    },
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "minusonedividedbyzero",
                 "value": {
@@ -128,10 +186,17 @@
                 "idlType": {
                     "type": "const-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "short",
-                    "extAttrs": []
+                    "baseName": "short",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "notanumber",
                 "value": {
diff --git a/test/syntax/json/constructor.json b/test/syntax/json/constructor.json
index 5bbc4ba..0101087 100644
--- a/test/syntax/json/constructor.json
+++ b/test/syntax/json/constructor.json
@@ -13,10 +13,17 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "float",
-                    "extAttrs": []
+                    "baseName": "float",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "r",
                 "escapedName": "r",
@@ -31,10 +38,17 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "float",
-                    "extAttrs": []
+                    "baseName": "float",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "cx",
                 "escapedName": "cx",
@@ -49,10 +63,17 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "float",
-                    "extAttrs": []
+                    "baseName": "float",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "cy",
                 "escapedName": "cy",
@@ -67,10 +88,17 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "float",
-                    "extAttrs": []
+                    "baseName": "float",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "circumference",
                 "escapedName": "circumference",
@@ -103,10 +131,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "float",
-                            "extAttrs": []
+                            "baseName": "float",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         },
                         "name": "radius",
                         "escapedName": "radius"
diff --git a/test/syntax/json/dictionary-inherits.json b/test/syntax/json/dictionary-inherits.json
index 595c35c..c1085fc 100644
--- a/test/syntax/json/dictionary-inherits.json
+++ b/test/syntax/json/dictionary-inherits.json
@@ -12,10 +12,19 @@
                 "idlType": {
                     "type": "dictionary-type",
                     "generic": null,
-                    "nullable": true,
+                    "nullable": {
+                        "trivia": ""
+                    },
                     "union": false,
                     "idlType": "DOMString",
-                    "extAttrs": []
+                    "baseName": "DOMString",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n  "
+                    }
                 },
                 "extAttrs": [],
                 "default": {
@@ -31,10 +40,19 @@
                 "idlType": {
                     "type": "dictionary-type",
                     "generic": null,
-                    "nullable": true,
+                    "nullable": {
+                        "trivia": ""
+                    },
                     "union": false,
                     "idlType": "DOMString",
-                    "extAttrs": []
+                    "baseName": "DOMString",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n  "
+                    }
                 },
                 "extAttrs": [],
                 "default": {
@@ -49,10 +67,17 @@
                 "idlType": {
                     "type": "dictionary-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "Point",
-                    "extAttrs": []
+                    "baseName": "Point",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n  "
+                    }
                 },
                 "extAttrs": [],
                 "default": null
@@ -74,10 +99,17 @@
                 "idlType": {
                     "type": "dictionary-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "float",
-                    "extAttrs": []
+                    "baseName": "float",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n  "
+                    }
                 },
                 "extAttrs": [],
                 "default": null
diff --git a/test/syntax/json/dictionary.json b/test/syntax/json/dictionary.json
index b7f28d2..9a78951 100644
--- a/test/syntax/json/dictionary.json
+++ b/test/syntax/json/dictionary.json
@@ -12,10 +12,19 @@
                 "idlType": {
                     "type": "dictionary-type",
                     "generic": null,
-                    "nullable": true,
+                    "nullable": {
+                        "trivia": ""
+                    },
                     "union": false,
                     "idlType": "DOMString",
-                    "extAttrs": []
+                    "baseName": "DOMString",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n  "
+                    }
                 },
                 "extAttrs": [],
                 "default": {
@@ -31,10 +40,19 @@
                 "idlType": {
                     "type": "dictionary-type",
                     "generic": null,
-                    "nullable": true,
+                    "nullable": {
+                        "trivia": ""
+                    },
                     "union": false,
                     "idlType": "DOMString",
-                    "extAttrs": []
+                    "baseName": "DOMString",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n  "
+                    }
                 },
                 "extAttrs": [],
                 "default": {
@@ -49,10 +67,17 @@
                 "idlType": {
                     "type": "dictionary-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "Point",
-                    "extAttrs": []
+                    "baseName": "Point",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n  "
+                    }
                 },
                 "extAttrs": [],
                 "default": null
@@ -64,20 +89,40 @@
                 "required": false,
                 "idlType": {
                     "type": "dictionary-type",
-                    "generic": "sequence",
-                    "nullable": false,
+                    "generic": {
+                        "value": "sequence",
+                        "trivia": {
+                            "open": "",
+                            "close": ""
+                        }
+                    },
+                    "nullable": null,
                     "union": false,
                     "idlType": [
                         {
                             "type": "dictionary-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "long",
-                            "extAttrs": []
+                            "baseName": "long",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         }
                     ],
-                    "extAttrs": []
+                    "baseName": "sequence",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n  // https://heycam.github.io/webidl/#dfn-optional-argument-default-value allows sequences to default to \"[]\".\n  "
+                    }
                 },
                 "extAttrs": [],
                 "default": {
@@ -93,10 +138,17 @@
                 "idlType": {
                     "type": "dictionary-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "long",
-                    "extAttrs": []
+                    "baseName": "long",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "extAttrs": [],
                 "default": null
@@ -118,10 +170,17 @@
                 "idlType": {
                     "type": "dictionary-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "long",
-                    "extAttrs": []
+                    "baseName": "long",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n  "
+                    }
                 },
                 "extAttrs": [],
                 "default": null
@@ -134,10 +193,17 @@
                 "idlType": {
                     "type": "dictionary-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "long",
-                    "extAttrs": []
+                    "baseName": "long",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n  "
+                    }
                 },
                 "extAttrs": [],
                 "default": null
diff --git a/test/syntax/json/enum.json b/test/syntax/json/enum.json
index a458f90..f09bcfa 100644
--- a/test/syntax/json/enum.json
+++ b/test/syntax/json/enum.json
@@ -32,10 +32,17 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "MealType",
-                    "extAttrs": []
+                    "baseName": "MealType",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "type",
                 "escapedName": "type",
@@ -50,10 +57,17 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "float",
-                    "extAttrs": []
+                    "baseName": "float",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "size",
                 "escapedName": "size",
@@ -69,10 +83,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "void",
-                    "extAttrs": []
+                    "baseName": "void",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "     // in grams\n\n  "
+                    }
                 },
                 "name": "initialize",
                 "escapedName": "initialize",
@@ -85,10 +106,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "MealType",
-                            "extAttrs": []
+                            "baseName": "MealType",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         },
                         "name": "type",
                         "escapedName": "type"
@@ -101,10 +129,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "float",
-                            "extAttrs": []
+                            "baseName": "float",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": " "
+                            }
                         },
                         "name": "size",
                         "escapedName": "size"
diff --git a/test/syntax/json/equivalent-decl.json b/test/syntax/json/equivalent-decl.json
index 02fd09a..3ea3edb 100644
--- a/test/syntax/json/equivalent-decl.json
+++ b/test/syntax/json/equivalent-decl.json
@@ -13,10 +13,20 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "unsigned long",
-                    "extAttrs": []
+                    "baseName": "long",
+                    "prefix": {
+                        "value": "unsigned",
+                        "trivia": " "
+                    },
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "propertyCount",
                 "escapedName": "propertyCount",
@@ -32,10 +42,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "float",
-                    "extAttrs": []
+                    "baseName": "float",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "getProperty",
                 "escapedName": "getProperty",
@@ -48,10 +65,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "DOMString",
-                            "extAttrs": []
+                            "baseName": "DOMString",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         },
                         "name": "propertyName",
                         "escapedName": "propertyName"
@@ -69,10 +93,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "void",
-                    "extAttrs": []
+                    "baseName": "void",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "setProperty",
                 "escapedName": "setProperty",
@@ -85,10 +116,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "DOMString",
-                            "extAttrs": []
+                            "baseName": "DOMString",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         },
                         "name": "propertyName",
                         "escapedName": "propertyName"
@@ -101,10 +139,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "float",
-                            "extAttrs": []
+                            "baseName": "float",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": " "
+                            }
                         },
                         "name": "propertyValue",
                         "escapedName": "propertyValue"
@@ -137,10 +182,20 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "unsigned long",
-                    "extAttrs": []
+                    "baseName": "long",
+                    "prefix": {
+                        "value": "unsigned",
+                        "trivia": " "
+                    },
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "propertyCount",
                 "escapedName": "propertyCount",
@@ -156,10 +211,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "float",
-                    "extAttrs": []
+                    "baseName": "float",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n\n  "
+                    }
                 },
                 "name": "getProperty",
                 "escapedName": "getProperty",
@@ -172,10 +234,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "DOMString",
-                            "extAttrs": []
+                            "baseName": "DOMString",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         },
                         "name": "propertyName",
                         "escapedName": "propertyName"
@@ -193,10 +262,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "void",
-                    "extAttrs": []
+                    "baseName": "void",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n  "
+                    }
                 },
                 "name": "setProperty",
                 "escapedName": "setProperty",
@@ -209,10 +285,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "DOMString",
-                            "extAttrs": []
+                            "baseName": "DOMString",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         },
                         "name": "propertyName",
                         "escapedName": "propertyName"
@@ -225,10 +308,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "float",
-                            "extAttrs": []
+                            "baseName": "float",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": " "
+                            }
                         },
                         "name": "propertyValue",
                         "escapedName": "propertyValue"
@@ -246,10 +336,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "float",
-                    "extAttrs": []
+                    "baseName": "float",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": null,
                 "escapedName": null,
@@ -262,10 +359,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "DOMString",
-                            "extAttrs": []
+                            "baseName": "DOMString",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         },
                         "name": "propertyName",
                         "escapedName": "propertyName"
@@ -283,10 +387,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "void",
-                    "extAttrs": []
+                    "baseName": "void",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": null,
                 "escapedName": null,
@@ -299,10 +410,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "DOMString",
-                            "extAttrs": []
+                            "baseName": "DOMString",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         },
                         "name": "propertyName",
                         "escapedName": "propertyName"
@@ -315,10 +433,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "float",
-                            "extAttrs": []
+                            "baseName": "float",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": " "
+                            }
                         },
                         "name": "propertyValue",
                         "escapedName": "propertyValue"
diff --git a/test/syntax/json/extended-attributes.json b/test/syntax/json/extended-attributes.json
index 95e7ae0..46a99a5 100644
--- a/test/syntax/json/extended-attributes.json
+++ b/test/syntax/json/extended-attributes.json
@@ -93,10 +93,17 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "double",
-                    "extAttrs": []
+                    "baseName": "double",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "r",
                 "escapedName": "r",
@@ -111,10 +118,17 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "double",
-                    "extAttrs": []
+                    "baseName": "double",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "cx",
                 "escapedName": "cx",
@@ -129,10 +143,17 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "double",
-                    "extAttrs": []
+                    "baseName": "double",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "cy",
                 "escapedName": "cy",
@@ -147,10 +168,17 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "double",
-                    "extAttrs": []
+                    "baseName": "double",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "circumference",
                 "escapedName": "circumference",
@@ -183,10 +211,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "double",
-                            "extAttrs": []
+                            "baseName": "double",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         },
                         "name": "radius",
                         "escapedName": "radius"
@@ -211,26 +246,47 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": true,
                     "idlType": [
                         {
                             "type": null,
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "long",
-                            "extAttrs": []
+                            "baseName": "long",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": {
+                                "value": "or",
+                                "trivia": " "
+                            },
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         },
                         {
                             "type": null,
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "Node",
-                            "extAttrs": []
+                            "baseName": "Node",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": " "
+                            }
                         }
                     ],
+                    "baseName": null,
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
                     "extAttrs": [
                         {
                             "name": "XAttr",
@@ -238,7 +294,11 @@
                             "type": "extended-attribute",
                             "rhs": null
                         }
-                    ]
+                    ],
+                    "trivia": {
+                        "open": " ",
+                        "close": ""
+                    }
                 },
                 "name": "attrib",
                 "escapedName": "attrib",
diff --git a/test/syntax/json/generic.json b/test/syntax/json/generic.json
index e817028..3810e93 100644
--- a/test/syntax/json/generic.json
+++ b/test/syntax/json/generic.json
@@ -13,38 +13,86 @@
                 "stringifier": false,
                 "idlType": {
                     "type": "return-type",
-                    "generic": "Promise",
-                    "nullable": false,
+                    "generic": {
+                        "value": "Promise",
+                        "trivia": {
+                            "open": "",
+                            "close": ""
+                        }
+                    },
+                    "nullable": null,
                     "union": false,
                     "idlType": [
                         {
                             "type": "return-type",
-                            "generic": "Promise",
-                            "nullable": false,
+                            "generic": {
+                                "value": "Promise",
+                                "trivia": {
+                                    "open": "",
+                                    "close": ""
+                                }
+                            },
+                            "nullable": null,
                             "union": false,
                             "idlType": [
                                 {
                                     "type": "return-type",
-                                    "generic": "sequence",
-                                    "nullable": false,
+                                    "generic": {
+                                        "value": "sequence",
+                                        "trivia": {
+                                            "open": "",
+                                            "close": ""
+                                        }
+                                    },
+                                    "nullable": null,
                                     "union": false,
                                     "idlType": [
                                         {
                                             "type": "return-type",
                                             "generic": null,
-                                            "nullable": true,
+                                            "nullable": {
+                                                "trivia": ""
+                                            },
                                             "union": false,
                                             "idlType": "DOMString",
-                                            "extAttrs": []
+                                            "baseName": "DOMString",
+                                            "prefix": null,
+                                            "postfix": null,
+                                            "separator": null,
+                                            "extAttrs": [],
+                                            "trivia": {
+                                                "base": ""
+                                            }
                                         }
                                     ],
-                                    "extAttrs": []
+                                    "baseName": "sequence",
+                                    "prefix": null,
+                                    "postfix": null,
+                                    "separator": null,
+                                    "extAttrs": [],
+                                    "trivia": {
+                                        "base": ""
+                                    }
                                 }
                             ],
-                            "extAttrs": []
+                            "baseName": "Promise",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         }
                     ],
-                    "extAttrs": []
+                    "baseName": "Promise",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n  "
+                    }
                 },
                 "name": "bar",
                 "escapedName": "bar",
@@ -59,20 +107,40 @@
                 "readonly": true,
                 "idlType": {
                     "type": "attribute-type",
-                    "generic": "Promise",
-                    "nullable": false,
+                    "generic": {
+                        "value": "Promise",
+                        "trivia": {
+                            "open": "",
+                            "close": ""
+                        }
+                    },
+                    "nullable": null,
                     "union": false,
                     "idlType": [
                         {
                             "type": "attribute-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "DOMString",
-                            "extAttrs": []
+                            "baseName": "DOMString",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         }
                     ],
-                    "extAttrs": []
+                    "baseName": "Promise",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "baz",
                 "escapedName": "baz",
@@ -103,20 +171,42 @@
                 "stringifier": false,
                 "idlType": {
                     "type": "return-type",
-                    "generic": "Promise",
-                    "nullable": false,
+                    "generic": {
+                        "value": "Promise",
+                        "trivia": {
+                            "open": "",
+                            "close": ""
+                        }
+                    },
+                    "nullable": null,
                     "union": false,
                     "idlType": [
                         {
                             "type": "return-type",
                             "generic": null,
-                            "nullable": true,
+                            "nullable": {
+                                "trivia": ""
+                            },
                             "union": false,
                             "idlType": "Client",
-                            "extAttrs": []
+                            "baseName": "Client",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         }
                     ],
-                    "extAttrs": []
+                    "baseName": "Promise",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n  "
+                    }
                 },
                 "name": "getServiced",
                 "escapedName": "getServiced",
@@ -132,20 +222,40 @@
                 "stringifier": false,
                 "idlType": {
                     "type": "return-type",
-                    "generic": "Promise",
-                    "nullable": false,
+                    "generic": {
+                        "value": "Promise",
+                        "trivia": {
+                            "open": "",
+                            "close": ""
+                        }
+                    },
+                    "nullable": null,
                     "union": false,
                     "idlType": [
                         {
                             "type": "return-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "any",
-                            "extAttrs": []
+                            "baseName": "any",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         }
                     ],
-                    "extAttrs": []
+                    "baseName": "Promise",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n  "
+                    }
                 },
                 "name": "reloadAll",
                 "escapedName": "reloadAll",
@@ -177,20 +287,40 @@
                 "stringifier": false,
                 "idlType": {
                     "type": "return-type",
-                    "generic": "Promise",
-                    "nullable": false,
+                    "generic": {
+                        "value": "Promise",
+                        "trivia": {
+                            "open": "",
+                            "close": ""
+                        }
+                    },
+                    "nullable": null,
                     "union": false,
                     "idlType": [
                         {
                             "type": "return-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "any",
-                            "extAttrs": []
+                            "baseName": "any",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         }
                     ],
-                    "extAttrs": []
+                    "baseName": "Promise",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n  "
+                    }
                 },
                 "name": "default",
                 "escapedName": "default",
diff --git a/test/syntax/json/getter-setter.json b/test/syntax/json/getter-setter.json
index 6538548..6f883af 100644
--- a/test/syntax/json/getter-setter.json
+++ b/test/syntax/json/getter-setter.json
@@ -13,10 +13,20 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "unsigned long",
-                    "extAttrs": []
+                    "baseName": "long",
+                    "prefix": {
+                        "value": "unsigned",
+                        "trivia": " "
+                    },
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "propertyCount",
                 "escapedName": "propertyCount",
@@ -32,10 +42,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "float",
-                    "extAttrs": []
+                    "baseName": "float",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": null,
                 "escapedName": null,
@@ -48,10 +65,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "DOMString",
-                            "extAttrs": []
+                            "baseName": "DOMString",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         },
                         "name": "propertyName",
                         "escapedName": "propertyName"
@@ -69,10 +93,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "void",
-                    "extAttrs": []
+                    "baseName": "void",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": null,
                 "escapedName": null,
@@ -85,10 +116,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "DOMString",
-                            "extAttrs": []
+                            "baseName": "DOMString",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         },
                         "name": "propertyName",
                         "escapedName": "propertyName"
@@ -101,10 +139,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "float",
-                            "extAttrs": []
+                            "baseName": "float",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": " "
+                            }
                         },
                         "name": "propertyValue",
                         "escapedName": "propertyValue"
diff --git a/test/syntax/json/identifier-qualified-names.json b/test/syntax/json/identifier-qualified-names.json
index e2cf2e2..65b984c 100644
--- a/test/syntax/json/identifier-qualified-names.json
+++ b/test/syntax/json/identifier-qualified-names.json
@@ -4,10 +4,17 @@
         "idlType": {
             "type": "typedef-type",
             "generic": null,
-            "nullable": false,
+            "nullable": null,
             "union": false,
             "idlType": "float",
-            "extAttrs": []
+            "baseName": "float",
+            "prefix": null,
+            "postfix": null,
+            "separator": null,
+            "extAttrs": [],
+            "trivia": {
+                "base": " "
+            }
         },
         "name": "number",
         "extAttrs": []
@@ -27,10 +34,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "object",
-                    "extAttrs": []
+                    "baseName": "object",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n\n    // Operation identifier:          \"createObject\"\n    // Operation argument identifier: \"interface\"\n    "
+                    }
                 },
                 "name": "createObject",
                 "escapedName": "createObject",
@@ -43,10 +57,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "DOMString",
-                            "extAttrs": []
+                            "baseName": "DOMString",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         },
                         "name": "interface",
                         "escapedName": "_interface"
@@ -64,10 +85,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "DOMString",
-                    "extAttrs": []
+                    "baseName": "DOMString",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": null,
                 "escapedName": null,
@@ -80,10 +108,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "DOMString",
-                            "extAttrs": []
+                            "baseName": "DOMString",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         },
                         "name": "keyName",
                         "escapedName": "keyName"
@@ -116,10 +151,17 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "boolean",
-                    "extAttrs": []
+                    "baseName": "boolean",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "const",
                 "escapedName": "_const",
@@ -134,10 +176,19 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": true,
+                    "nullable": {
+                        "trivia": ""
+                    },
                     "union": false,
                     "idlType": "DOMString",
-                    "extAttrs": []
+                    "baseName": "DOMString",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "value",
                 "escapedName": "_value",
@@ -169,10 +220,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "void",
-                    "extAttrs": []
+                    "baseName": "void",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n  // Argument names allow some selected keywords\n  "
+                    }
                 },
                 "name": "addEventListener",
                 "escapedName": "addEventListener",
@@ -185,10 +243,19 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": true,
+                            "nullable": {
+                                "trivia": ""
+                            },
                             "union": false,
                             "idlType": "EventListener",
-                            "extAttrs": []
+                            "baseName": "EventListener",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         },
                         "name": "callback",
                         "escapedName": "callback"
diff --git a/test/syntax/json/implements.json b/test/syntax/json/implements.json
index d02b36d..232b07e 100644
--- a/test/syntax/json/implements.json
+++ b/test/syntax/json/implements.json
@@ -13,10 +13,20 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "unsigned short",
-                    "extAttrs": []
+                    "baseName": "short",
+                    "prefix": {
+                        "value": "unsigned",
+                        "trivia": " "
+                    },
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "nodeType",
                 "escapedName": "nodeType",
@@ -48,10 +58,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "void",
-                    "extAttrs": []
+                    "baseName": "void",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n    "
+                    }
                 },
                 "name": "addEventListener",
                 "escapedName": "addEventListener",
@@ -64,10 +81,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "DOMString",
-                            "extAttrs": []
+                            "baseName": "DOMString",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         },
                         "name": "type",
                         "escapedName": "type"
@@ -80,10 +104,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "EventListener",
-                            "extAttrs": []
+                            "baseName": "EventListener",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": "\n                          "
+                            }
                         },
                         "name": "listener",
                         "escapedName": "listener"
@@ -96,10 +127,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "boolean",
-                            "extAttrs": []
+                            "baseName": "boolean",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": "\n                          "
+                            }
                         },
                         "name": "useCapture",
                         "escapedName": "useCapture"
diff --git a/test/syntax/json/indexed-properties.json b/test/syntax/json/indexed-properties.json
index cf81149..f976419 100644
--- a/test/syntax/json/indexed-properties.json
+++ b/test/syntax/json/indexed-properties.json
@@ -13,10 +13,20 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "unsigned long",
-                    "extAttrs": []
+                    "baseName": "long",
+                    "prefix": {
+                        "value": "unsigned",
+                        "trivia": " "
+                    },
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "size",
                 "escapedName": "size",
@@ -32,10 +42,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "any",
-                    "extAttrs": []
+                    "baseName": "any",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "getByIndex",
                 "escapedName": "getByIndex",
@@ -48,10 +65,20 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "unsigned long",
-                            "extAttrs": []
+                            "baseName": "long",
+                            "prefix": {
+                                "value": "unsigned",
+                                "trivia": ""
+                            },
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": " "
+                            }
                         },
                         "name": "index",
                         "escapedName": "index"
@@ -69,10 +96,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "void",
-                    "extAttrs": []
+                    "baseName": "void",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "setByIndex",
                 "escapedName": "setByIndex",
@@ -85,10 +119,20 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "unsigned long",
-                            "extAttrs": []
+                            "baseName": "long",
+                            "prefix": {
+                                "value": "unsigned",
+                                "trivia": ""
+                            },
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": " "
+                            }
                         },
                         "name": "index",
                         "escapedName": "index"
@@ -101,10 +145,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "any",
-                            "extAttrs": []
+                            "baseName": "any",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": " "
+                            }
                         },
                         "name": "value",
                         "escapedName": "value"
@@ -122,10 +173,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "void",
-                    "extAttrs": []
+                    "baseName": "void",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "removeByIndex",
                 "escapedName": "removeByIndex",
@@ -138,10 +196,20 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "unsigned long",
-                            "extAttrs": []
+                            "baseName": "long",
+                            "prefix": {
+                                "value": "unsigned",
+                                "trivia": ""
+                            },
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": " "
+                            }
                         },
                         "name": "index",
                         "escapedName": "index"
@@ -159,10 +227,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "any",
-                    "extAttrs": []
+                    "baseName": "any",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "get",
                 "escapedName": "get",
@@ -175,10 +250,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "DOMString",
-                            "extAttrs": []
+                            "baseName": "DOMString",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         },
                         "name": "name",
                         "escapedName": "name"
@@ -196,10 +278,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "void",
-                    "extAttrs": []
+                    "baseName": "void",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "set",
                 "escapedName": "set",
@@ -212,10 +301,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "DOMString",
-                            "extAttrs": []
+                            "baseName": "DOMString",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         },
                         "name": "name",
                         "escapedName": "name"
@@ -228,10 +324,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "any",
-                            "extAttrs": []
+                            "baseName": "any",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": " "
+                            }
                         },
                         "name": "value",
                         "escapedName": "value"
@@ -249,10 +352,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "void",
-                    "extAttrs": []
+                    "baseName": "void",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "remove",
                 "escapedName": "remove",
@@ -265,10 +375,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "DOMString",
-                            "extAttrs": []
+                            "baseName": "DOMString",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         },
                         "name": "name",
                         "escapedName": "name"
diff --git a/test/syntax/json/inherits-getter.json b/test/syntax/json/inherits-getter.json
index 2ee2ba9..4d38240 100644
--- a/test/syntax/json/inherits-getter.json
+++ b/test/syntax/json/inherits-getter.json
@@ -13,10 +13,17 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "DOMString",
-                    "extAttrs": []
+                    "baseName": "DOMString",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "name",
                 "escapedName": "name",
@@ -47,10 +54,20 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "unsigned short",
-                    "extAttrs": []
+                    "baseName": "short",
+                    "prefix": {
+                        "value": "unsigned",
+                        "trivia": " "
+                    },
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "age",
                 "escapedName": "age",
@@ -65,10 +82,17 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "DOMString",
-                    "extAttrs": []
+                    "baseName": "DOMString",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "name",
                 "escapedName": "name",
@@ -99,10 +123,17 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "DOMString",
-                    "extAttrs": []
+                    "baseName": "DOMString",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "name",
                 "escapedName": "name",
diff --git a/test/syntax/json/interface-inherits.json b/test/syntax/json/interface-inherits.json
index 015e827..010abe7 100644
--- a/test/syntax/json/interface-inherits.json
+++ b/test/syntax/json/interface-inherits.json
@@ -13,10 +13,17 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "DOMString",
-                    "extAttrs": []
+                    "baseName": "DOMString",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "name",
                 "escapedName": "name",
@@ -47,10 +54,17 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "Dog",
-                    "extAttrs": []
+                    "baseName": "Dog",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "pet",
                 "escapedName": "pet",
@@ -81,10 +95,17 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "Human",
-                    "extAttrs": []
+                    "baseName": "Human",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "owner",
                 "escapedName": "owner",
diff --git a/test/syntax/json/iterable.json b/test/syntax/json/iterable.json
index 654abd4..1688b34 100644
--- a/test/syntax/json/iterable.json
+++ b/test/syntax/json/iterable.json
@@ -10,10 +10,17 @@
                     {
                         "type": null,
                         "generic": null,
-                        "nullable": false,
+                        "nullable": null,
                         "union": false,
                         "idlType": "long",
-                        "extAttrs": []
+                        "baseName": "long",
+                        "prefix": null,
+                        "postfix": null,
+                        "separator": null,
+                        "extAttrs": [],
+                        "trivia": {
+                            "base": ""
+                        }
                     }
                 ],
                 "extAttrs": []
@@ -40,18 +47,34 @@
                     {
                         "type": null,
                         "generic": null,
-                        "nullable": false,
+                        "nullable": null,
                         "union": false,
                         "idlType": "short",
-                        "extAttrs": []
+                        "baseName": "short",
+                        "prefix": null,
+                        "postfix": null,
+                        "separator": null,
+                        "extAttrs": [],
+                        "trivia": {
+                            "base": ""
+                        }
                     },
                     {
                         "type": null,
                         "generic": null,
-                        "nullable": true,
+                        "nullable": {
+                            "trivia": ""
+                        },
                         "union": false,
                         "idlType": "double",
-                        "extAttrs": []
+                        "baseName": "double",
+                        "prefix": null,
+                        "postfix": null,
+                        "separator": null,
+                        "extAttrs": [],
+                        "trivia": {
+                            "base": " "
+                        }
                     }
                 ],
                 "extAttrs": []
@@ -78,9 +101,13 @@
                     {
                         "type": null,
                         "generic": null,
-                        "nullable": false,
+                        "nullable": null,
                         "union": false,
                         "idlType": "long",
+                        "baseName": "long",
+                        "prefix": null,
+                        "postfix": null,
+                        "separator": null,
                         "extAttrs": [
                             {
                                 "name": "XAttr",
@@ -88,7 +115,10 @@
                                 "type": "extended-attribute",
                                 "rhs": null
                             }
-                        ]
+                        ],
+                        "trivia": {
+                            "base": " "
+                        }
                     }
                 ],
                 "extAttrs": []
diff --git a/test/syntax/json/legacyiterable.json b/test/syntax/json/legacyiterable.json
index 116ae6a..c3d3273 100644
--- a/test/syntax/json/legacyiterable.json
+++ b/test/syntax/json/legacyiterable.json
@@ -10,10 +10,17 @@
                     {
                         "type": null,
                         "generic": null,
-                        "nullable": false,
+                        "nullable": null,
                         "union": false,
                         "idlType": "long",
-                        "extAttrs": []
+                        "baseName": "long",
+                        "prefix": null,
+                        "postfix": null,
+                        "separator": null,
+                        "extAttrs": [],
+                        "trivia": {
+                            "base": ""
+                        }
                     }
                 ],
                 "extAttrs": []
diff --git a/test/syntax/json/maplike.json b/test/syntax/json/maplike.json
index ac8fdea..1ee6138 100644
--- a/test/syntax/json/maplike.json
+++ b/test/syntax/json/maplike.json
@@ -10,18 +10,32 @@
                     {
                         "type": null,
                         "generic": null,
-                        "nullable": false,
+                        "nullable": null,
                         "union": false,
                         "idlType": "long",
-                        "extAttrs": []
+                        "baseName": "long",
+                        "prefix": null,
+                        "postfix": null,
+                        "separator": null,
+                        "extAttrs": [],
+                        "trivia": {
+                            "base": ""
+                        }
                     },
                     {
                         "type": null,
                         "generic": null,
-                        "nullable": false,
+                        "nullable": null,
                         "union": false,
                         "idlType": "float",
-                        "extAttrs": []
+                        "baseName": "float",
+                        "prefix": null,
+                        "postfix": null,
+                        "separator": null,
+                        "extAttrs": [],
+                        "trivia": {
+                            "base": " "
+                        }
                     }
                 ],
                 "readonly": false,
@@ -49,18 +63,32 @@
                     {
                         "type": null,
                         "generic": null,
-                        "nullable": false,
+                        "nullable": null,
                         "union": false,
                         "idlType": "long",
-                        "extAttrs": []
+                        "baseName": "long",
+                        "prefix": null,
+                        "postfix": null,
+                        "separator": null,
+                        "extAttrs": [],
+                        "trivia": {
+                            "base": ""
+                        }
                     },
                     {
                         "type": null,
                         "generic": null,
-                        "nullable": false,
+                        "nullable": null,
                         "union": false,
                         "idlType": "float",
-                        "extAttrs": []
+                        "baseName": "float",
+                        "prefix": null,
+                        "postfix": null,
+                        "separator": null,
+                        "extAttrs": [],
+                        "trivia": {
+                            "base": " "
+                        }
                     }
                 ],
                 "readonly": true,
@@ -88,9 +116,13 @@
                     {
                         "type": null,
                         "generic": null,
-                        "nullable": false,
+                        "nullable": null,
                         "union": false,
                         "idlType": "DOMString",
+                        "baseName": "DOMString",
+                        "prefix": null,
+                        "postfix": null,
+                        "separator": null,
                         "extAttrs": [
                             {
                                 "name": "XAttr2",
@@ -98,14 +130,21 @@
                                 "type": "extended-attribute",
                                 "rhs": null
                             }
-                        ]
+                        ],
+                        "trivia": {
+                            "base": " "
+                        }
                     },
                     {
                         "type": null,
                         "generic": null,
-                        "nullable": false,
+                        "nullable": null,
                         "union": false,
                         "idlType": "long",
+                        "baseName": "long",
+                        "prefix": null,
+                        "postfix": null,
+                        "separator": null,
                         "extAttrs": [
                             {
                                 "name": "XAttr3",
@@ -113,7 +152,10 @@
                                 "type": "extended-attribute",
                                 "rhs": null
                             }
-                        ]
+                        ],
+                        "trivia": {
+                            "base": " "
+                        }
                     }
                 ],
                 "readonly": false,
diff --git a/test/syntax/json/mixin.json b/test/syntax/json/mixin.json
index d12852b..5cab795 100644
--- a/test/syntax/json/mixin.json
+++ b/test/syntax/json/mixin.json
@@ -13,10 +13,17 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "Crypto",
-                    "extAttrs": []
+                    "baseName": "Crypto",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "crypto",
                 "escapedName": "crypto",
@@ -55,10 +62,17 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "Crypto",
-                    "extAttrs": []
+                    "baseName": "Crypto",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "crypto",
                 "escapedName": "crypto",
diff --git a/test/syntax/json/namedconstructor.json b/test/syntax/json/namedconstructor.json
index 65820f0..93d2214 100644
--- a/test/syntax/json/namedconstructor.json
+++ b/test/syntax/json/namedconstructor.json
@@ -33,10 +33,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "DOMString",
-                            "extAttrs": []
+                            "baseName": "DOMString",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         },
                         "name": "src",
                         "escapedName": "src"
diff --git a/test/syntax/json/namespace.json b/test/syntax/json/namespace.json
index 9e37b26..b5bf8ec 100644
--- a/test/syntax/json/namespace.json
+++ b/test/syntax/json/namespace.json
@@ -13,10 +13,17 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "Vector",
-                    "extAttrs": []
+                    "baseName": "Vector",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "unit",
                 "escapedName": "unit",
@@ -32,10 +39,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "double",
-                    "extAttrs": []
+                    "baseName": "double",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n  "
+                    }
                 },
                 "name": "dotProduct",
                 "escapedName": "dotProduct",
@@ -48,10 +62,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "Vector",
-                            "extAttrs": []
+                            "baseName": "Vector",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         },
                         "name": "x",
                         "escapedName": "x"
@@ -64,10 +85,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "Vector",
-                            "extAttrs": []
+                            "baseName": "Vector",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": " "
+                            }
                         },
                         "name": "y",
                         "escapedName": "y"
@@ -85,10 +113,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "Vector",
-                    "extAttrs": []
+                    "baseName": "Vector",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n  "
+                    }
                 },
                 "name": "crossProduct",
                 "escapedName": "crossProduct",
@@ -101,10 +136,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "Vector",
-                            "extAttrs": []
+                            "baseName": "Vector",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         },
                         "name": "x",
                         "escapedName": "x"
@@ -117,10 +159,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "Vector",
-                            "extAttrs": []
+                            "baseName": "Vector",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": " "
+                            }
                         },
                         "name": "y",
                         "escapedName": "y"
diff --git a/test/syntax/json/nointerfaceobject.json b/test/syntax/json/nointerfaceobject.json
index 09f772c..e485ef2 100644
--- a/test/syntax/json/nointerfaceobject.json
+++ b/test/syntax/json/nointerfaceobject.json
@@ -14,10 +14,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "any",
-                    "extAttrs": []
+                    "baseName": "any",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n  "
+                    }
                 },
                 "name": "lookupEntry",
                 "escapedName": "lookupEntry",
@@ -30,10 +37,20 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "unsigned long",
-                            "extAttrs": []
+                            "baseName": "long",
+                            "prefix": {
+                                "value": "unsigned",
+                                "trivia": ""
+                            },
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": " "
+                            }
                         },
                         "name": "key",
                         "escapedName": "key"
diff --git a/test/syntax/json/nullable.json b/test/syntax/json/nullable.json
index 6745a26..f7bc318 100644
--- a/test/syntax/json/nullable.json
+++ b/test/syntax/json/nullable.json
@@ -9,10 +9,19 @@
                 "idlType": {
                     "type": "const-type",
                     "generic": null,
-                    "nullable": true,
+                    "nullable": {
+                        "trivia": ""
+                    },
                     "union": false,
                     "idlType": "boolean",
-                    "extAttrs": []
+                    "baseName": "boolean",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "ARE_WE_THERE_YET",
                 "value": {
@@ -46,10 +55,19 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": true,
+                    "nullable": {
+                        "trivia": ""
+                    },
                     "union": false,
                     "idlType": "DOMString",
-                    "extAttrs": []
+                    "baseName": "DOMString",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "namespaceURI",
                 "escapedName": "namespaceURI",
diff --git a/test/syntax/json/nullableobjects.json b/test/syntax/json/nullableobjects.json
index 56e5fbc..db6bb89 100644
--- a/test/syntax/json/nullableobjects.json
+++ b/test/syntax/json/nullableobjects.json
@@ -44,10 +44,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "void",
-                    "extAttrs": []
+                    "baseName": "void",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n  "
+                    }
                 },
                 "name": "f",
                 "escapedName": "f",
@@ -60,10 +67,19 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": true,
+                            "nullable": {
+                                "trivia": ""
+                            },
                             "union": false,
                             "idlType": "A",
-                            "extAttrs": []
+                            "baseName": "A",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         },
                         "name": "x",
                         "escapedName": "x"
@@ -81,10 +97,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "void",
-                    "extAttrs": []
+                    "baseName": "void",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n  "
+                    }
                 },
                 "name": "f",
                 "escapedName": "f",
@@ -97,10 +120,19 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": true,
+                            "nullable": {
+                                "trivia": ""
+                            },
                             "union": false,
                             "idlType": "B",
-                            "extAttrs": []
+                            "baseName": "B",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         },
                         "name": "x",
                         "escapedName": "x"
diff --git a/test/syntax/json/operation-optional-arg.json b/test/syntax/json/operation-optional-arg.json
index 2bf81b4..fdbd672 100644
--- a/test/syntax/json/operation-optional-arg.json
+++ b/test/syntax/json/operation-optional-arg.json
@@ -14,10 +14,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "object",
-                    "extAttrs": []
+                    "baseName": "object",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n  "
+                    }
                 },
                 "name": "createColor",
                 "escapedName": "createColor",
@@ -30,10 +37,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "float",
-                            "extAttrs": []
+                            "baseName": "float",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         },
                         "name": "v1",
                         "escapedName": "v1"
@@ -46,10 +60,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "float",
-                            "extAttrs": []
+                            "baseName": "float",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": " "
+                            }
                         },
                         "name": "v2",
                         "escapedName": "v2"
@@ -62,10 +83,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "float",
-                            "extAttrs": []
+                            "baseName": "float",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": " "
+                            }
                         },
                         "name": "v3",
                         "escapedName": "v3"
@@ -81,10 +109,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "float",
-                            "extAttrs": []
+                            "baseName": "float",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": " "
+                            }
                         },
                         "name": "alpha",
                         "escapedName": "alpha"
diff --git a/test/syntax/json/overloading.json b/test/syntax/json/overloading.json
index fe0a21a..6de371d 100644
--- a/test/syntax/json/overloading.json
+++ b/test/syntax/json/overloading.json
@@ -44,10 +44,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "void",
-                    "extAttrs": []
+                    "baseName": "void",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n  "
+                    }
                 },
                 "name": "f",
                 "escapedName": "f",
@@ -60,10 +67,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "A",
-                            "extAttrs": []
+                            "baseName": "A",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         },
                         "name": "x",
                         "escapedName": "x"
@@ -81,10 +95,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "void",
-                    "extAttrs": []
+                    "baseName": "void",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n  "
+                    }
                 },
                 "name": "f",
                 "escapedName": "f",
@@ -97,10 +118,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "B",
-                            "extAttrs": []
+                            "baseName": "B",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         },
                         "name": "x",
                         "escapedName": "x"
@@ -134,10 +162,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "void",
-                    "extAttrs": []
+                    "baseName": "void",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n  /* f1 */ "
+                    }
                 },
                 "name": "f",
                 "escapedName": "f",
@@ -150,10 +185,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "DOMString",
-                            "extAttrs": []
+                            "baseName": "DOMString",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         },
                         "name": "a",
                         "escapedName": "a"
@@ -171,10 +213,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "void",
-                    "extAttrs": []
+                    "baseName": "void",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n  /* f2 */ "
+                    }
                 },
                 "name": "f",
                 "escapedName": "f",
@@ -194,10 +243,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "DOMString",
-                            "extAttrs": []
+                            "baseName": "DOMString",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": " "
+                            }
                         },
                         "name": "a",
                         "escapedName": "a"
@@ -210,10 +266,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "DOMString",
-                            "extAttrs": []
+                            "baseName": "DOMString",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": " "
+                            }
                         },
                         "name": "b",
                         "escapedName": "b"
@@ -226,10 +289,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "float",
-                            "extAttrs": []
+                            "baseName": "float",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": " "
+                            }
                         },
                         "name": "c",
                         "escapedName": "c"
@@ -247,10 +317,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "void",
-                    "extAttrs": []
+                    "baseName": "void",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n  /* f3 */ "
+                    }
                 },
                 "name": "f",
                 "escapedName": "f",
@@ -267,10 +344,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "void",
-                    "extAttrs": []
+                    "baseName": "void",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n  /* f4 */ "
+                    }
                 },
                 "name": "f",
                 "escapedName": "f",
@@ -283,10 +367,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "long",
-                            "extAttrs": []
+                            "baseName": "long",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         },
                         "name": "a",
                         "escapedName": "a"
@@ -299,10 +390,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "DOMString",
-                            "extAttrs": []
+                            "baseName": "DOMString",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": " "
+                            }
                         },
                         "name": "b",
                         "escapedName": "b"
@@ -315,10 +413,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "DOMString",
-                            "extAttrs": []
+                            "baseName": "DOMString",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": " "
+                            }
                         },
                         "name": "c",
                         "escapedName": "c"
@@ -331,10 +436,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "float",
-                            "extAttrs": []
+                            "baseName": "float",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": " "
+                            }
                         },
                         "name": "d",
                         "escapedName": "d"
diff --git a/test/syntax/json/overridebuiltins.json b/test/syntax/json/overridebuiltins.json
index b24df86..ac466ea 100644
--- a/test/syntax/json/overridebuiltins.json
+++ b/test/syntax/json/overridebuiltins.json
@@ -13,10 +13,20 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "unsigned long",
-                    "extAttrs": []
+                    "baseName": "long",
+                    "prefix": {
+                        "value": "unsigned",
+                        "trivia": " "
+                    },
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "length",
                 "escapedName": "length",
@@ -32,10 +42,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "DOMString",
-                    "extAttrs": []
+                    "baseName": "DOMString",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "lookup",
                 "escapedName": "lookup",
@@ -48,10 +65,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "DOMString",
-                            "extAttrs": []
+                            "baseName": "DOMString",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         },
                         "name": "key",
                         "escapedName": "key"
diff --git a/test/syntax/json/partial-interface.json b/test/syntax/json/partial-interface.json
index f11bdbf..912228a 100644
--- a/test/syntax/json/partial-interface.json
+++ b/test/syntax/json/partial-interface.json
@@ -13,10 +13,17 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "DOMString",
-                    "extAttrs": []
+                    "baseName": "DOMString",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "bar",
                 "escapedName": "bar",
@@ -47,10 +54,17 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "DOMString",
-                    "extAttrs": []
+                    "baseName": "DOMString",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "quux",
                 "escapedName": "quux",
diff --git a/test/syntax/json/primitives.json b/test/syntax/json/primitives.json
index 3221b17..022e6bf 100644
--- a/test/syntax/json/primitives.json
+++ b/test/syntax/json/primitives.json
@@ -13,10 +13,17 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "boolean",
-                    "extAttrs": []
+                    "baseName": "boolean",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "truth",
                 "escapedName": "truth",
@@ -31,10 +38,17 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "byte",
-                    "extAttrs": []
+                    "baseName": "byte",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "character",
                 "escapedName": "character",
@@ -49,10 +63,17 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "octet",
-                    "extAttrs": []
+                    "baseName": "octet",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "value",
                 "escapedName": "value",
@@ -67,10 +88,17 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "short",
-                    "extAttrs": []
+                    "baseName": "short",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "number",
                 "escapedName": "number",
@@ -85,10 +113,20 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "unsigned short",
-                    "extAttrs": []
+                    "baseName": "short",
+                    "prefix": {
+                        "value": "unsigned",
+                        "trivia": " "
+                    },
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "positive",
                 "escapedName": "positive",
@@ -103,10 +141,17 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "long",
-                    "extAttrs": []
+                    "baseName": "long",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "big",
                 "escapedName": "big",
@@ -121,10 +166,20 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "unsigned long",
-                    "extAttrs": []
+                    "baseName": "long",
+                    "prefix": {
+                        "value": "unsigned",
+                        "trivia": " "
+                    },
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "bigpositive",
                 "escapedName": "bigpositive",
@@ -139,10 +194,20 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "long long",
-                    "extAttrs": []
+                    "baseName": "long",
+                    "prefix": null,
+                    "postfix": {
+                        "value": "long",
+                        "trivia": " "
+                    },
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "bigbig",
                 "escapedName": "bigbig",
@@ -157,10 +222,23 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "unsigned long long",
-                    "extAttrs": []
+                    "baseName": "long",
+                    "prefix": {
+                        "value": "unsigned",
+                        "trivia": "  "
+                    },
+                    "postfix": {
+                        "value": "long",
+                        "trivia": " "
+                    },
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "bigbigpositive",
                 "escapedName": "bigbigpositive",
@@ -175,10 +253,17 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "float",
-                    "extAttrs": []
+                    "baseName": "float",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "real",
                 "escapedName": "real",
@@ -193,10 +278,17 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "double",
-                    "extAttrs": []
+                    "baseName": "double",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "bigreal",
                 "escapedName": "bigreal",
@@ -211,10 +303,20 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "unrestricted float",
-                    "extAttrs": []
+                    "baseName": "float",
+                    "prefix": {
+                        "value": "unrestricted",
+                        "trivia": " "
+                    },
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "realwithinfinity",
                 "escapedName": "realwithinfinity",
@@ -229,10 +331,20 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "unrestricted double",
-                    "extAttrs": []
+                    "baseName": "double",
+                    "prefix": {
+                        "value": "unrestricted",
+                        "trivia": " "
+                    },
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "bigrealwithinfinity",
                 "escapedName": "bigrealwithinfinity",
@@ -247,10 +359,17 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "DOMString",
-                    "extAttrs": []
+                    "baseName": "DOMString",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "string",
                 "escapedName": "string",
@@ -265,10 +384,17 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "ByteString",
-                    "extAttrs": []
+                    "baseName": "ByteString",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "bytes",
                 "escapedName": "bytes",
@@ -283,10 +409,17 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "Date",
-                    "extAttrs": []
+                    "baseName": "Date",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "date",
                 "escapedName": "date",
@@ -301,10 +434,17 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "RegExp",
-                    "extAttrs": []
+                    "baseName": "RegExp",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "regexp",
                 "escapedName": "regexp",
diff --git a/test/syntax/json/promise-void.json b/test/syntax/json/promise-void.json
index e071f22..7826f9a 100644
--- a/test/syntax/json/promise-void.json
+++ b/test/syntax/json/promise-void.json
@@ -12,20 +12,40 @@
                 "readonly": false,
                 "idlType": {
                     "type": "attribute-type",
-                    "generic": "Promise",
-                    "nullable": false,
+                    "generic": {
+                        "value": "Promise",
+                        "trivia": {
+                            "open": "",
+                            "close": ""
+                        }
+                    },
+                    "nullable": null,
                     "union": false,
                     "idlType": [
                         {
                             "type": "return-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "void",
-                            "extAttrs": []
+                            "baseName": "void",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         }
                     ],
-                    "extAttrs": []
+                    "baseName": "Promise",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "meow",
                 "escapedName": "meow",
diff --git a/test/syntax/json/prototyperoot.json b/test/syntax/json/prototyperoot.json
index 89c7f1a..848b878 100644
--- a/test/syntax/json/prototyperoot.json
+++ b/test/syntax/json/prototyperoot.json
@@ -13,10 +13,20 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "unsigned short",
-                    "extAttrs": []
+                    "baseName": "short",
+                    "prefix": {
+                        "value": "unsigned",
+                        "trivia": " "
+                    },
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "nodeType",
                 "escapedName": "nodeType",
diff --git a/test/syntax/json/putforwards.json b/test/syntax/json/putforwards.json
index 25f2a0e..b8cca8f 100644
--- a/test/syntax/json/putforwards.json
+++ b/test/syntax/json/putforwards.json
@@ -13,10 +13,17 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "Name",
-                    "extAttrs": []
+                    "baseName": "Name",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "name",
                 "escapedName": "name",
@@ -41,10 +48,20 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "unsigned short",
-                    "extAttrs": []
+                    "baseName": "short",
+                    "prefix": {
+                        "value": "unsigned",
+                        "trivia": " "
+                    },
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "age",
                 "escapedName": "age",
diff --git a/test/syntax/json/record.json b/test/syntax/json/record.json
index 9657aaf..ec51e9c 100644
--- a/test/syntax/json/record.json
+++ b/test/syntax/json/record.json
@@ -14,10 +14,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "void",
-                    "extAttrs": []
+                    "baseName": "void",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n  "
+                    }
                 },
                 "name": "foo",
                 "escapedName": "foo",
@@ -29,37 +36,80 @@
                         "extAttrs": [],
                         "idlType": {
                             "type": "argument-type",
-                            "generic": "sequence",
-                            "nullable": false,
+                            "generic": {
+                                "value": "sequence",
+                                "trivia": {
+                                    "open": "",
+                                    "close": ""
+                                }
+                            },
+                            "nullable": null,
                             "union": false,
                             "idlType": [
                                 {
                                     "type": "argument-type",
-                                    "generic": "record",
-                                    "nullable": false,
+                                    "generic": {
+                                        "value": "record",
+                                        "trivia": {
+                                            "open": "",
+                                            "close": ""
+                                        }
+                                    },
+                                    "nullable": null,
                                     "union": false,
                                     "idlType": [
                                         {
                                             "type": "argument-type",
                                             "generic": null,
-                                            "nullable": false,
+                                            "nullable": null,
                                             "union": false,
                                             "idlType": "ByteString",
-                                            "extAttrs": []
+                                            "baseName": "ByteString",
+                                            "prefix": null,
+                                            "postfix": null,
+                                            "separator": {
+                                                "value": ",",
+                                                "trivia": ""
+                                            },
+                                            "extAttrs": [],
+                                            "trivia": {
+                                                "base": ""
+                                            }
                                         },
                                         {
                                             "type": "argument-type",
                                             "generic": null,
-                                            "nullable": false,
+                                            "nullable": null,
                                             "union": false,
                                             "idlType": "any",
-                                            "extAttrs": []
+                                            "baseName": "any",
+                                            "prefix": null,
+                                            "postfix": null,
+                                            "separator": null,
+                                            "extAttrs": [],
+                                            "trivia": {
+                                                "base": " "
+                                            }
                                         }
                                     ],
-                                    "extAttrs": []
+                                    "baseName": "record",
+                                    "prefix": null,
+                                    "postfix": null,
+                                    "separator": null,
+                                    "extAttrs": [],
+                                    "trivia": {
+                                        "base": ""
+                                    }
                                 }
                             ],
-                            "extAttrs": []
+                            "baseName": "sequence",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         },
                         "name": "param",
                         "escapedName": "param"
@@ -76,45 +126,95 @@
                 "stringifier": false,
                 "idlType": {
                     "type": "return-type",
-                    "generic": "record",
-                    "nullable": false,
+                    "generic": {
+                        "value": "record",
+                        "trivia": {
+                            "open": "",
+                            "close": ""
+                        }
+                    },
+                    "nullable": null,
                     "union": false,
                     "idlType": [
                         {
                             "type": "return-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "DOMString",
-                            "extAttrs": []
+                            "baseName": "DOMString",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": {
+                                "value": ",",
+                                "trivia": ""
+                            },
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         },
                         {
                             "type": "return-type",
                             "generic": null,
-                            "nullable": true,
+                            "nullable": {
+                                "trivia": ""
+                            },
                             "union": true,
                             "idlType": [
                                 {
                                     "type": null,
                                     "generic": null,
-                                    "nullable": false,
+                                    "nullable": null,
                                     "union": false,
                                     "idlType": "float",
-                                    "extAttrs": []
+                                    "baseName": "float",
+                                    "prefix": null,
+                                    "postfix": null,
+                                    "separator": {
+                                        "value": "or",
+                                        "trivia": " "
+                                    },
+                                    "extAttrs": [],
+                                    "trivia": {
+                                        "base": ""
+                                    }
                                 },
                                 {
                                     "type": null,
                                     "generic": null,
-                                    "nullable": false,
+                                    "nullable": null,
                                     "union": false,
                                     "idlType": "DOMString",
-                                    "extAttrs": []
+                                    "baseName": "DOMString",
+                                    "prefix": null,
+                                    "postfix": null,
+                                    "separator": null,
+                                    "extAttrs": [],
+                                    "trivia": {
+                                        "base": " "
+                                    }
                                 }
                             ],
-                            "extAttrs": []
+                            "baseName": null,
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "open": " ",
+                                "close": ""
+                            }
                         }
                     ],
-                    "extAttrs": []
+                    "baseName": "record",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n  "
+                    }
                 },
                 "name": "bar",
                 "escapedName": "bar",
@@ -141,28 +241,58 @@
                         "extAttrs": [],
                         "idlType": {
                             "type": "argument-type",
-                            "generic": "record",
-                            "nullable": false,
+                            "generic": {
+                                "value": "record",
+                                "trivia": {
+                                    "open": "",
+                                    "close": ""
+                                }
+                            },
+                            "nullable": null,
                             "union": false,
                             "idlType": [
                                 {
                                     "type": "argument-type",
                                     "generic": null,
-                                    "nullable": false,
+                                    "nullable": null,
                                     "union": false,
                                     "idlType": "USVString",
-                                    "extAttrs": []
+                                    "baseName": "USVString",
+                                    "prefix": null,
+                                    "postfix": null,
+                                    "separator": {
+                                        "value": ",",
+                                        "trivia": ""
+                                    },
+                                    "extAttrs": [],
+                                    "trivia": {
+                                        "base": ""
+                                    }
                                 },
                                 {
                                     "type": "argument-type",
                                     "generic": null,
-                                    "nullable": false,
+                                    "nullable": null,
                                     "union": false,
                                     "idlType": "USVString",
-                                    "extAttrs": []
+                                    "baseName": "USVString",
+                                    "prefix": null,
+                                    "postfix": null,
+                                    "separator": null,
+                                    "extAttrs": [],
+                                    "trivia": {
+                                        "base": " "
+                                    }
                                 }
                             ],
-                            "extAttrs": []
+                            "baseName": "record",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         },
                         "name": "init",
                         "escapedName": "init"
@@ -187,24 +317,44 @@
                 "stringifier": false,
                 "idlType": {
                     "type": "return-type",
-                    "generic": "record",
-                    "nullable": false,
+                    "generic": {
+                        "value": "record",
+                        "trivia": {
+                            "open": "",
+                            "close": ""
+                        }
+                    },
+                    "nullable": null,
                     "union": false,
                     "idlType": [
                         {
                             "type": "return-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "DOMString",
-                            "extAttrs": []
+                            "baseName": "DOMString",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": {
+                                "value": ",",
+                                "trivia": ""
+                            },
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         },
                         {
                             "type": "return-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "float",
+                            "baseName": "float",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
                             "extAttrs": [
                                 {
                                     "name": "XAttr",
@@ -212,10 +362,20 @@
                                     "type": "extended-attribute",
                                     "rhs": null
                                 }
-                            ]
+                            ],
+                            "trivia": {
+                                "base": " "
+                            }
                         }
                     ],
-                    "extAttrs": []
+                    "baseName": "record",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n  "
+                    }
                 },
                 "name": "bar",
                 "escapedName": "bar",
diff --git a/test/syntax/json/reg-operations.json b/test/syntax/json/reg-operations.json
index dee4e24..f85c4ec 100644
--- a/test/syntax/json/reg-operations.json
+++ b/test/syntax/json/reg-operations.json
@@ -13,10 +13,20 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "unsigned long",
-                    "extAttrs": []
+                    "baseName": "long",
+                    "prefix": {
+                        "value": "unsigned",
+                        "trivia": " "
+                    },
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "width",
                 "escapedName": "width",
@@ -31,10 +41,20 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "unsigned long",
-                    "extAttrs": []
+                    "baseName": "long",
+                    "prefix": {
+                        "value": "unsigned",
+                        "trivia": " "
+                    },
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "height",
                 "escapedName": "height",
@@ -66,10 +86,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "boolean",
-                    "extAttrs": []
+                    "baseName": "boolean",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n\n  // An operation that takes no arguments, returns a boolean\n  "
+                    }
                 },
                 "name": "isMouseOver",
                 "escapedName": "isMouseOver",
@@ -86,10 +113,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "void",
-                    "extAttrs": []
+                    "baseName": "void",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n\n  // Overloaded operations.\n  "
+                    }
                 },
                 "name": "setDimensions",
                 "escapedName": "setDimensions",
@@ -102,10 +136,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "Dimensions",
-                            "extAttrs": []
+                            "baseName": "Dimensions",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         },
                         "name": "size",
                         "escapedName": "size"
@@ -123,10 +164,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "void",
-                    "extAttrs": []
+                    "baseName": "void",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n  "
+                    }
                 },
                 "name": "setDimensions",
                 "escapedName": "setDimensions",
@@ -139,10 +187,20 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "unsigned long",
-                            "extAttrs": []
+                            "baseName": "long",
+                            "prefix": {
+                                "value": "unsigned",
+                                "trivia": ""
+                            },
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": " "
+                            }
                         },
                         "name": "width",
                         "escapedName": "width"
@@ -155,10 +213,20 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "unsigned long",
-                            "extAttrs": []
+                            "baseName": "long",
+                            "prefix": {
+                                "value": "unsigned",
+                                "trivia": " "
+                            },
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": " "
+                            }
                         },
                         "name": "height",
                         "escapedName": "height"
diff --git a/test/syntax/json/replaceable.json b/test/syntax/json/replaceable.json
index 4c5448c..fef0a69 100644
--- a/test/syntax/json/replaceable.json
+++ b/test/syntax/json/replaceable.json
@@ -13,10 +13,20 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "unsigned long",
-                    "extAttrs": []
+                    "baseName": "long",
+                    "prefix": {
+                        "value": "unsigned",
+                        "trivia": " "
+                    },
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "value",
                 "escapedName": "value",
@@ -39,10 +49,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "void",
-                    "extAttrs": []
+                    "baseName": "void",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n  "
+                    }
                 },
                 "name": "increment",
                 "escapedName": "increment",
diff --git a/test/syntax/json/sequence.json b/test/syntax/json/sequence.json
index cf8333b..c74e96e 100644
--- a/test/syntax/json/sequence.json
+++ b/test/syntax/json/sequence.json
@@ -14,10 +14,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "void",
-                    "extAttrs": []
+                    "baseName": "void",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n  "
+                    }
                 },
                 "name": "drawPolygon",
                 "escapedName": "drawPolygon",
@@ -29,20 +36,40 @@
                         "extAttrs": [],
                         "idlType": {
                             "type": "argument-type",
-                            "generic": "sequence",
-                            "nullable": false,
+                            "generic": {
+                                "value": "sequence",
+                                "trivia": {
+                                    "open": "",
+                                    "close": ""
+                                }
+                            },
+                            "nullable": null,
                             "union": false,
                             "idlType": [
                                 {
                                     "type": "argument-type",
                                     "generic": null,
-                                    "nullable": false,
+                                    "nullable": null,
                                     "union": false,
                                     "idlType": "float",
-                                    "extAttrs": []
+                                    "baseName": "float",
+                                    "prefix": null,
+                                    "postfix": null,
+                                    "separator": null,
+                                    "extAttrs": [],
+                                    "trivia": {
+                                        "base": ""
+                                    }
                                 }
                             ],
-                            "extAttrs": []
+                            "baseName": "sequence",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         },
                         "name": "coordinates",
                         "escapedName": "coordinates"
@@ -59,20 +86,40 @@
                 "stringifier": false,
                 "idlType": {
                     "type": "return-type",
-                    "generic": "sequence",
-                    "nullable": false,
+                    "generic": {
+                        "value": "sequence",
+                        "trivia": {
+                            "open": "",
+                            "close": ""
+                        }
+                    },
+                    "nullable": null,
                     "union": false,
                     "idlType": [
                         {
                             "type": "return-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "float",
-                            "extAttrs": []
+                            "baseName": "float",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         }
                     ],
-                    "extAttrs": []
+                    "baseName": "sequence",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n  "
+                    }
                 },
                 "name": "getInflectionPoints",
                 "escapedName": "getInflectionPoints",
@@ -105,10 +152,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "void",
-                    "extAttrs": []
+                    "baseName": "void",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n    "
+                    }
                 },
                 "name": "f1",
                 "escapedName": "f1",
@@ -120,16 +174,26 @@
                         "extAttrs": [],
                         "idlType": {
                             "type": "argument-type",
-                            "generic": "sequence",
-                            "nullable": false,
+                            "generic": {
+                                "value": "sequence",
+                                "trivia": {
+                                    "open": "",
+                                    "close": ""
+                                }
+                            },
+                            "nullable": null,
                             "union": false,
                             "idlType": [
                                 {
                                     "type": "argument-type",
                                     "generic": null,
-                                    "nullable": false,
+                                    "nullable": null,
                                     "union": false,
                                     "idlType": "long",
+                                    "baseName": "long",
+                                    "prefix": null,
+                                    "postfix": null,
+                                    "separator": null,
                                     "extAttrs": [
                                         {
                                             "name": "XAttr",
@@ -137,10 +201,20 @@
                                             "type": "extended-attribute",
                                             "rhs": null
                                         }
-                                    ]
+                                    ],
+                                    "trivia": {
+                                        "base": " "
+                                    }
                                 }
                             ],
-                            "extAttrs": []
+                            "baseName": "sequence",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         },
                         "name": "arg",
                         "escapedName": "arg"
diff --git a/test/syntax/json/setlike.json b/test/syntax/json/setlike.json
index 59e2b42..c46316b 100644
--- a/test/syntax/json/setlike.json
+++ b/test/syntax/json/setlike.json
@@ -10,10 +10,17 @@
                     {
                         "type": null,
                         "generic": null,
-                        "nullable": false,
+                        "nullable": null,
                         "union": false,
                         "idlType": "long",
-                        "extAttrs": []
+                        "baseName": "long",
+                        "prefix": null,
+                        "postfix": null,
+                        "separator": null,
+                        "extAttrs": [],
+                        "trivia": {
+                            "base": ""
+                        }
                     }
                 ],
                 "readonly": false,
@@ -41,10 +48,17 @@
                     {
                         "type": null,
                         "generic": null,
-                        "nullable": false,
+                        "nullable": null,
                         "union": false,
                         "idlType": "long",
-                        "extAttrs": []
+                        "baseName": "long",
+                        "prefix": null,
+                        "postfix": null,
+                        "separator": null,
+                        "extAttrs": [],
+                        "trivia": {
+                            "base": ""
+                        }
                     }
                 ],
                 "readonly": true,
@@ -72,9 +86,13 @@
                     {
                         "type": null,
                         "generic": null,
-                        "nullable": false,
+                        "nullable": null,
                         "union": false,
                         "idlType": "long",
+                        "baseName": "long",
+                        "prefix": null,
+                        "postfix": null,
+                        "separator": null,
                         "extAttrs": [
                             {
                                 "name": "XAttr",
@@ -82,7 +100,10 @@
                                 "type": "extended-attribute",
                                 "rhs": null
                             }
-                        ]
+                        ],
+                        "trivia": {
+                            "base": " "
+                        }
                     }
                 ],
                 "readonly": false,
diff --git a/test/syntax/json/static.json b/test/syntax/json/static.json
index c9123fe..2a40f35 100644
--- a/test/syntax/json/static.json
+++ b/test/syntax/json/static.json
@@ -28,10 +28,17 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "float",
-                    "extAttrs": []
+                    "baseName": "float",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "cx",
                 "escapedName": "cx",
@@ -46,10 +53,17 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "float",
-                    "extAttrs": []
+                    "baseName": "float",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "cy",
                 "escapedName": "cy",
@@ -64,10 +78,17 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "float",
-                    "extAttrs": []
+                    "baseName": "float",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "radius",
                 "escapedName": "radius",
@@ -82,10 +103,17 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "long",
-                    "extAttrs": []
+                    "baseName": "long",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "triangulationCount",
                 "escapedName": "triangulationCount",
@@ -101,10 +129,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "Point",
-                    "extAttrs": []
+                    "baseName": "Point",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "triangulate",
                 "escapedName": "triangulate",
@@ -117,10 +152,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "Circle",
-                            "extAttrs": []
+                            "baseName": "Circle",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         },
                         "name": "c1",
                         "escapedName": "c1"
@@ -133,10 +175,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "Circle",
-                            "extAttrs": []
+                            "baseName": "Circle",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": " "
+                            }
                         },
                         "name": "c2",
                         "escapedName": "c2"
@@ -149,10 +198,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "Circle",
-                            "extAttrs": []
+                            "baseName": "Circle",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": " "
+                            }
                         },
                         "name": "c3",
                         "escapedName": "c3"
diff --git a/test/syntax/json/stringifier-attribute.json b/test/syntax/json/stringifier-attribute.json
index 1f107c7..6198389 100644
--- a/test/syntax/json/stringifier-attribute.json
+++ b/test/syntax/json/stringifier-attribute.json
@@ -13,10 +13,20 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "unsigned long",
-                    "extAttrs": []
+                    "baseName": "long",
+                    "prefix": {
+                        "value": "unsigned",
+                        "trivia": " "
+                    },
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "id",
                 "escapedName": "id",
@@ -31,10 +41,17 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "DOMString",
-                    "extAttrs": []
+                    "baseName": "DOMString",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "name",
                 "escapedName": "name",
diff --git a/test/syntax/json/stringifier-custom.json b/test/syntax/json/stringifier-custom.json
index aafec6d..3c2b0a0 100644
--- a/test/syntax/json/stringifier-custom.json
+++ b/test/syntax/json/stringifier-custom.json
@@ -13,10 +13,20 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "unsigned long",
-                    "extAttrs": []
+                    "baseName": "long",
+                    "prefix": {
+                        "value": "unsigned",
+                        "trivia": " "
+                    },
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "id",
                 "escapedName": "id",
@@ -31,10 +41,19 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": true,
+                    "nullable": {
+                        "trivia": ""
+                    },
                     "union": false,
                     "idlType": "DOMString",
-                    "extAttrs": []
+                    "baseName": "DOMString",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "familyName",
                 "escapedName": "familyName",
@@ -49,10 +68,17 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "DOMString",
-                    "extAttrs": []
+                    "baseName": "DOMString",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "givenName",
                 "escapedName": "givenName",
@@ -68,10 +94,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "DOMString",
-                    "extAttrs": []
+                    "baseName": "DOMString",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": null,
                 "escapedName": null,
diff --git a/test/syntax/json/stringifier.json b/test/syntax/json/stringifier.json
index af31dae..0d2d26f 100644
--- a/test/syntax/json/stringifier.json
+++ b/test/syntax/json/stringifier.json
@@ -14,10 +14,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "DOMString",
-                    "extAttrs": []
+                    "baseName": "DOMString",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": null,
                 "escapedName": null,
diff --git a/test/syntax/json/treatasnull.json b/test/syntax/json/treatasnull.json
index d8be19f..11cf3e0 100644
--- a/test/syntax/json/treatasnull.json
+++ b/test/syntax/json/treatasnull.json
@@ -13,10 +13,17 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "DOMString",
-                    "extAttrs": []
+                    "baseName": "DOMString",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "name",
                 "escapedName": "name",
@@ -31,10 +38,17 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "DOMString",
-                    "extAttrs": []
+                    "baseName": "DOMString",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "owner",
                 "escapedName": "owner",
@@ -50,10 +64,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "boolean",
-                    "extAttrs": []
+                    "baseName": "boolean",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n\n  "
+                    }
                 },
                 "name": "isMemberOfBreed",
                 "escapedName": "isMemberOfBreed",
@@ -76,10 +97,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "DOMString",
-                            "extAttrs": []
+                            "baseName": "DOMString",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": " "
+                            }
                         },
                         "name": "breedName",
                         "escapedName": "breedName"
diff --git a/test/syntax/json/treatasundefined.json b/test/syntax/json/treatasundefined.json
index 2615ab9..514fa9d 100644
--- a/test/syntax/json/treatasundefined.json
+++ b/test/syntax/json/treatasundefined.json
@@ -13,10 +13,17 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "DOMString",
-                    "extAttrs": []
+                    "baseName": "DOMString",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "name",
                 "escapedName": "name",
@@ -31,10 +38,17 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "DOMString",
-                    "extAttrs": []
+                    "baseName": "DOMString",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "owner",
                 "escapedName": "owner",
@@ -50,10 +64,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "boolean",
-                    "extAttrs": []
+                    "baseName": "boolean",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n\n  "
+                    }
                 },
                 "name": "isMemberOfBreed",
                 "escapedName": "isMemberOfBreed",
@@ -76,10 +97,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "DOMString",
-                            "extAttrs": []
+                            "baseName": "DOMString",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": " "
+                            }
                         },
                         "name": "breedName",
                         "escapedName": "breedName"
diff --git a/test/syntax/json/typedef-union.json b/test/syntax/json/typedef-union.json
index 31e2419..e7177bd 100644
--- a/test/syntax/json/typedef-union.json
+++ b/test/syntax/json/typedef-union.json
@@ -4,43 +4,88 @@
         "idlType": {
             "type": "typedef-type",
             "generic": null,
-            "nullable": false,
+            "nullable": null,
             "union": true,
             "idlType": [
                 {
                     "type": null,
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "ImageData",
-                    "extAttrs": []
+                    "baseName": "ImageData",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": {
+                        "value": "or",
+                        "trivia": " "
+                    },
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": ""
+                    }
                 },
                 {
                     "type": null,
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "HTMLImageElement",
-                    "extAttrs": []
+                    "baseName": "HTMLImageElement",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": {
+                        "value": "or",
+                        "trivia": " "
+                    },
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n           "
+                    }
                 },
                 {
                     "type": null,
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "HTMLCanvasElement",
-                    "extAttrs": []
+                    "baseName": "HTMLCanvasElement",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": {
+                        "value": "or",
+                        "trivia": " "
+                    },
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n           "
+                    }
                 },
                 {
                     "type": null,
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "HTMLVideoElement",
-                    "extAttrs": []
+                    "baseName": "HTMLVideoElement",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n           "
+                    }
                 }
             ],
-            "extAttrs": []
+            "baseName": null,
+            "prefix": null,
+            "postfix": null,
+            "separator": null,
+            "extAttrs": [],
+            "trivia": {
+                "open": " ",
+                "close": ""
+            }
         },
         "name": "TexImageSource",
         "extAttrs": []
diff --git a/test/syntax/json/typedef.json b/test/syntax/json/typedef.json
index e6ecf3a..1f96fbf 100644
--- a/test/syntax/json/typedef.json
+++ b/test/syntax/json/typedef.json
@@ -13,10 +13,17 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "float",
-                    "extAttrs": []
+                    "baseName": "float",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "x",
                 "escapedName": "x",
@@ -31,10 +38,17 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "float",
-                    "extAttrs": []
+                    "baseName": "float",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "y",
                 "escapedName": "y",
@@ -55,20 +69,40 @@
         "type": "typedef",
         "idlType": {
             "type": "typedef-type",
-            "generic": "sequence",
-            "nullable": false,
+            "generic": {
+                "value": "sequence",
+                "trivia": {
+                    "open": "",
+                    "close": ""
+                }
+            },
+            "nullable": null,
             "union": false,
             "idlType": [
                 {
                     "type": "typedef-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "Point",
-                    "extAttrs": []
+                    "baseName": "Point",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": ""
+                    }
                 }
             ],
-            "extAttrs": []
+            "baseName": "sequence",
+            "prefix": null,
+            "postfix": null,
+            "separator": null,
+            "extAttrs": [],
+            "trivia": {
+                "base": " "
+            }
         },
         "name": "PointSequence",
         "extAttrs": []
@@ -87,10 +121,17 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "Point",
-                    "extAttrs": []
+                    "baseName": "Point",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "topleft",
                 "escapedName": "topleft",
@@ -105,10 +146,17 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "Point",
-                    "extAttrs": []
+                    "baseName": "Point",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "bottomright",
                 "escapedName": "bottomright",
@@ -139,10 +187,17 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "Rect",
-                    "extAttrs": []
+                    "baseName": "Rect",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "bounds",
                 "escapedName": "bounds",
@@ -158,10 +213,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "boolean",
-                    "extAttrs": []
+                    "baseName": "boolean",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n\n    "
+                    }
                 },
                 "name": "pointWithinBounds",
                 "escapedName": "pointWithinBounds",
@@ -174,10 +236,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "Point",
-                            "extAttrs": []
+                            "baseName": "Point",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         },
                         "name": "p",
                         "escapedName": "p"
@@ -195,10 +264,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "boolean",
-                    "extAttrs": []
+                    "baseName": "boolean",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n    "
+                    }
                 },
                 "name": "allPointsWithinBounds",
                 "escapedName": "allPointsWithinBounds",
@@ -211,10 +287,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "PointSequence",
-                            "extAttrs": []
+                            "baseName": "PointSequence",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         },
                         "name": "ps",
                         "escapedName": "ps"
@@ -238,9 +321,13 @@
         "idlType": {
             "type": "typedef-type",
             "generic": null,
-            "nullable": false,
+            "nullable": null,
             "union": false,
             "idlType": "octet",
+            "baseName": "octet",
+            "prefix": null,
+            "postfix": null,
+            "separator": null,
             "extAttrs": [
                 {
                     "name": "Clamp",
@@ -248,7 +335,10 @@
                     "type": "extended-attribute",
                     "rhs": null
                 }
-            ]
+            ],
+            "trivia": {
+                "base": " "
+            }
         },
         "name": "value",
         "extAttrs": []
diff --git a/test/syntax/json/typesuffixes.json b/test/syntax/json/typesuffixes.json
index c5fb932..5ec4e88 100644
--- a/test/syntax/json/typesuffixes.json
+++ b/test/syntax/json/typesuffixes.json
@@ -14,10 +14,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "void",
-                    "extAttrs": []
+                    "baseName": "void",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n  "
+                    }
                 },
                 "name": "test",
                 "escapedName": "test",
@@ -29,20 +36,44 @@
                         "extAttrs": [],
                         "idlType": {
                             "type": "argument-type",
-                            "generic": "sequence",
-                            "nullable": true,
+                            "generic": {
+                                "value": "sequence",
+                                "trivia": {
+                                    "open": "",
+                                    "close": ""
+                                }
+                            },
+                            "nullable": {
+                                "trivia": ""
+                            },
                             "union": false,
                             "idlType": [
                                 {
                                     "type": "argument-type",
                                     "generic": null,
-                                    "nullable": true,
+                                    "nullable": {
+                                        "trivia": ""
+                                    },
                                     "union": false,
                                     "idlType": "DOMString",
-                                    "extAttrs": []
+                                    "baseName": "DOMString",
+                                    "prefix": null,
+                                    "postfix": null,
+                                    "separator": null,
+                                    "extAttrs": [],
+                                    "trivia": {
+                                        "base": ""
+                                    }
                                 }
                             ],
-                            "extAttrs": []
+                            "baseName": "sequence",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         },
                         "name": "foo",
                         "escapedName": "foo"
diff --git a/test/syntax/json/uniontype.json b/test/syntax/json/uniontype.json
index eeac8d4..5e73be6 100644
--- a/test/syntax/json/uniontype.json
+++ b/test/syntax/json/uniontype.json
@@ -13,69 +13,142 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": true,
                     "idlType": [
                         {
                             "type": null,
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "float",
-                            "extAttrs": []
+                            "baseName": "float",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": {
+                                "value": "or",
+                                "trivia": " "
+                            },
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         },
                         {
                             "type": null,
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": true,
                             "idlType": [
                                 {
                                     "type": null,
                                     "generic": null,
-                                    "nullable": false,
+                                    "nullable": null,
                                     "union": false,
                                     "idlType": "Date",
-                                    "extAttrs": []
+                                    "baseName": "Date",
+                                    "prefix": null,
+                                    "postfix": null,
+                                    "separator": {
+                                        "value": "or",
+                                        "trivia": " "
+                                    },
+                                    "extAttrs": [],
+                                    "trivia": {
+                                        "base": ""
+                                    }
                                 },
                                 {
                                     "type": null,
                                     "generic": null,
-                                    "nullable": false,
+                                    "nullable": null,
                                     "union": false,
                                     "idlType": "Event",
-                                    "extAttrs": []
+                                    "baseName": "Event",
+                                    "prefix": null,
+                                    "postfix": null,
+                                    "separator": null,
+                                    "extAttrs": [],
+                                    "trivia": {
+                                        "base": " "
+                                    }
                                 }
                             ],
-                            "extAttrs": []
+                            "baseName": null,
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": {
+                                "value": "or",
+                                "trivia": " "
+                            },
+                            "extAttrs": [],
+                            "trivia": {
+                                "open": " ",
+                                "close": ""
+                            }
                         },
                         {
                             "type": null,
                             "generic": null,
-                            "nullable": true,
+                            "nullable": {
+                                "trivia": ""
+                            },
                             "union": true,
                             "idlType": [
                                 {
                                     "type": null,
                                     "generic": null,
-                                    "nullable": false,
+                                    "nullable": null,
                                     "union": false,
                                     "idlType": "Node",
-                                    "extAttrs": []
+                                    "baseName": "Node",
+                                    "prefix": null,
+                                    "postfix": null,
+                                    "separator": {
+                                        "value": "or",
+                                        "trivia": " "
+                                    },
+                                    "extAttrs": [],
+                                    "trivia": {
+                                        "base": ""
+                                    }
                                 },
                                 {
                                     "type": null,
                                     "generic": null,
-                                    "nullable": false,
+                                    "nullable": null,
                                     "union": false,
                                     "idlType": "DOMString",
-                                    "extAttrs": []
+                                    "baseName": "DOMString",
+                                    "prefix": null,
+                                    "postfix": null,
+                                    "separator": null,
+                                    "extAttrs": [],
+                                    "trivia": {
+                                        "base": " "
+                                    }
                                 }
                             ],
-                            "extAttrs": []
+                            "baseName": null,
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "open": " ",
+                                "close": ""
+                            }
                         }
                     ],
-                    "extAttrs": []
+                    "baseName": null,
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "open": " ",
+                        "close": ""
+                    }
                 },
                 "name": "test",
                 "escapedName": "test",
@@ -90,15 +163,22 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": true,
                     "idlType": [
                         {
                             "type": null,
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "long",
+                            "baseName": "long",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": {
+                                "value": "or",
+                                "trivia": " "
+                            },
                             "extAttrs": [
                                 {
                                     "name": "EnforceRange",
@@ -106,18 +186,36 @@
                                     "type": "extended-attribute",
                                     "rhs": null
                                 }
-                            ]
+                            ],
+                            "trivia": {
+                                "base": " "
+                            }
                         },
                         {
                             "type": null,
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "Date",
-                            "extAttrs": []
+                            "baseName": "Date",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": " "
+                            }
                         }
                     ],
-                    "extAttrs": []
+                    "baseName": null,
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "open": " ",
+                        "close": ""
+                    }
                 },
                 "name": "test2",
                 "escapedName": "test2",
diff --git a/test/syntax/json/variadic-operations.json b/test/syntax/json/variadic-operations.json
index a33deb9..a648762 100644
--- a/test/syntax/json/variadic-operations.json
+++ b/test/syntax/json/variadic-operations.json
@@ -13,10 +13,20 @@
                 "idlType": {
                     "type": "attribute-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "unsigned long",
-                    "extAttrs": []
+                    "baseName": "long",
+                    "prefix": {
+                        "value": "unsigned",
+                        "trivia": " "
+                    },
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": " "
+                    }
                 },
                 "name": "cardinality",
                 "escapedName": "cardinality",
@@ -32,10 +42,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "void",
-                    "extAttrs": []
+                    "baseName": "void",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n\n  "
+                    }
                 },
                 "name": "union",
                 "escapedName": "union",
@@ -48,10 +65,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "long",
-                            "extAttrs": []
+                            "baseName": "long",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         },
                         "name": "ints",
                         "escapedName": "ints"
@@ -69,10 +93,17 @@
                 "idlType": {
                     "type": "return-type",
                     "generic": null,
-                    "nullable": false,
+                    "nullable": null,
                     "union": false,
                     "idlType": "void",
-                    "extAttrs": []
+                    "baseName": "void",
+                    "prefix": null,
+                    "postfix": null,
+                    "separator": null,
+                    "extAttrs": [],
+                    "trivia": {
+                        "base": "\n  "
+                    }
                 },
                 "name": "intersection",
                 "escapedName": "intersection",
@@ -85,10 +116,17 @@
                         "idlType": {
                             "type": "argument-type",
                             "generic": null,
-                            "nullable": false,
+                            "nullable": null,
                             "union": false,
                             "idlType": "long",
-                            "extAttrs": []
+                            "baseName": "long",
+                            "prefix": null,
+                            "postfix": null,
+                            "separator": null,
+                            "extAttrs": [],
+                            "trivia": {
+                                "base": ""
+                            }
                         },
                         "name": "ints",
                         "escapedName": "ints"