Returns the string which was actually parsed with all the substitutions performed
348213
public static String parseCommandArgs(String commandLine, final CommandLineParser.CallbackHandler handler) throws CommandFormatException {
        if(commandLine == null) {
            return null;
        }
        final ParsingStateCallbackHandler callbackHandler = getCallbackHandler(handler);
        return StateParser.parse(commandLine, callbackHandler, ArgumentListState.INSTANCE);
    }
597493
private function parseLongString()
    {
        list(, $length) = \unpack('N', $this->buffer);

        try {
            return mb_orig_substr($this->buffer, 4, $length);
        } finally {
            $this->buffer = mb_orig_substr($this->buffer, $length + 4);
        }
    }
553922
def getSource(self):
        
        bracket = self.next()
        # we should only be here because that was a bracket
        if not bracket == u'{':
            raise Exception(u"parse error getting source")
        c = u''
        identifier = u''
        while True:
            c = self.next()
            if not c:
                raise Exception(u"unexpected end of input getting source")
            elif c == u'}':
                break
            else:
                identifier += c
        if not identifier or not isidentifier(identifier):
            raise StringGenerator.SyntaxError(u"not a valid identifier: %s"%identifier)
        return StringGenerator.Source(identifier)
547468
function parseSearchString(str) {

    str = tia.cU.replaceXTypesInTeq(str);

    var re = /&(\w|\d|_|-)+/g;

    var searchData = [];
    var prevLastIndex = 0;
    var query;

    while (true) {
      var reResult = re.exec(str);

      if (reResult === null) {
        // Only query string.
        query = str.slice(prevLastIndex).trim();
        if (query) {
          searchData.push({
            query: query,
          });
        }
        return searchData;
      }

      query = str.slice(prevLastIndex, reResult.index).trim();
      var reference = str.slice(reResult.index + 1, re.lastIndex).trim();
      prevLastIndex = re.lastIndex;

      if (query) {
        searchData.push({
          query: query,
        });
      }

      searchData.push({
        reference: reference,
      });

    }
  }
474682
protected static SubstitutedLine doParse(String str, ParsingStateCallbackHandler callbackHandler, ParsingState initialState,
            boolean strict, boolean disableResolutionException, CommandContext cmdCtx) throws CommandFormatException {

        if (str == null || str.isEmpty()) {
            return new SubstitutedLine(str);
        }

        ParsingContextImpl ctx = new ParsingContextImpl();
        ctx.initialState = initialState;
        ctx.callbackHandler = callbackHandler;
        ctx.input = str;
        ctx.strict = strict;
        ctx.cmdCtx = cmdCtx;
        ctx.disableResolutionException = disableResolutionException;

        ctx.substitued.substitued = ctx.parse();
        return ctx.substitued;
    }
938293
def get_quoted_strings(quoted_string):
    '''
    
    '''
    try:
        # This regex grabs all quoted data from string.
        # Note that this gets everything in between the first and last double quote.
        # This is intentional, as printed (and quoted) strings from a target file may contain
        # double quotes, and this function should ignore those. However, it also means that any
        # data between two quoted strings (ex: '"quote 1" non-quoted data
        # "quote 2"') will also be included.
        return re.findall(r'\"(.*)\"', quoted_string)[0]
    except KeyboardInterrupt as e:
        raise e
    except Exception:
        return ''
554313
def debugArgsToDict(a):
    
    s = a.replace('+', ' ')
    s = s.replace('=', ':')
    s = re.sub(r'([A-Z][A-Z_]+)', r"'\1'", s)
    return ast.literal_eval('{ ' + s + ' }')
1040328
function substituteVars(rawText, vars)
{
    if (!vars)
    {
        return rawText;
    }
    //after loading contents, perform variable substitution
    Object.keys(vars).forEach(function (varName)
    {
        if (vars.hasOwnProperty(varName))
        {
            var varValue = vars[varName];
            rawText = replaceAll(rawText, varName, varValue);
        }
    });
    return rawText;
}
654245
function parseFunctionSourceElements() {
        var statement, body = [], token, directive, firstRestricted,
            oldLabelSet, oldInIteration, oldInSwitch, oldInFunctionBody, oldParenthesisCount,
            node = new Node();

        expect('{');

        while (startIndex < length) {
            if (lookahead.type !== Token.StringLiteral) {
                break;
            }
            token = lookahead;

            statement = parseStatementListItem();
            body.push(statement);
            if (statement.expression.type !== Syntax.Literal) {
                // this is not directive
                break;
            }
            directive = source.slice(token.start + 1, token.end - 1);
            if (directive === 'use strict') {
                strict = true;
                if (firstRestricted) {
                    tolerateUnexpectedToken(firstRestricted, Messages.StrictOctalLiteral);
                }
            } else {
                if (!firstRestricted && token.octal) {
                    firstRestricted = token;
                }
            }
        }

        oldLabelSet = state.labelSet;
        oldInIteration = state.inIteration;
        oldInSwitch = state.inSwitch;
        oldInFunctionBody = state.inFunctionBody;
        oldParenthesisCount = state.parenthesizedCount;

        state.labelSet = {};
        state.inIteration = false;
        state.inSwitch = false;
        state.inFunctionBody = true;
        state.parenthesizedCount = 0;

        while (startIndex < length) {
            if (match('}')) {
                break;
            }
            body.push(parseStatementListItem());
        }

        expect('}');

        state.labelSet = oldLabelSet;
        state.inIteration = oldInIteration;
        state.inSwitch = oldInSwitch;
        state.inFunctionBody = oldInFunctionBody;
        state.parenthesizedCount = oldParenthesisCount;

        return node.finishBlockStatement(body);
    }
