![]() |
Zen
A cross-platform functional programming language
|
AST Node representing a string format expression. More...
#include <Ast.hpp>
Public Member Functions | |
| StringFormatExpr (const QualifiedType &type, const Expr &format, const Ast::DictList &list) | |
| Default constructor. | |
| const Expr & | getFormat () const |
| Returns the format expression. | |
| const Ast::DictList & | getList () const |
| Returns the dict holding the values to be inserted. | |
Private Member Functions | |
| virtual void | visit (Expr::Visitor &visitor) const |
| Abstract visitor function. | |
Private Attributes | |
| const Expr & | _format |
| The format expression. | |
| const Ast::DictList & | _list |
| The value dict. | |
AST Node representing a string format expression.
An string format expression takes a string format and inserts values from a dict into it. For example:
local y = "my name is %{name}" @ {@name:"renji"};
Here, @name is the key, and it's value is inserted into the string format at the location identfied by %{name}
| StringFormatExpr | ( | const QualifiedType & | type, |
| const Expr & | format, | ||
| const Ast::DictList & | list | ||
| ) | [inline] |
Default constructor.
| type | Expression type |
| format | The format expression |
| list | The dict holding values to be inserted into the format |
| const Expr& getFormat | ( | ) | const [inline] |
Returns the format expression.
| const Ast::DictList& getList | ( | ) | const [inline] |
Returns the dict holding the values to be inserted.
| void visit | ( | Expr::Visitor & | visitor | ) | const [private, virtual] |