anchor.diff:  // TODO(jmesserly): remove this when we can extend Element for real.
   _nodeOrCustom(node) => node is Element ? node.xtag : node;
   
  -List<_BindingToken> _parseMustacheTokens(String s) {
  -  var result = [];
  +/** True if and only if [tokens] is of the form `['', path, '']`. */
  +bool _isSimpleBinding(List<String> tokens) =>
  +    tokens.length == 3 && tokens[0].isEmpty && tokens[2].isEmpty;
  +
  +/**
  + * Parses {{ mustache }} bindings.
  + *
  + * Returns null if there are no matches. Otherwise returns
  + * [TEXT, (PATH, TEXT)+] if there is at least one mustache.
  + */
  +List<String> _parseMustacheTokens(String s) {
  +  if (s.isEmpty) return;
  +
  +  var tokens = null;
     var length = s.length;
  -  var index = 0, lastIndex = 0;
  +  var startIndex = 0, lastIndex = 0, endIndex = 0;
     while (lastIndex < length) {
  -    index = s.indexOf('{{', lastIndex);
  -    if (index < 0) {
  -      result.add(new _BindingToken(s.substring(lastIndex)));
  +    startIndex = s.indexOf('{{', lastIndex);
  +    endIndex = startIndex < 0 ? -1 : s.indexOf('}}', startIndex + 2);
  +
  +    if (endIndex < 0) {
  +      if (tokens == null) return null;
  +
  +      tokens.add(s.substring(lastIndex));
         break;
  -    } else {
  -      // There is a non-empty text run before the next path token.
  -      if (index > 0 && lastIndex < index) {
  -        result.add(new _BindingToken(s.substring(lastIndex, index)));
  -      }
  -      lastIndex = index + 2;
  -      index = s.indexOf('}}', lastIndex);
  -      if (index < 0) {
  -        var text = s.substring(lastIndex - 2);
  -        if (result.length > 0 && result.last.isText) {
  -          result.last.value += text;
  -        } else {
  -          result.add(new _BindingToken(text));
  -        }
  -        break;
  -      }
  -
  -      var value = s.substring(lastIndex, index).trim();
  -      result.add(new _BindingToken(value, isBinding: true));
  -      lastIndex = index + 2;
  -    }
  -  }
  -  return result;
  +    }
  +
  +    if (tokens == null) tokens = <String>[];
  +    tokens.add(s.substring(lastIndex, startIndex)); // TEXT
  +    tokens.add(s.substring(startIndex + 2, endIndex).trim()); // PATH
  +    lastIndex = endIndex + 2;
  +  }
  +
  +  if (lastIndex == length) tokens.add('');
  +  return tokens;
   }
   
   void _addTemplateInstanceRecord(fragment, model) {
  
positive.code:   }
  }
  
  void _addAttributeBindings(Element element, model, delegate) {
    var attrs = new LinkedHashMap.from(element.attributes);
    if (element.isTemplate) {
      // Accept 'naked' bind & repeat.
      if (attrs['bind'] == '') attrs['bind'] = '{{}}';
      if (attrs['repeat'] == '') attrs['repeat'] = '{{}}';
  
      // Treat <template if="{{expr}}"> as <template bind if="{{expr}}">
      if (attrs.containsKey('if') &&
          !attrs.containsKey('bind') &&
          !attrs.containsKey('repeat')) {
        attrs['bind'] = '{{}}';
      }
    }
  
    attrs.forEach((name, value) {
      _parseAndBind(element, name, value, model, delegate);
    });
  }
  
  void _parseAndBind(Node node, String name, String text, model,
      BindingDelegate delegate) {
  
    var tokens = _parseMustacheTokens(text);
    if (tokens.length == 0 || (tokens.length == 1 && tokens[0].isText)) {
      return;
    }
  
    // If this is a custom element, give the .xtag a change to bind.
    node = _nodeOrCustom(node);
  
    if (tokens.length == 1 && tokens[0].isBinding) {
      _bindOrDelegate(node, name, model, tokens[0].value, delegate);
      return;
    }
  
    var replacementBinding = new CompoundBinding();
    for (var i = 0; i < tokens.length; i++) {
      var token = tokens[i];
      if (token.isBinding) {
        _bindOrDelegate(replacementBinding, i, model, token.value, delegate);
      }
    }
  
    replacementBinding.combinator = (values) {
      var newValue = new StringBuffer();
  
      for (var i = 0; i < tokens.length; i++) {
        var token = tokens[i];
        if (token.isText) {
          newValue.write(token.value);
        } else {
          var value = values[i];
          if (value != null) {
  
negative.code:   }
  }
  
  
  class _TemplateIterator {
    final Element _templateElement;
  