DIP 50 - AST macros

Jacob Carlborg doob at me.com
Mon Nov 11 06:13:30 PST 2013


On 2013-11-11 14:36, Rikki Cattermole wrote:

> Jacob mentioned originally he wanted to create a compiler error. Or at
> least thats is how I took it. Hence pragma(error, "text");
> We can already message out at both compile and runtime its simply does
> the compiler recognise it as an error part.

"error" would be just a single function that is available in the context 
parameter. There would be many others. From the DIP:

* The arguments used when the compiler was invoked

* Functions for emitting messages of various verbosity level, like 
error, warning and info

* Functions for querying various types of settings/options, like which 
versions are defined, is "debug" or "release" defined and so on

* In general providing as much as possible of what the compiler knows 
about the compile run

* The context should have an associative array with references to all 
scoped variables at initiation point.

-- 
/Jacob Carlborg


More information about the Digitalmars-d mailing list