Macroprocessor: length() operator called on a string returns the number of characters
Closes DynareTeam/Dynare#1547issue#70
parent
5f1465f9d1
commit
88fab669c6
|
@ -329,6 +329,12 @@ StringMV::print()
|
|||
return "'" + value + "'";
|
||||
}
|
||||
|
||||
shared_ptr<IntMV>
|
||||
StringMV::length() noexcept(false)
|
||||
{
|
||||
return make_shared<IntMV>(value.length());
|
||||
}
|
||||
|
||||
FuncMV::FuncMV(vector<string> args_arg, string body_arg) :
|
||||
args{move(args_arg)}, body{move(body_arg)}
|
||||
{
|
||||
|
|
|
@ -161,6 +161,7 @@ public:
|
|||
//! Returns underlying string value
|
||||
string toString() override;
|
||||
string print() override;
|
||||
shared_ptr<IntMV> length() noexcept(false) override;
|
||||
};
|
||||
|
||||
class FuncMV : public MacroValue
|
||||
|
|
Loading…
Reference in New Issue