fn: parse
[contents]

Contents

Syntax

The syntax for parse calls is:

f++:  
parse(int, string)

n++:  
@parse(int, string)

Description

The parse function is for parsing f++/n++ code multiple times, it takes an integer parameter specifying the number of times to parse followed by a string parameter to parse the number of times specified.

f++ example

Example of parse being used with f++:

function(funcA)
{
	console($[params[0]]);
}

function(funcB)
{
	write{!p}(ofile, "funcA('hello\, world')")
}

parse(2, "funcB()")

n++ example

Examples of parse being used with n++:

@function(funcA)
{
	@console($[params[0]]);
}

@function(funcB)
{
	@write{!p}(ofile, "@funcA('hello\, world')")
}

@parse(2, "@funcB()")

@:=(string, s1="hello", s2="$[s1]", s3="$[s2]")
@console("@parse(3, $[s3])")

Note that the above is slightly different to the following:

@:=(string, s1="hello", s2="s1", s3="s2")
@console("$[$[$[s3]]]")