Module Macro.Pre

There is no default env, but you can add any of these to your env.

val ignore : ('a, string) macro

ignore is a macro that ignores all its parameters and returns the empty string.

This is good for comments within a string: "{ignore|This is a comment.}This is not."

val name : ('a, string) macro

name is a macro that returns its own name.

val parms : ('a, string) macro

parms is a macro that returns its parameter list as a string, with the parameters separated by a spaces.

val self : ?left:char -> ?sep:char -> ?right:char -> ('a, string) macro

(self ?left ?sep ?right) is a macro that returns a string representation of itself (with parameters expanded).

Quoting Metacharacters in the Default Syntax

N.B. These macros only work for the default syntax; if you change the syntax, you might need to provide your own quoters.

val left : ('a, string) macro

left is a macro that expands to left.

This means "{left}" is a way to quote the left parenthesis.

val sep : ('a, string) macro

sep is a macro that expands to sep.

This means "{sep}" is a way to quote the parameter separator.

val right : ('a, string) macro

right is a macro that expands to right.

This means "{right}" is a way to quote the right parenthesis.

String Manipulation

val trim : ('a, string) macro

trim is a macro that trims leading and trailing characters from its first parameter.

The default trimmed characters are Strings.whitespace. If you pass a second parameter, it is a string of the characters to be trimmed.

This macro just calls Strings.trim appropriately.