below

Macro below 

Source
below!() { /* proc-macro */ }
Expand description

Generates code to be inserted below a class or function definition.

This macro creates a TsStream prefixed with a special marker comment (/* @macroforge:below */) that instructs the macroforge runtime to place the generated code after the decorated definition.

§Use Cases

  • Adding prototype extensions after a class definition
  • Generating registration or initialization code
  • Adding exports or module augmentations

§Example

let class_name = "User";
let stream = below! {
    @{class_name}.prototype.toJSON = function() {
        return { ...this };
    };
};
// Result: /* @macroforge:below */User.prototype.toJSON = function() { ... };

§Syntax

Supports the same template syntax as ts_template!.