2024년 3월 10일 오후 5:50
- What follows is a formal presentation of the syntax of the Pragma: \procedure, using railroad diagrams.
\procedure
There are 2 types of procedure definitions
- Single line definitions
- Multi line definitions
Single Line
Single line definitions should only be used for very short bodies, where the procedure name, params and the body fit into 1 line terminated with a line-feed.
Multi Line
The majority of procedure definitions will have a body, that spans over several lines of wikitext. Those procedure definitions are terminated using the "\end" pragma
The procedure-name is a sequence of non-whitespace characters other than (
or >
.
procedure-name
is a sequence of letters (A
–Z
,a
–z
), digits (0
–9
), hyphens (-
) and underscores (_
)body
is wikitext including nested proceduresspace
denotes a sequence of whitespace characters
params
The parameter declaration list (params)
has the following syntax:
sep
is any sequence of characters that does not match aparam-name
.
Among other things, this includes commas, spaces and linefeeds.
Each individual parameter
has the following syntax:
param-name
is a sequence of letters (A
–Z
,a
–z
), digits (0
–9
), hyphens (-
) and underscores (_
).default
is an optional value of a parameter is specified as follows:
body
The body
of the definition has the following syntax:
wikitext
is any sequence of characters that doesn't terminate the macro definition.- If nested procedures are used they need to be at the start of the wikitext. There are the same rules as if the wikitext would be in a tiddler.
- Pragmas need to be before standard wikitext.
lf
denotes a linefeed.