scalar  : B_LITERAL_START scalar_group B_LITERAL_END
182624
def p_scalar__literal(self, p):
        
        scalar_group = ''.join(p[2])
        p[0] = ScalarDispatch('%s\n' % dedent(scalar_group).replace('\n\n\n', '\n'), cast='str')
189781
def scalarDecorator(func):
    """"""
    @wraps(func)
    def scalar_wrapper(*args,**kwargs):
        if nu.array(args[0]).shape == ():
            scalarOut= True
            newargs= ()
            for ii in range(len(args)):
                newargs= newargs+(nu.array([args[ii]]),)
            args= newargs
        else:
            scalarOut= False
        result= func(*args,**kwargs)
        if scalarOut:
            out= ()
            for ii in range(result.shape[1]):
                out= out+(result[0,ii],)
            return out
        else:
            return result
    return scalar_wrapper
599851
public static function parseScalar(string $scalar, int $flags = 0, array $delimiters = null, int &$i = 0, bool $evaluate = true, array $references = [])
    {
        if (\in_array($scalar[$i], ['"', "'"])) {
            // quoted scalar
            $output = self::parseQuotedScalar($scalar, $i);

            if (null !== $delimiters) {
                $tmp = ltrim(substr($scalar, $i), ' ');
                if ('' === $tmp) {
                    throw new ParseException(sprintf('Unexpected end of line, expected one of "%s".', implode('', $delimiters)), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename);
                }
                if (!\in_array($tmp[0], $delimiters)) {
                    throw new ParseException(sprintf('Unexpected characters (%s).', substr($scalar, $i)), self::$parsedLineNumber + 1, $scalar, self::$parsedFilename);
                }
            }
        } else {
            // "normal" string
            if (!$delimiters) {
                $output = substr($scalar, $i);
                $i += \strlen($output);

                // remove comments
                if (Parser::preg_match('/[ \t]+#/', $output, $match, PREG_OFFSET_CAPTURE)) {
                    $output = substr($output, 0, $match[0][1]);
                }
            } elseif (Parser::preg_match('/^(.*?)('.implode('|', $delimiters).')/', substr($scalar, $i), $match)) {
                $output = $match[1];
                $i += \strlen($output);
                $output = trim($output);
            } else {
                throw new ParseException(sprintf('Malformed inline YAML string: %s.', $scalar), self::$parsedLineNumber + 1, null, self::$parsedFilename);
            }

            // a non-quoted string cannot start with @ or ` (reserved) nor with a scalar indicator (| or >)
            if ($output && ('@' === $output[0] || '`' === $output[0] || '|' === $output[0] || '>' === $output[0] || '%' === $output[0])) {
                throw new ParseException(sprintf('The reserved indicator "%s" cannot start a plain scalar; you need to quote the scalar.', $output[0]), self::$parsedLineNumber + 1, $output, self::$parsedFilename);
            }

            if ($evaluate) {
                $output = self::evaluateScalar($output, $flags, $references);
            }
        }

        return $output;
    }
