Commit d056df32 authored by Sébastien Villemot's avatar Sébastien Villemot

Macroprocessor: length() operator called on a string returns the number of characters

Closes DynareTeam/Dynare#1547
parent d2900b14
......@@ -436,3 +436,9 @@ StringMV::in(const MacroValue *array) const throw (TypeError)
return new IntMV(driver, result);
}
const MacroValue *
StringMV::length() const throw (TypeError)
{
return new IntMV(driver, value.length());
}
......@@ -194,6 +194,7 @@ public:
/*! The first argument must be a string array. Returns a string array. */
virtual const MacroValue *append(const MacroValue *array) const throw (TypeError);
virtual const MacroValue *in(const MacroValue *array) const throw (TypeError);
virtual const MacroValue *length() const throw (TypeError);
};
//! Represents an array in macro language
......
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