1373130
public String getString() 
    {
        String string = super.getString();
        if ((string != null) && (string.length() > 0))
        {
            StringBuffer sb = new StringBuffer(string);
            if (sb.length() > m_iUnmaskedChars)
            {
                String strFiller = "" + FILLER;
                for (int i = 0; i < sb.length() - m_iUnmaskedChars; i++)
                {
                    sb.replace(i, i+1, strFiller);
                }
                string = sb.toString();
            }
        }
        return string;
    }
39424
def parse(self):
        
        standard_formatters = re.compile(r'\((.+?)\)', re.IGNORECASE)
        return standard_formatters.findall(self._fmt)
135707
function parseMultiplication(){

		$return = $m = $this->parseOperand();
		if( $return ){
			while( true ){

				$isSpaced = $this->isWhitespace( -1 );

				if( $this->PeekReg('/\\G\/[*\/]/') ){
					break;
				}

				$op = $this->MatchChar('/');
				if( !$op ){
					$op = $this->MatchChar('*');
					if( !$op ){
						break;
					}
				}

				$a = $this->parseOperand();

				if(!$a) { break; }

				$m->parensInOp = true;
				$a->parensInOp = true;
				$return = $this->NewObj3('Less_Tree_Operation',array( $op, array( $return, $a ), $isSpaced) );
			}
		}
		return $return;

	}
304474
function(error, substitutions) {
		var text = error.text;
		if (substitutions) {
		  var field,start;
		  for (var i=0; i<substitutions.length; i++) {
			field = "{"+i+"}";
			start = text.indexOf(field);
			if(start > 0) {
				var part1 = text.substring(0,start);
				var part2 = text.substring(start+field.length);
				text = part1+substitutions[i]+part2;
			}
		  }
		}
		return text;
	}
1113306
def parse_str(self, s):
        
        self.object = self.parsed_class()
        in_section = None  # Holds name of FEH file section while traversing through file.
        for line in s.split('\n'):
            if line.lower().startswith('[end]'):
                # Leave section
                in_section = None
            elif line.startswith('['):
                # Enter section, sanitise `[Section Name]` to `section_name`
                in_section = line.strip().strip('[]').lower().replace(' ', '_')
            elif in_section:
                try:
                    # Call method `_section_section_name(line)`
                    getattr(self, '_section_' + in_section)(line.strip())
                except AttributeError:
                    pass  # Skip unsupported section
        return self.object
268071
def coloringfromstring(s):
    
    try:
        AST = compiler.parse(s)
    except SyntaxError:
        return
    else:
        try:
            if len(AST.getChildren()) > 1:
                ST = AST.getChildren()[1]
                if isinstance(ST, Stmt) and isinstance(ST.getChildren()[0],
                                                                     Discard):
                    d = ST.getChildren()[0].asList()[0]
        except (TypeError, AttributeError):
            pass
        else:
            if isinstance(d,Dict) and len(d.items) > 0:
                if all([isctype(i[0],str) for i in d.items]):
                    if all([isinstance(i[1],List) for i in d.items]):
                        if all([all([isctype(j,str) for j in i[1]]) for i in 
                                                                      d.items]):
                            return eval(s)
343715
private boolean substitute() {
		boolean madeChange = false;

		for (String key : backing.keySet()) {
			madeChange = madeChange || substitute(key);
		}

		return madeChange;
	}
1352772
def get_string(self):
    
    ostr = ''
    ostr += 'BaseError for ['+self._type+'] base: '+self.get_base()+"\n"
    if self._observable.get_error_probability() > 0:
      ostr += '  Homopolymer set:'+"\n"
      ostr += '    '+str(self.get_homopolymer())+"\n"
      ostr += '  Observable:'+"\n"
      ostr += '    type is: '+str(self.get_observable_type())+"\n"
      ostr += '    P(error): '+str(self._observable.get_error_probability())+"\n"
      ostr += '    Elength:  '+str(self._observable.get_attributable_length())+"\n"
    before = self._unobservable.get_before_type()
    after = self._unobservable.get_after_type()
    if before or after:
      ostr += '  Unobservable '
      if self._type == 'query': ostr += 'deletion:'+"\n"
      else: ostr += 'insertion:'+"\n"
      ostr += '    P(error): '+str(self._unobservable.get_error_probability())+"\n"
      ostr += '    Elength:  '+str(self._unobservable.get_attributable_length())+"\n"
      if before:
        ostr += '    before: '+"\n"
        ostr += '      P(error): '+str(self._unobservable.get_before_probability())+"\n"
        ostr += '      '+str(before)+"\n"
      if after:
        ostr += '    after:'+"\n"
        ostr += '      P(error): '+str(self._unobservable.get_after_probability())+"\n"
        ostr += '      '+str(after)+"\n"
    return ostr