-
Notifications
You must be signed in to change notification settings - Fork 0
Attributes #7
Copy link
Copy link
Open
Labels
feature requestNew feature or requestNew feature or request
Description
Attributes restrict the possible values a syntax tree node can have in given properties.
class LetDeclaration extends SyntaxTreeNode {
static pattern = new Caten(
new Maybe(
new Equals('topLevel', true),
'export',
),
'let',
'identifier',
'=',
'...',
);
}
// Allows matching "export let foo = ..."
Match('variable', LetDeclaration, { topLevel: true })
// Does not match "export let foo = ..."
Match('variable', LetDeclaration, { topLevel: false })
// Grammar conflict between reducing with `topLevel: false` and `topLevel: true`.
Match('variable', LetDeclaration)
Attributes can be nested and can restrict nested syntax tree nodes.
Match('prop', Symbol, { variable: { topLevel: true } })
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
feature requestNew feature or requestNew feature or request