Update docs on char escapes in macro args

Fixes #415
This commit is contained in:
ISSOtm
2019-09-05 15:40:54 +02:00
parent 6fbb25c0da
commit 9faa5c7a9e

View File

@@ -583,16 +583,15 @@ If you want to use the rest, you need to use the keyword
.Ic SHIFT . .Ic SHIFT .
.Pp .Pp
Line continuations work as usual inside macros or lists of arguments of macros. Line continuations work as usual inside macros or lists of arguments of macros.
Strings, however, are a bit trickier. However, some characters need to be escaped, as in the following example:
The following example shows how to use strings as arguments for a macro:
.Pp .Pp
.Bd -literal -offset indent .Bd -literal -offset indent
PrintMacro : MACRO PrintMacro : MACRO
PRINTT \[rs]1 PRINTT \[rs]1
ENDM ENDM
PrintMacro STRCAT(\[rs]"Hello\[rs]"\[rs], \[rs] PrintMacro STRCAT("Hello"\[rs], \[rs]
\[rs]" world\[rs]\[rs]n\[rs]") " world\[rs]\[rs]n")
.Ed .Ed
.Pp .Pp
.Ic SHIFT .Ic SHIFT