478280
function parseGroup(tokenizer) {
  // Group this functon will return.
  var mrow = {tag: 'mrow', children: []};
  // Last child of mrow.
  var lastItem;
  // Current token.
  var tkn;
  // Current tag.
  var tag;
  // Macro. This is a function with this prototype: (tokenizer, mrow).
  var macro;

  for(;;) {
    tkn = tokenizer.next();
    // End of stream.
    if (!tkn) break;
    // End of block.
    if (tkn.typ == '}') break;
    // Deal with msup.
    if (tkn.typ == '^') {
      if (mrow.children.length == 0) {
        mrow.children.push({tag: 'mrow', children: []});
      }
      lastItem = mrow.children[mrow.children.length - 1];
      if (lastItem.msup) {
        tokenizer.fatal("Double superscript.", tkn.idx);
      }
      lastItem.msup = parseItemOrGroup(tokenizer);
    }
    else if (tkn.typ == '_') {
      if (mrow.children.length == 0) {
        mrow.children.push({tag: 'mrow', children: []});
      }
      lastItem = mrow.children[mrow.children.length - 1];
      if (lastItem.msub) {
        tokenizer.fatal("Double subscript.", tkn.idx);
      }
      lastItem.msub = parseItemOrGroup(tokenizer);
    }
    // Prime, double, triple or quadruple prime.
    else if (tkn.typ == 'prime') {
      lastItem = mrow.children[mrow.children.length - 1];
      if (lastItem.msup) {
        tokenizer.fatal("Double superscript because of a prime.", tkn.idx);
      }
      lastItem.msup = {tag: 'mo', children: tkn.txt};
    }
    // Beginning of a new group.
    else if (tkn.typ == '{') {
      mrow.children.push( parseGroup(tokenizer) );
    }
    // Add this leaf in the tree.
    else {
      tag = tokenToTag(tkn);
      if (typeof tag === 'function') {
        // This is a macro.
        macro = tag;
        tag = macro(tokenizer, mrow, tkn.idx);
        if (tag) {
          mrow.children.push(tag);
        }
      } else {
        mrow.children.push(tag);
      }
    }
  }
  return mrow;
}
883790
def parse_block_scalar_indent(token_class):
        """"""
        def callback(lexer, match, context):
            text = match.group()
            if context.block_scalar_indent is None:
                if len(text) <= max(context.indent, 0):
                    context.stack.pop()
                    context.stack.pop()
                    return
                context.block_scalar_indent = len(text)
            else:
                if len(text) < context.block_scalar_indent:
                    context.stack.pop()
                    context.stack.pop()
                    return
            if text:
                yield match.start(), token_class, text
                context.pos = match.end()
        return callback
1151533
def main_group(self, i):
        """"""

        current = []
        while True:
            try:
                t = next(i)
                current.extend(self.normal(t, i))
            except StopIteration:
                break
        return current
291701
def parse_group(self, stream):
        
        self.expect_in(stream, self.begin_group_tokens)

        self.ensure_assignment(stream)
        name = self.next_token(stream)

        self.skip_statement_delimiter(stream)
        statements = self.parse_block(stream, self.has_end_group)

        self.expect_in(stream, self.end_group_tokens)
        self.parse_end_assignment(stream, name)
        self.skip_statement_delimiter(stream)

        return name.decode('utf-8'), PVLGroup(statements)
294027
static LiteralType parse(LiteralType result, String input) {
		result.value=input;
		Matcher matcher = CLASS_PATTERN.matcher(input);

		while (matcher.find()) {
			if (matcher.group(GROUP_SIMPLE_INDEX) != null || matcher.group(GROUP_ARRAY_INDEX) != null || matcher.group(GROUP_TYPE_GENERIC_INDEX) != null) {
				result.value = matcher.group(GROUP_SIMPLE_INDEX);
				if (result.value == null && matcher.group(GROUP_ARRAY_INDEX) != null) {
					result.value = matcher.group(GROUP_ARRAY_INDEX);
					result.array = true;
				}
				if (result.value == null && matcher.group(GROUP_TYPE_GENERIC_INDEX) != null) {
					result.value = matcher.group(GROUP_TYPE_GENERIC_INDEX);
					result.typeParameter=matcher.group(GROUP_TYPE_PARAMETER_INDEX);
				}

				if (result.value!=null && result.value.indexOf(".") >= 0) {
					// assert: JDK lang
					result.rawType = result.value;

					if (result.rawType.startsWith("java")) {
						// assert: raw type is type defined in jdk
						try {
							result.resolvedRawType = Class.forName(result.rawType);
						} catch (ClassNotFoundException e) {
						}
					}
				} else {
					// assert: primitive
					result.rawType = result.value;
					result.primitive = true;

					Class<?> resolved[] = { Byte.TYPE, Short.TYPE, Integer.TYPE, Long.TYPE, Float.TYPE, Double.TYPE };

					for (Class<?> i : resolved) {
						if (result.rawType.equals(i.getSimpleName())) {
							result.resolvedRawType = i;
							break;
						}
					}
					
					if (Void.TYPE.getSimpleName().equals(result.rawType))
					{
						result.resolvedRawType=Void.TYPE;
					}
				}

			}
		}
		return result;
	}
