neutralts::bif

Module parse_bif_declare

Source
Expand description

§{:declare; … :}

Defines a list of allowed words separated by spaces for the bif “allow”, no output.

{:declare; name >> words list :}

Note that declare must be defined in a file whose name contains the word “snippet”. An error will occur if an attempt is made to define it elsewhere.

§Modifiers:

{:^declare; ... :}

§No flags

§Wildcards

  • (.) Dot, that matches any character.
  • (?) Question, that matches exactly one character.
  • (*) Asterisk, that matches zero or more characters.

§Use app data

Assumes:

{
    "data": {
        "themes": [
            "sketchy",
            "flatly",
            "darkly",
            "slate",
            "united"
        ]
    }
}

Then:

{:declare; themes >>
    {:each; themes key theme >>
        {:;:} {:;theme:}
    :}
:}

Unprintable {:;:} is necessary to preserve a space between words.

§Examples

{:declare; example >>
    en-??
    en_??
    en.US
    en?UK
:}
{:declare; languages >>
    en
    en-??
    en_??
    es
    es-??
    es_??
:}
{:declare; templates >>
    *.ntpl
:}
{:declare; colors >> red green blue :}
{:declare; any >> * :}