Handle a list marker at the head (``#``, ``*``, ``;``, ``:``).
182419
def _handle_list_marker(self):
        """"""
        markup = self._read()
        if markup == ";":
            self._context |= contexts.DL_TERM
        self._emit(tokens.TagOpenOpen(wiki_markup=markup))
        self._emit_text(get_html_tag(markup))
        self._emit(tokens.TagCloseSelfclose())
1228414
def namelist_handle(tokens):
    """"""
    if len(tokens) == 1:
        return tokens[0]
    elif len(tokens) == 2:
        return tokens[0] + "\n" + tokens[0] + " = " + tokens[1]
    else:
        raise CoconutInternalException("invalid in-line nonlocal / global tokens", tokens)
941416
function handleListResults( results ) {
		grunt.verbose.writeln( 'BowerMap::handleListResults' );

		for ( var k in results ) {
			if ( results.hasOwnProperty( k ) ) {
				grunt.verbose.writeln( '------------------------------------' );
				grunt.verbose.writeln( '    ' + k + ' - ' + results[k] );
				if ( ignore.indexOf( k ) >= 0 ){
					grunt.verbose.writeln( '    ' + k + ' - IGNORED' );
				}
				else{
					copyComponentFiles( k, results[k] );
				}
			}
		}
		done();
	}
874483
function listReady(list, error) {
        if (typeof error != 'undefined') {
          callback(error);
          return;
        }
        self.shouldBeTrue(list instanceof List, 'is list');
        self.shouldBeTrue(list.length() == 2, 'is 2');
        list.moveFirst();
        self.shouldBeTrue(list.get('name') == 'Larry', 'larry');
        list.moveNext();
        self.shouldBeTrue(list.get('name') == 'Moe', 'moe');
        createSets();
      }
557542
def marker_for_line(self, line):
        
        markers = []
        for marker in self._markers:
            if line == marker.position:
                markers.append(marker)
        return markers
1368571
function normalListItem(ctx, value, position) {
  var offsets = ctx.offset
  var line = position.line
  var max
  var bullet
  var rest
  var lines
  var trimmedLines
  var index
  var length

  // Remove the list-item’s bullet.
  value = value.replace(bulletExpression, replacer)

  lines = value.split(lineFeed)

  trimmedLines = removeIndent(value, getIndent(max).indent).split(lineFeed)

  // We replaced the initial bullet with something else above, which was used
  // to trick `removeIndentation` into removing some more characters when
  // possible.  However, that could result in the initial line to be stripped
  // more than it should be.
  trimmedLines[0] = rest

  offsets[line] = (offsets[line] || 0) + bullet.length
  line++

  index = 0
  length = lines.length

  while (++index < length) {
    offsets[line] =
      (offsets[line] || 0) + lines[index].length - trimmedLines[index].length
    line++
  }

  return trimmedLines.join(lineFeed)

  function replacer($0, $1, $2, $3, $4) {
    bullet = $1 + $2 + $3
    rest = $4

    // Make sure that the first nine numbered list items can indent with an
    // extra space.  That is, when the bullet did not receive an extra final
    // space.
    if (Number($2) < 10 && bullet.length % 2 === 1) {
      $2 = space + $2
    }

    max = $1 + repeat(space, $2.length) + $3

    return max + rest
  }
}
356292
def _make_marker_token(self, type_):
        """"""
        tok = Token(type_,
                    '',
                    self.line,
                    self.line_num,
                    self.start,
                    self.start)
        return tok
442104
def marker_split(block):
    
    marker = None
    value = []

    for line in block.split('\n'):
        line = line.strip()
        if line.startswith('\\_'):
            continue  # we simply ignore SFM header fields
        match = MARKER_PATTERN.match(line)
        if match:
            if marker:
                yield marker, '\n'.join(value)
            marker = match.group('marker')
            value = [line[match.end():]]
        else:
            value.append(line)
    if marker:
        yield marker, ('\n'.join(value)).strip()
301820
function handleContent(element, spaces, marker) {
  let renderedContent = '';
  let objectLike = null;

  if (element.content === undefined) {
    return [renderedContent, objectLike];
  }

  for (const item of element.content) {
    // Note: the `initialIndent` option above works because we specifically
    //       do *not* pass it down the rabbit hole here.
    if (item.element === 'member') {
      // This is an object type or something similar.
      objectLike = true;
      /* eslint-disable no-use-before-define */
      renderedContent += handle(item.key.content, item.value, {
        parent: element,
        spaces,
        marker,
        attributesElement: item,
      });
      /* eslint-enable no-use-before-define */
    } else if (item.element === 'ref') {
      renderedContent += `${marker} Include ${item.content.href}\n`;
    } else if (item.element === 'select') {
      // This is a `OneOf` mutually exclusive type. Currently not
      // supported as it needs some support upstream in Minim.
      console.warn('MSON select/option elements are not yet supported!');
    } else {
      // This is an array type or something similar.
      objectLike = false;
      /* eslint-disable no-use-before-define */
      renderedContent += handle(item.title, item, {
        parent: element,
        spaces,
        marker,
      });
      /* eslint-enable no-use-before-define */
    }
  }

  return [renderedContent, objectLike];
}
1190460
private R pushExprList(ExpressionList<T> list) {
    if (textMode) {
      textStack.push(list);
    } else {
      whereStack.push(list);
    }
    return root;
  }
534159
def lazy_list_handle(tokens):
    """"""
    if len(tokens) == 0:
        return "_coconut.iter(())"
    else:
        return (
            "(%s() for %s in (" % (func_var, func_var)
            + "lambda: " + ", lambda: ".join(tokens) + ("," if len(tokens) == 1 else "") + "))"
        )
1296041
function process(list) {
        var head = list[0];
        var tail = list.slice(1);
        // @TODO Handle null head (all handlers emitted "reject")
        req.once("reject", function () {
            process(tail);
        });
        head.request(req, res);
    }
865880
function isInList(value, listOfValues, msg) {
    value = value.toLowerCase().trim();
    if (listOfValues.indexOf(value) === -1) {
        throw new Error(msg);
    }
}
133649
def add_error_marker(text, position, start_line=1):
    
    indent = "    "
    lines = []
    caret_line = start_line
    for line in text.split("\n"):
        lines.append(indent + line)

        if 0 <= position <= len(line):
            lines.append(indent + (" " * position) + "^")
            caret_line = start_line

        position -= len(line)
        position -= 1  # for the newline
        start_line += 1

    return "\n".join(lines), caret_line
388605
def _write_marker(self, indent_string, depth, entry, comment):
        """"""
        return '%s%s%s%s%s' % (indent_string,
                               self._a_to_u('[' * depth),
                               self._quote(self._decode_element(entry), multiline=False),
                               self._a_to_u(']' * depth),
                               self._decode_element(comment))
280500
function processListItems(list_str) {

        listLevel++;

        list_str = list_str.replace(/\n{2,}$/,"\n");
        list_str += "~0";

        list_str = list_str.replace(/(\n)?(^[ \t]*)([*+-]|\d+[.])[ \t]+([^\r]+?(\n{1,2}))(?=\n*(~0|\2([*+-]|\d+[.])[ \t]+))/gm, function(wholeMatch,m1,m2,m3,m4){

            var item = m4;
            var leading_line = m1;
            var leading_space = m2;

            if (leading_line || (item.search(/\n{2,}/)>-1)) {
                item = runBlockGamut(outdent(item));
            }
            else {
                item = doLists(outdent(item));
                item = item.replace(/\n$/,"");
                item = runSpanGamut(item);
            }

            return  "<li>" + item + "</li>\n";
        });

        list_str = list_str.replace(/~0/g,"");
        listLevel--;

        return list_str;
    }
888800
function handleDescription(description, element, parent, spaces, marker) {
  const elementName = element.element;
  let str = '';

  // This flag determines when to use a block description within a list entry
  // instead of just ending the list entry line with the description. This
  // means that some other special values like `+ Properties` will get used
  // later during rendering.
  let useLongDescription = false;
  if (element.attributes &&
      (element.attributes.default !== undefined ||
       element.attributes.sample !== undefined)) {
    useLongDescription = true;
  }

  // Finally, an optional description
  if (description) {
    if (description.indexOf('\n') !== -1) {
      // Multiline description, so we can't use the short form!
      useLongDescription = true;
    }

    if (useLongDescription) {
      str += `\n${description}`;
    } else {
      str += ` - ${description}`;
    }
  }

  // Handle special list items like default/sample here as they are part
  // of the description, before the content (sub-elements) are rendere.
  const defaultValue = element.attributes &&
                       element.attributes.getValue('default');
  if (defaultValue !== undefined) {
    str += `\n${marker} Default: ${defaultValue}\n`;
  }

  const sampleValue = element.attributes &&
                      element.attributes.getValue('sample');
  if (sampleValue !== undefined) {
    str += `\n${marker} Sample: ${sampleValue}\n`;
  }

  // Now, depending on the content type, we will recursively handle child
  // elements within objects and arrays.
  if (element.content && element.content.length) {
    str += '\n';

    if (!parent) {
      // No parent implies a data structure or attribute definition, so
      // buffer it with an extra space.
      str += '\n';
    }

    const [renderedContent, objectLike] = handleContent(element, spaces, marker);

    if (!useLongDescription) {
      str += renderedContent;
    } else if (renderedContent.length) {
      // There is rendered content
      if (objectLike) {
        str += `\n${marker} Properties\n`;
      } else if (elementName === 'enum') {
        // An enum is a special case where the content is a list
        // but you use `Members` rather than `Items`.
        str += `\n${marker} Members\n`;
      } else {
        str += `\n${marker} Items\n`;
      }

      str += indent(renderedContent, spaces, {first: true});
    }
  }

  return str;
}