1223627
def map_scalar(value)
      uri = begin
              URI.parse(value)
            rescue
              nil
            end
      pair = value.split(':')

      if uri && uri.scheme && uri.host
        # absolute URI with scheme, authority, etc
        uri.host, uri.port = host_and_port(uri.host, uri.port)
        return uri.to_s
      elsif pair.size == 2
        # "host:port" pair; three sub-cases...
        if pair.first =~ ELIDED
          # output only the port
          service = pair.first.gsub(REMOVE_ELIDED, '')
          _, port = host_and_port(service, pair.last)
          return port.to_s
        elsif pair.last =~ ELIDED
          # output only the hostname; resolve the port anyway to ensure that
          # the service is running.
          service = pair.first
          port = pair.last.gsub(REMOVE_ELIDED, '')
          host, = host_and_port(service, port)
          return host
        else
          # output port:hostname pair
          host, port = host_and_port(pair.first, pair.last)
          return "#{host}:#{port}"
        end
      else
        fail BadSubstitution, "Can't understand '#{value}'"
      end
    end
1113746
def p_common_scalar_magic_ns(p):
    ''
    p[0] = ast.MagicConstant(p[1].upper(), None, lineno=p.lineno(1))
440124
def _process_first_group(self, group):
        
        if "-" in group:
            # range
            if len(group.split("-")) == 2:
                arr = group.split("-")
                start = self._parse_codepoint(arr[0])
                end = self._parse_codepoint(arr[1])
        else:
            # single char/U+xxxx
            start = self._parse_codepoint(group)
            end = start
        result = []
        if (start > -1) and (end >= start):
            for index in range(start, end + 1):
                result.append(gf.safe_unichr(index))
        return result
679717
def p_common_scalar_magic_line(p):
    ''
    p[0] = ast.MagicConstant(p[1].upper(), p.lineno(1), lineno=p.lineno(1))
238210
def construct_scalar(self, node):
        '''
        
        '''
        if node.tag == 'tag:yaml.org,2002:int':
            if node.value == '0':
                pass
            elif node.value.startswith('0') and not node.value.startswith(('0b', '0x')):
                node.value = node.value.lstrip('0')
                # If value was all zeros, node.value would have been reduced to
                # an empty string. Change it to '0'.
                if node.value == '':
                    node.value = '0'
        return super(SaltYamlSafeLoader, self).construct_scalar(node)
413419
def endGroup(self):
        
        if self._customFormat:
            self._customFormat.endGroup()
        else:
            super(XSettings, self).endGroup()
687378
def p_regex_literal(self, p):
        """"""
        p[0] = self.asttypes.Regex(p[1])
        p[0].setpos(p)
416122
def _scalar_binary_op(self, other, binop, result):
        '''
        
        '''
        template = 'map({arr}, |z: {type}| z {binop} {other}{suffix})'
        weld_type = result._weld_type.__str__()
        result.weldobj.weld_code = template.format(arr = result.weldobj.weld_code,
                                                  type =  weld_type,
                                                  binop = binop,
                                                  other = str(other),
                                                  suffix = DTYPE_SUFFIXES[weld_type])
        return result
462914
def parse_block_scalar_empty_line(IndentTokenClass, ContentTokenClass):
    """"""
    def callback(lexer, match, context):
        text = match.group()
        if (context.block_scalar_indent is None or
                len(text) <= context.block_scalar_indent):
            if text:
                yield match.start(), IndentTokenClass, text
        else:
            indentation = text[:context.block_scalar_indent]
            content = text[context.block_scalar_indent:]
            yield match.start(), IndentTokenClass, indentation
            yield (match.start()+context.block_scalar_indent,
                    ContentTokenClass, content)
        context.pos = match.end()
    return callback