Commit f9f34ed9 authored by snuverink_j's avatar snuverink_j
Browse files

no direct evaluation with VALUE command; add parameter to parseShortCut

parent 57c8ae00
...@@ -129,7 +129,7 @@ void Object::parse(Statement &stat) { ...@@ -129,7 +129,7 @@ void Object::parse(Statement &stat) {
} }
void Object::parseShortcut(Statement &stat) { void Object::parseShortcut(Statement &stat, bool eval) {
// Only one attribute. // Only one attribute.
if(stat.delimiter(',')) { if(stat.delimiter(',')) {
stat.mark(); stat.mark();
...@@ -138,7 +138,7 @@ void Object::parseShortcut(Statement &stat) { ...@@ -138,7 +138,7 @@ void Object::parseShortcut(Statement &stat) {
if(stat.word(name)) { if(stat.word(name)) {
if(stat.delimiter('=')) { if(stat.delimiter('=')) {
if(Attribute *attr = findAttribute(name)) { if(Attribute *attr = findAttribute(name)) {
attr->parse(stat, true); attr->parse(stat, eval);
return; return;
} else { } else {
throw ParseError("Object::parse()", "Object \"" + getOpalName() + throw ParseError("Object::parse()", "Object \"" + getOpalName() +
......
...@@ -111,7 +111,9 @@ public: ...@@ -111,7 +111,9 @@ public:
/// Parser for single-attribute commands. /// Parser for single-attribute commands.
// This parser allows to use unnamed attributes for command which // This parser allows to use unnamed attributes for command which
// have only one attribute. // have only one attribute.
virtual void parseShortcut(Statement &); // If [b]eval[/b] is false, then the attribute is not evaluated immediately
// even if it the delimiter is ``=''.
virtual void parseShortcut(Statement &, bool eval = true);
/// Print the object. /// Print the object.
// Print a OPAL-readable image of [b]this[/b] on the given output stream. // Print a OPAL-readable image of [b]this[/b] on the given output stream.
......
...@@ -69,7 +69,7 @@ void Value::execute() { ...@@ -69,7 +69,7 @@ void Value::execute() {
// *gmsg.precision(old_prec); // *gmsg.precision(old_prec);
} }
void Value::parse(Statement &statement) { void Value::parse(Statement &statement) {
parseShortcut(statement); // parse, but don't evaluate (for printing mainly)
parseShortcut(statement, false);
} }
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment