On this page:
syntax_  class_  clause
syntax_  class_  clause.macro
8.12
7.13.8 Syntax Class Clause Macros🔗ℹ

The space for bindings of identifiers that implement syntax_class clauses.

Similar to defn.macro, but defines a name in the syntax_class_clause space as a clause form for use within a syntax_class body.

The compile-time body block returns the expansion result. The result must be a block of groups optionally followed by syntax patterns to be spliced in place of the macro use within a syntax_class body. The spliced syntax patterns can be supplied at most once.

syntax_class_clause.macro 'maybe_block $id $rhs_id':

  '«: fields: [$rhs_id, $('...')]

    | '$id: $('$')$rhs_id; $('...')'

    | '$id $('$')rhs0 $('...')':

        field [$rhs_id, $('...')] = ['$('$')rhs0 $('...')']»'

syntax_class Options:

  maybe_block options rhs

> match 'options 1 2'

  | '$(o :: Options)': [o.rhs, ...]

['1 2']

> match 'options:

           1 2

           3 4'

  | '$(o :: Options)': [o.rhs, ...]

['1 2', '3 4']