Skip to main content

Module feature

Module feature 

Source
Expand description

The grammar feature union forms (docs/grammar/feature-union.md).

One table describes every expression kind, every operation of the scanner and action language and every grammar declaration the feature union adds, and the native listing, links and JSON codecs read and write them from that table, so the serializations stay in step with each other and with js/src/grammar-feature-forms.js.

Structs§

FeatureForm
One feature expression form or one operation: a head word and its field values, in the order of FEATURE_EXPRESSION_FORMS or OPERATION_FORMS.
GrammarDeclarations
The grammar-level declarations of the feature union.
GrammarMacro
A macro declaration: macro NAME(P, ...) = EXPRESSION.
GrammarScanner
An external scanner declaration.
RuleAttributes
The optional parts of a rule the feature union adds.

Enums§

ByteClassItem
One item of a byte class.
FeatureExpr
An expression of the grammar feature union.
FieldType
The type of one field of a feature form or an operation.
FieldValue
The value of one field of a feature form or an operation.
OperationCategory
Whether an operation is a statement, a condition or a value.
PrecedenceEntry
One entry of a precedence order: a named precedence or a rule, whose productions it ranks.
UnicodeClassItem
One item of a character class that names Unicode properties.

Constants§

FEATURE_EXPRESSION_FORMS
The expression kinds the feature union adds, with their fields in listing order.
MATCHING_MODES
The ways a grammar may match: generalized (every alternative), PEG (first and greedy) or longest (generalized, ties going to the longer token).
MAX_INTEGER_DIGITS
The longest integer a form may spell, in decimal digits.
OPERATION_FORMS
The operation language of external scanners, semantic actions and predicates, with each operation’s category and fields in listing order.
SETTLING_STEPS
The steps that settle two parses of one text that end alike, as a grammar’s (settling STEP ...) declares them.

Functions§

check_integer
Checks the text of an integer field: an optional - and at most 15 digits.
class_expression
A character class: a plain GrammarExpr::CharClass when every item is a character or a range, otherwise a FeatureExpr::UnicodeClass.
default_settling
The settling of a grammar that declares none, by its matching.
feature_expression_fields
The fields of the feature expression form head, when it is one.
operation_form
The category and fields of the operation head, when it is one.
settling_problem
Why steps is no settling, or None: every step is known and given once, and exactly the last one settles a tie.

Type Aliases§

FormFields
The fields of one form, as (key, type) pairs in listing order.
Operation
One operation of the scanner and action language.