FunnelWeb Syntax

Created: 2022-09-09T08:04:36-05:00

Return to the Index

A scanner walks over text and breaks it in to directives and blocks.

The special character (@ by default) captures itself and the next character as a special token. This token has meaning later in the parsing phases. Spans between special captures are known as free text.

Another phase looks at free text and directive tokens. Directive tokens may cause more free text and directives to be consumed; for example @< will take the next span of free text to mean the name of a macro. @> is another directive (causes the free text span to be terminated). A macro then reads the next free span looking for "==" or "+=" which is then punctuated by @{ (starts a macro body) and so on.

Unlike [no]web the <<blah>>== syntax is wrapped with escapes. So you have @<blah@> to reference a macro. Or @<blah@>== to create one and @<blah@>+= to create one through multiple macro invocations.

Macro expansion is deliberately simple and happens in a pass after everything is figured out. This allows "unrestricted forward referencing." Since macro labels are assigned in a purely statically analyzable way

@a@<Dealing with Keyholders@>
@$@<If the toucher has privileges@>@{@-
if (llDetectedTouch(0) == g_keyholder)@}

@a@<Dealing with Menu Interactions@>
@$@<Start a new menu session@>@{
g_menu_user = llDetectedKey(0);
llSobProfusely();
@}

@$@<Handle touches@>@{
touch_start(integer n) {
// time to sob profusely
@<If the toucher has privileges@> {
@<Start a new menu session@>
} else {
llWhisper(llDetectedTouch(0), "fuck off UwU");
}
}
@}

@o@<quinn.lsl@>@{
default {
@<Handle touches@>
}
@}