Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/util/irep_ids.def
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/// \file List of irep id names and values.
/// For an explanation of how this works, see irep_ids.h.

IREP_ID_TWO(empty_string, )
IREP_ID_ONE(let)
IREP_ID_ONE(nil)
Expand Down
11 changes: 11 additions & 0 deletions src/util/irep_ids.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,17 @@ Author: Reuben Thomas, reuben.thomas@me.com
#include "dstring.h"
#endif

/// \file The irep_ids are generated using a technique called
/// [X-macros](https://en.wikipedia.org/wiki/X_Macro).
/// The ids are defined in the file irep_ids.def, using a pair of macros
/// `IREP_ID_ONE` and `IREP_ID_TWO`.
/// Definitions of the form `IREP_ID_ONE(param)` will be converted into a
/// const extern irep_idt with the variable name `ID_param` and the string
/// value `"param"`.
/// Definitions of the form `IREP_ID_TWO(param, contents)` will be converted
/// into a const extern irep_idt with the variable name `ID_param` and the
/// string value `"contents"`.

enum class idt:unsigned
{
#define IREP_ID_ONE(the_id) id_##the_id,
Expand Down