scandsp/src/dspparser.cxx
// ===========================================================================
// Process the # ADD statement, which at least in some cases adds includes.
// # ADD is not yet completely understood.  From an OnDisplay example, it's
// known not to simply replace the previous value.  Another example led me
// to wait before seeking to combine the old with the new, but it has to be
// attempted.
//
Process the # ADD statement, which at least in some cases adds includes.
ADD is not yet completely understood.  From an OnDisplay example, it's
known not to simply replace the previous value.  Another example led me
to wait before seeking to combine the old with the new, but it has to be
attempted.
Process the # ADD statement which at least in some cases adds includes . ADD is not yet completely understood . From an OnDisplay example it ' s known not to simply replace the previous value . Another example led me to wait before seeking to combine the old with the new but it has to be attempted .
static void addToEnvironment(DSPParser::an_env_map &env, const string &key, const string &value) {
    string updateVal = value;
    if (key == ";CPP") {
	DSPParser::an_env_map::iterator it = env.find(key);
	if (it != env.end()) {
	    updateVal = (*it).second;
	    ostream &mos = msg("Updating from $1 >>>>>>>>>>>>>>> $2", normal_sev) << updateVal << eoarg;
	    string mergable;
	    bool hasNonmergable;
	    mergableOptions(value, mergable, hasNonmergable);
	    if (hasNonmergable) {
		string oldMergable;
		bool oldHasNonmergable;
		mergableOptions(updateVal, oldMergable, oldHasNonmergable);
		updateVal = oldMergable;
	    }
	    updateVal.append(" ");
	    updateVal.append(value);
	    mos << updateVal << eoarg << eom;
	}
    }
    updateEnvironment(env, key, updateVal);
}
static void addToEnvironment ( DSPParser :: an_env_map & env , const string & key , const string & value ) { string updateVal = value ; if ( key == " " ) { DSPParser :: an_env_map :: iterator it = env . find ( key ) ; if ( it != env . end ( ) ) { updateVal = ( * it ) . second ; ostream & mos = msg ( " " , normal_sev ) << updateVal << eoarg ; string mergable ; bool hasNonmergable ; mergableOptions ( value , mergable , hasNonmergable ) ; if ( hasNonmergable ) { string oldMergable ; bool oldHasNonmergable ; mergableOptions ( updateVal , oldMergable , oldHasNonmergable ) ; updateVal = oldMergable ; } updateVal . append ( " " ) ; updateVal . append ( value ) ; mos << updateVal << eoarg << eom ; } } updateEnvironment ( env , key , updateVal ) ; }
Process the # ADD statement, which at least in some cases adds includes.
Process the # ADD statement which at least in some cases adds includes .
// Prepend oldMergable options. // Append all new options.