 &gt; 0xFFFF) {
      error(&#39;each part must be in the range of `0x0..0xFFFF`&#39;, start);
    }
    return value;
  }

  if (host.length &lt; 2) error(&#39;address is too short&#39;);
  List&lt;int&gt; parts = [];
  bool wildcardSeen = false;
  &#47;&#47; Set if seeing a &quot;.&quot;, suggesting that there is an IPv4 address.
  bool seenDot = false;
  int partStart = start;
  &#47;&#47; Parse all parts, except a potential last one.
  for (int i = start; i &lt; end; i++) {
    int char = host.codeUnitA