FunnelWeb Syntax
Created on 2022-09-09T08:04:36-05:00
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 <
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@@$@ @{@- if (llDetectedTouch(0) == g_keyholder)@} @a@ @$@ @{ g_menu_user = llDetectedKey(0); llSobProfusely(); @} @$@ @{ touch_start(integer n) { // time to sob profusely @ { @ } else { llWhisper(llDetectedTouch(0), "fuck off UwU"); } } @} @o@ @{ default { @ } @}