<commit_before>﻿/**
 * @fileoverview
 * Helper function prototypes related to DOM objects and the DOM 
 * <strong>fixme: Christian should document the template syntax</strong>
 *
 * TEMPLATE :: =
 *     "[" [NODENAME | "null"]
 *         {"," TEXT | "," TEMPLATE}
 *         {"," KEY "," VALUE}
 *      "]"
 *
 * where NODENAME, TEXT and KEY are DOM strings and VALUE can be everything except an array
 */

Element.prototype.render = Document.prototype.render =  function(args)
{
  if (args.length)
  {
    if (args[0])
    {
      var 
      doc = this.nodeType == 9 ? this : this.ownerDocument,
      i = 0, 
      ele = this, 
      first_arg = args[0],
      prop = '', 
      is_array = false, 
      arg = null;
      
      if (typeof first_arg == 'string')
      {
        ele = first_arg in CustomElements ? CustomElements[first_arg].create() : doc.createElement(first_arg);
        i++;
      };
      arg = args[i];
      while (true)
      {
        if (arg instanceof  Array) 
        {
          ele.render(arg); 
          arg = args[++i];
        }
        else if (typeof arg == 'string' && ((args.length - i ) % 2 || args[i + 1] instanceof Array)) 
        {<commit_msg>small code cosmetics<commit_after>﻿/**
 * @fileoverview
 * Helper function prototypes related to DOM objects and the DOM 
 * <strong>fixme: Christian should document the template syntax</strong>
 *
 * TEMPLATE :: =
 *     "[" [NODENAME | "null"]
 *         {"," TEXT | "," TEMPLATE}
 *         {"," KEY "," VALUE}
 *      "]"
 *
 * where NODENAME, TEXT and KEY are DOM strings and VALUE can be everything except an array
 */

Element.prototype.render = Document.prototype.render =  function(args)
{
  var 
  doc = this.nodeType == 9 ? this : this.ownerDocument,
  i = 0, 
  ele = this, 
  first_arg = '',
  arg = null;
  
  if (args.length)
  {
    if (first_arg = args[0])
    {
      if (typeof first_arg == 'string')
      {
        ele = first_arg in CustomElements ? CustomElements[first_arg].create() : doc.createElement(first_arg);
        i++;
      };
      arg = args[i];
      while (true)
      {
        if (arg instanceof  Array) 
        {
          ele.render(arg); 
          arg = args[++i];
        }
        else if (typeof arg == 'string' && ((args.length - i) % 2 || args[i + 1] instanceof Array)) 
        {
{'fraction_non_alphanumeric': 0.14193270060396893, 'fraction_numerical': 0.004745470232959448, 'mean_word_length': 2.075596816976127, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4182685', 'n_tokens_mistral': 755, 'n_tokens_neox': 713, 'n_words': 199}