Farkle


DesigntimeFarkle Module

Functions to set metadata for designtime Farkles. With few exceptions, these functions will have to be applied to the topmost designtime Farkle that will get build, or they will have no effect. Designime Farkles that were applied the functions of this module must not be used with the original designtime Farkles in the same context; only one grammar symbol will be created, with undefined behavior.

Functions and values

Function or value Description

addBlockComment commentStart commentEnd df

Full Usage: addBlockComment commentStart commentEnd df

Parameters:
    commentStart : string
    commentEnd : string
    df : 'a

Returns: 'a

Adds a block comment to the given `DesigntimeFarkle`.

commentStart : string
commentEnd : string
df : 'a
Returns: 'a

addLineComment commentStart df

Full Usage: addLineComment commentStart df

Parameters:
    commentStart : string
    df : 'a

Returns: 'a

Adds a line comment to the given `DesigntimeFarkle`.

commentStart : string
df : 'a
Returns: 'a

addNoiseSymbol name regex df

Full Usage: addNoiseSymbol name regex df

Parameters:
    name : string
    regex : Regex
    df : 'a

Returns: 'a

Adds a name-`Regex` pair of noise symbols to the given `DesigntimeFarkle`.

name : string
regex : Regex
df : 'a
Returns: 'a

autoWhitespace flag df

Full Usage: autoWhitespace flag df

Parameters:
    flag : bool
    df : 'a

Returns: 'a

Sets the `AutoWhitespace` field of a `DesigntimeFarkle`'s metadata.

flag : bool
df : 'a
Returns: 'a

caseSensitive flag df

Full Usage: caseSensitive flag df

Parameters:
    flag : bool
    df : 'a

Returns: 'a

Sets the `CaseSensitive` field of a `DesigntimeFarkle`'s metadata.

flag : bool
df : 'a
Returns: 'a

cast df

Full Usage: cast df

Parameters:
Returns: DesigntimeFarkle<obj>

Converts an untyped designtime Farkle to a typed one that returns an object. The object the designtime Farkle this function will return is undefined. This function is no longer useful for applying metadata to untyped designtime Farkles.

df : DesigntimeFarkle
Returns: DesigntimeFarkle<obj>

rename newName df

Full Usage: rename newName df

Parameters:
    newName : string
    df : 'a

Returns: 'a

Changes the name of a designtime Farkle. This function can be applied anywhere, not only to the topmost one, like with other metadata changes.

newName : string
df : 'a
Returns: 'a

withMetadata metadata df

Full Usage: withMetadata metadata df

Parameters:
Returns: 'a

Sets a `GrammarMetadata` object to a designtime Farkle. Most other functions in this module are convenience wrappers over this function.

metadata : GrammarMetadata
df : 'a
Returns: 'a

withOperatorScope opScope df

Full Usage: withOperatorScope opScope df

Parameters:
Returns: 'a

Sets an `OperatorScope` object to a designtime Farkle. This function can be applied in designtime Farkles that are not the topmost ones. Applying this function many times will discard the existing operator scope.

opScope : OperatorScope
df : 'a
Returns: 'a