This commit is contained in:
Kartik K. Agaram 2016-05-25 18:56:37 -07:00
parent 67a180e330
commit 9c30b38376
2 changed files with 5 additions and 5 deletions

View File

@ -57,7 +57,7 @@ struct reagent {
double value;
bool initialized;
// End reagent Fields
reagent(string s);
reagent(const string& s);
reagent() :type(NULL), value(0), initialized(false) {}
~reagent();
void clear();
@ -258,7 +258,7 @@ void instruction::clear() { is_label=false; label.clear(); name.clear(); old_nam
bool instruction::is_empty() { return !is_label && name.empty(); }
// Reagents have the form <name>:<type>:<type>:.../<property>/<property>/...
reagent::reagent(string s) :original_string(s), type(NULL), value(0), initialized(false) {
reagent::reagent(const string& s) :original_string(s), type(NULL), value(0), initialized(false) {
// Parsing reagent(string s)
istringstream in(s);
in >> std::noskipws;

View File

@ -107,10 +107,10 @@ void slurp_quoted_comment_aware(istream& in, ostream& out) {
:(after "Parsing reagent(string s)")
if (s.at(0) == '[') {
assert(*s.rbegin() == ']');
// delete [] delimiters
s.erase(0, 1);
strip_last(s);
name = s;
// delete [] delimiters
name.erase(0, 1);
strip_last(name);
type = new type_tree("literal-string", 0);
return;
}