add macros support

Macros should be declared as `aw_macro<name,arg1,arg2,...>{{macro body}}` and then
they may be used as `aw_name<arg1,arg2,...>{{}}`. It just puts `macro
body` to pattern and replaces arguments to provided ones according to
macro call. E.g.:
```
$aw_macro<test,phrase>{{phrase}}$aw_test<hello world>{{}}
```
will transform into
```
hello world
```
This commit is contained in:
2016-07-01 02:21:48 +03:00
parent 8e8ac2f3c7
commit 2f88c7ae60
3 changed files with 44 additions and 0 deletions

View File

@ -43,6 +43,7 @@ QString insertAllKeys(QString code, const QStringList keys);
QString insertKeyCount(QString code, const QStringList keys);
QString insertKeyNames(QString code, const QStringList keys);
QString insertKeys(QString code, const QStringList keys);
QString insertMacros(QString code);
// find methods
QStringList findKeys(const QString code, const QStringList keys,
const bool isBars);