MacroExpander

Expands DDoc macros in a text.

Members

Functions

expandMacros
void expandMacros(cstring text)

Expands the macros in the text using the definitions from the table.

scanArguments
cstring[] scanArguments(cstring[] args, ref cchar* ref_p, cchar* textEnd)

Scans until the closing parenthesis is found. Sets p to one char past it.

warning
void warning(MID mid, cstring macroName)

Reports a warning message.

Static functions

expand
cstring expand(MacroTable mtable, cstring text, cstring filePath, Diagnostics diag = null)

Starts expanding the macros.

expandArguments
cstring expandArguments(cstring text, cstring[] args)

Expands "$+", "$0" - "$9" with argsn in text.

Variables

buffer
CharArray buffer;

Text buffer.

diag
Diagnostics diag;

Collects warning messages.

filePath
cstring filePath;

Used in warning messages.

margs
cstring[10] margs;

Currently parsed macro arguments.

mtable
MacroTable mtable;

Used to look up macros.

Meta