fea_rs/token_tree/
token.rs

1/// Kinds of tokens assigned during lexing and parsing.
2///
3/// This includes the set of raw tokens that are generated during lexing,
4/// but also includes richer information about the parsed FEA that is used to
5/// assign type information to collections of tokens ('nodes').
6#[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)]
7#[allow(missing_docs)]
8#[repr(u16)]
9#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
10pub enum Kind {
11    Eof, // the end of the input stream
12    // a name or a keyword or any other block of non-whitespace.
13    // we will frequently have to disambiguate this based on context.
14    Ident,
15
16    String,
17    StringUnterminated, // an error handled at a higher level
18    Number,
19    Octal,
20    Hex,      // an error handled at a higher level
21    HexEmpty, // naked 0x
22    Float,
23
24    // experimental
25    NumberSuffix, // 'n' 'd' or 'u'
26
27    Whitespace,
28    Comment,
29
30    // special symbols
31    Semi,
32    Colon,
33    Comma,
34    Backslash,
35    Hyphen,
36    Eq,
37    LBrace,
38    RBrace,
39    LSquare,
40    RSquare,
41    LParen,
42    RParen,
43    LAngle,
44    RAngle,
45    SingleQuote,
46
47    NamedGlyphClass,
48    Cid,
49
50    // top-level keywords
51    TableKw,
52    LookupKw,
53    LanguagesystemKw,
54    AnchorDefKw,
55    FeatureKw,
56    MarkClassKw,
57    AnonKw, // 'anon' and 'anonymous'
58    ConditionSetKw,
59    VariationKw,
60
61    // other keywords
62    AnchorKw,
63    ByKw,
64    ContourpointKw,
65    CursiveKw,
66    DeviceKw,
67    EnumKw, // 'enum' and 'enumerate'
68    ExcludeDfltKw,
69    FromKw,
70    IgnoreKw,
71    IgnoreBaseGlyphsKw,
72    IgnoreLigaturesKw,
73    IgnoreMarksKw,
74    IncludeKw,
75    IncludeDfltKw,
76    LanguageKw,
77    LookupflagKw,
78    MarkKw,
79    MarkAttachmentTypeKw,
80    NameIdKw,
81    NullKw,
82    ParametersKw,
83    PosKw, // 'pos' and 'position'
84    RequiredKw,
85    RightToLeftKw,
86    RsubKw, // 'rsub' and 'reversesub'
87    ScriptKw,
88    SubKw, // 'sub' and 'substitute'
89    SubtableKw,
90    UseExtensionKw,
91    UseMarkFilteringSetKw,
92    ValueRecordDefKw,
93
94    // keywords only in specific table contexts:
95    HorizAxisBaseScriptListKw,   //BASE table
96    HorizAxisBaseTagListKw,      //BASE table
97    HorizAxisMinMaxKw,           //BASE table
98    VertAxisBaseScriptListKw,    //BASE table
99    VertAxisBaseTagListKw,       //BASE table
100    VertAxisMinMaxKw,            //BASE table
101    AttachKw,                    //GDEF table
102    GlyphClassDefKw,             //GDEF table
103    LigatureCaretByDevKw,        //GDEF table
104    LigatureCaretByIndexKw,      //GDEF table
105    LigatureCaretByPosKw,        //GDEF table
106    MarkAttachClassKw,           //GDEF table
107    FontRevisionKw,              //head table
108    AscenderKw,                  //hhea table
109    CaretOffsetKw,               //hhea table
110    DescenderKw,                 //hhea table
111    LineGapKw,                   //hhea table
112    CapHeightKw,                 //OS/2 table
113    CodePageRangeKw,             //OS/2 table
114    PanoseKw,                    //OS/2 table
115    TypoAscenderKw,              //OS/2 table
116    TypoDescenderKw,             //OS/2 table
117    TypoLineGapKw,               //OS/2 table
118    UnicodeRangeKw,              //OS/2 table
119    VendorKw,                    //OS/2 table
120    WinAscentKw,                 //OS/2 table
121    WinDescentKw,                //OS/2 table
122    XHeightKw,                   //OS/2 table
123    SizemenunameKw,              //size feature
124    VertTypoAscenderKw,          //vhea table
125    VertTypoDescenderKw,         //vhea table
126    VertTypoLineGapKw,           //vhea table
127    VertAdvanceYKw,              //vmtx table
128    VertOriginYKw,               //vmtx table
129    ElidedFallbackNameKw,        //STAT table
130    ElidedFallbackNameIDKw,      //STAT table
131    DesignAxisKw,                //STAT table
132    AxisValueKw,                 //STAT table
133    FlagKw,                      //STAT table
134    LocationKw,                  //STAT table
135    ElidableAxisValueNameKw,     //STAT table
136    OlderSiblingFontAttributeKw, //STAT table
137
138    // not technically a keyword but we lex and treat contextually:
139    FeatureNamesKw,            // ss01-ss20
140    NameKw,                    // ss01-ss20
141    CvParametersKw,            // cv01-cv99
142    FeatUiLabelNameIdKw,       // cv01-cv99
143    FeatUiTooltipTextNameIdKw, // cv01-cv99
144    SampleTextNameIdKw,        // cv01-cv99
145    ParamUiLabelNameIdKw,      // cv01-cv99
146    CharacterKw,               // cv01-cv99
147    Path,
148
149    SourceFile, // scope of a file
150
151    // not technically keywords and not lexed, but assigned during parsing
152    // in gsub/gpos:
153    LigatureKw,
154    BaseKw,
155
156    // not lexed
157    GlyphRange,
158    //Metric,
159    Label,
160    Tag,
161    GlyphName,
162    // an ambiguious name, like a-z, which requires a glyphset to disambiguate.
163    GlyphNameOrRange,
164    GlyphClass,
165
166    // general purpose table node
167    TableEntryNode,
168    // ## node-only tokens, assigned during parsing ##
169
170    // a catchall, includes gsub nodes with errors
171    GsubNode,
172    // a contextual or chaining contextual rule that needs to be rewritten.
173    // when the sink sees a node finished with this type, it rewrites it before
174    // adding it to the parent.
175    GsubNodeNeedsRewrite,
176
177    /// Single
178    GsubType1,
179    /// Multiple
180    GsubType2,
181    /// Alternate
182    GsubType3,
183    /// Ligature
184    GsubType4,
185    /// Contextual
186    GsubType5,
187    /// Chaining contextual
188    GsubType6,
189    /// Extension
190    GsubType7,
191    /// Reverse chaining contextual
192    GsubType8,
193    GsubIgnore,
194
195    // catchall, including gpos nodes with errors
196    GposNode,
197    // A node containing marked glyphs, and which needs to be rewritten.
198    GposNodeNeedsRewrite,
199
200    /// Single
201    GposType1,
202    /// Pair
203    GposType2,
204    /// Cursive
205    GposType3,
206    /// Mark-to-base
207    GposType4,
208    /// Mark-to-lig
209    GposType5,
210    /// Markt-mark
211    GposType6,
212    /// Contextual
213    GposType7,
214    /// Chained contextual
215    GposType8,
216    GposIgnore,
217
218    // context & chaining context rule components:
219    BacktrackSequence,
220    LookaheadSequence,
221    ContextSequence,
222    ContextGlyphNode,
223    InlineSubNode,
224    // there can be multiple ignore rules specified in the same block, separated
225    // by commas
226    IgnoreRuleStatementNode,
227
228    AnchorMarkNode,
229    LigatureComponentNode,
230    ValueRecordNode,
231    ValueRecordDefNode,
232    LookupRefNode,
233    LookupBlockNode,
234    ScriptRecordNode,
235    IncludeNode,
236    MarkClassNode,
237    AnchorNode,
238    DeviceNode,
239    AnchorDefNode,
240    AnonBlockNode,
241    GlyphClassDefNode,
242    LanguageSystemNode,
243    FeatureNode,
244    SizeMenuNameNode,
245    ParametersNode,
246    ScriptNode,
247    LanguageNode,
248    LookupFlagNode,
249    SubtableNode,
250    ConditionSetNode,
251    ConditionNode,
252    VariationNode,
253
254    VariableMetricNode,
255    LocationValueNode,
256    LocationSpecNode,
257    LocationSpecItemNode,
258    AxisLocationNode, // a number or float + optional suffix
259
260    TableNode,
261    HeadTableNode,
262    HeadFontRevisionNode,
263    HheaTableNode,
264    MetricValueNode, // shared between hhea, vhea, and os2
265    NumberValueNode, // used in os2
266    StringValueNode, // used in os2
267    Os2NumberListNode,
268    Os2FamilyClassNode,
269    NameTableNode,
270    NameRecordNode,
271    NameSpecNode,
272    BaseTableNode,
273    BaseTagListNode,
274    BaseScriptListNode,
275    BaseMinMaxNode,
276    BaseMinMaxFeatureNode,
277    GdefTableNode,
278    GdefClassDefNode,
279    GdefClassDefEntryNode,
280    GdefAttachNode,
281    GdefLigatureCaretNode,
282    Os2TableNode,
283    Os2PanoseNode,
284    Os2UnicodeRangeNode,
285    Os2CodePageRangeNode,
286    Os2VendorNode,
287    VheaTableNode,
288    VmtxTableNode,
289    VmtxEntryNode,
290    StatTableNode,
291    StatElidedFallbackNameNode,
292    StatDesignAxisNode,
293    StatAxisValueNode,
294    StatAxisValueLocationNode,
295    StatAxisValueFlagNode,
296    CvParamsNameNode,
297    AaltFeatureNode,
298
299    // glyphs syntax extension
300    Dollar,
301    Plus,
302    Asterisk,
303    Slash,
304    GlyphsNumberValueNode,
305    GlyphsNumberValueExprNode,
306    GlyphsNumberIdent,
307}
308
309impl Kind {
310    pub(crate) fn is_rule(&self) -> bool {
311        matches!(
312            self,
313            Self::GposType1
314                | Self::GposType2
315                | Self::GposType3
316                | Self::GposType4
317                | Self::GposType5
318                | Self::GposType6
319                | Self::GposType7
320                | Self::GposType8
321                | Self::GsubType1
322                | Self::GsubType2
323                | Self::GsubType3
324                | Self::GsubType4
325                | Self::GsubType5
326                | Self::GsubType6
327                | Self::GsubType7
328                | Self::GsubType8
329        )
330    }
331
332    pub(crate) fn is_trivia(self) -> bool {
333        matches!(self, Kind::Comment | Kind::Whitespace | Kind::Backslash)
334    }
335}
336
337impl std::fmt::Display for Kind {
338    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
339        match self {
340            Self::Eof => write!(f, "EOF"),
341            //Self::Tombstone => write!(f, "X_X"),
342            Self::SourceFile => write!(f, "FILE"),
343            Self::Ident => write!(f, "ID"),
344            Self::StringUnterminated => write!(f, "STR OPEN"),
345            Self::String => write!(f, "STR"),
346            Self::Number => write!(f, "NUM"),
347            Self::Octal => write!(f, "OCT"),
348            Self::Hex => write!(f, "HEX"),
349            Self::HexEmpty => write!(f, "HEX EMPTY"),
350            Self::NumberSuffix => write!(f, "SUFFIX"),
351            Self::Float => write!(f, "FLOAT"),
352            Self::Whitespace => write!(f, "WS"),
353            Self::Semi => write!(f, ";"),
354            Self::Colon => write!(f, ":"),
355            Self::Comma => write!(f, ","),
356            Self::Backslash => write!(f, "\\"),
357            Self::Hyphen => write!(f, "-"), // also minus
358            Self::Eq => write!(f, "="),
359            Self::LBrace => write!(f, "{{"),
360            Self::RBrace => write!(f, "}}"),
361            Self::LSquare => write!(f, "["),
362            Self::RSquare => write!(f, "]"),
363            Self::LParen => write!(f, "("),
364            Self::RParen => write!(f, ")"),
365            Self::LAngle => write!(f, "<"),
366            Self::RAngle => write!(f, ">"),
367            Self::SingleQuote => write!(f, "'"),
368            Self::Comment => write!(f, "#"),
369
370            Self::Tag => write!(f, "Tag"),
371            Self::Path => write!(f, "Path"),
372            Self::GlyphClass => write!(f, "GlyphClass"),
373            Self::NamedGlyphClass => write!(f, "@GlyphClass"),
374            Self::GlyphRange => write!(f, "GlyphRange"),
375            Self::GlyphName => write!(f, "GlyphName"),
376            Self::GlyphNameOrRange => write!(f, "GlyphNameOrRange"),
377            Self::Cid => write!(f, "CID"),
378            //Self::Metric => write!(f, "METRIC"),
379            Self::Label => write!(f, "LABEL"),
380
381            Self::TableKw => write!(f, "TableKw"),
382            Self::LookupKw => write!(f, "LookupKw"),
383            Self::LanguagesystemKw => write!(f, "LanguagesystemKw"),
384            Self::AnchorDefKw => write!(f, "AnchorDefKw"),
385            Self::FeatureKw => write!(f, "FeatureKw"),
386            Self::MarkClassKw => write!(f, "MarkClassKw"),
387            Self::AnonKw => write!(f, "AnonKw"),
388            Self::ConditionSetKw => write!(f, "ConditionSetKw"),
389            Self::VariationKw => write!(f, "VariationKw"),
390            Self::AnchorKw => write!(f, "AnchorKw"),
391            Self::ByKw => write!(f, "ByKw"),
392            Self::ContourpointKw => write!(f, "ContourpointKw"),
393            Self::CursiveKw => write!(f, "CursiveKw"),
394            Self::DeviceKw => write!(f, "DeviceKw"),
395            Self::EnumKw => write!(f, "EnumKw"),
396            Self::ExcludeDfltKw => write!(f, "ExcludeDfltKw"),
397            Self::FromKw => write!(f, "FromKw"),
398            Self::IgnoreKw => write!(f, "IgnoreKw"),
399            Self::IgnoreBaseGlyphsKw => write!(f, "IgnoreBaseGlyphsKw"),
400            Self::IgnoreLigaturesKw => write!(f, "IgnoreLigaturesKw"),
401            Self::IgnoreMarksKw => write!(f, "IgnoreMarksKw"),
402            Self::IncludeKw => write!(f, "IncludeKw"),
403            Self::IncludeDfltKw => write!(f, "IncludeDfltKw"),
404            Self::LanguageKw => write!(f, "LanguageKw"),
405            Self::LookupflagKw => write!(f, "LookupflagKw"),
406            Self::MarkKw => write!(f, "MarkKw"),
407            Self::MarkAttachmentTypeKw => write!(f, "MarkAttachmentTypeKw"),
408            Self::NameIdKw => write!(f, "NameIdKw"),
409            Self::NullKw => write!(f, "NullKw"),
410            Self::ParametersKw => write!(f, "ParametersKw"),
411            Self::PosKw => write!(f, "PosKw"),
412            Self::RequiredKw => write!(f, "RequiredKw"),
413            Self::RightToLeftKw => write!(f, "RightToLeftKw"),
414            Self::RsubKw => write!(f, "RsubKw"),
415            Self::ScriptKw => write!(f, "ScriptKw"),
416            Self::SubKw => write!(f, "SubKw"),
417            Self::SubtableKw => write!(f, "SubtableKw"),
418            Self::UseExtensionKw => write!(f, "UseExtensionKw"),
419            Self::UseMarkFilteringSetKw => write!(f, "UseMarkFilteringSetKw"),
420            Self::ValueRecordDefKw => write!(f, "ValueRecordDefKw"),
421            Self::HorizAxisBaseScriptListKw => write!(f, "HorizAxis.BaseScriptList"),
422            Self::HorizAxisBaseTagListKw => write!(f, "HorizAxis.BaseTagList"),
423            Self::HorizAxisMinMaxKw => write!(f, "HorizAxis.MinMax"),
424            Self::VertAxisBaseScriptListKw => write!(f, "VertAxis.BaseScriptList"),
425            Self::VertAxisBaseTagListKw => write!(f, "VertAxis.BaseTagList"),
426            Self::VertAxisMinMaxKw => write!(f, "VertAxis.MinMax"),
427            Self::AttachKw => write!(f, "Attach"),
428            Self::GlyphClassDefKw => write!(f, "GlyphClassDef"),
429            Self::LigatureCaretByDevKw => write!(f, "LigatureCaretByDev"),
430            Self::LigatureCaretByIndexKw => write!(f, "LigatureCaretByIndex"),
431            Self::LigatureCaretByPosKw => write!(f, "LigatureCaretByPos"),
432            Self::MarkAttachClassKw => write!(f, "MarkAttachClass"),
433            Self::FontRevisionKw => write!(f, "FontRevision"),
434            Self::AscenderKw => write!(f, "Ascender"),
435            Self::CaretOffsetKw => write!(f, "CaretOffset"),
436            Self::DescenderKw => write!(f, "Descender"),
437            Self::LineGapKw => write!(f, "LineGap"),
438            Self::CapHeightKw => write!(f, "CapHeight"),
439            Self::CodePageRangeKw => write!(f, "CodePageRange"),
440            Self::PanoseKw => write!(f, "Panose"),
441            Self::TypoAscenderKw => write!(f, "TypoAscender"),
442            Self::TypoDescenderKw => write!(f, "TypoDescender"),
443            Self::TypoLineGapKw => write!(f, "TypoLineGap"),
444            Self::UnicodeRangeKw => write!(f, "UnicodeRange"),
445            Self::VendorKw => write!(f, "Vendor"),
446            Self::WinAscentKw => write!(f, "winAscent"),
447            Self::WinDescentKw => write!(f, "winDescent"),
448            Self::XHeightKw => write!(f, "XHeight"),
449            Self::SizemenunameKw => write!(f, "sizemenuname"),
450            Self::VertTypoAscenderKw => write!(f, "VertTypoAscender"),
451            Self::VertTypoDescenderKw => write!(f, "VertTypoDescender"),
452            Self::VertTypoLineGapKw => write!(f, "VertTypoLineGap"),
453            Self::VertAdvanceYKw => write!(f, "VertAdvanceY"),
454            Self::VertOriginYKw => write!(f, "VertOriginY"),
455            Self::ElidedFallbackNameKw => write!(f, "ElidedFallbackName"),
456            Self::ElidedFallbackNameIDKw => write!(f, "ElidedFallbackNameID"),
457            Self::DesignAxisKw => write!(f, "DesignAxis"),
458            Self::AxisValueKw => write!(f, "AxisValue"),
459            Self::FlagKw => write!(f, "flag"),
460            Self::LocationKw => write!(f, "location"),
461            Self::ElidableAxisValueNameKw => write!(f, "ElidableAxisValueName"),
462            Self::OlderSiblingFontAttributeKw => write!(f, "OlderSiblingFontAttribute"),
463
464            Self::FeatureNamesKw => write!(f, "FeatureNamesKw"),
465            Self::NameKw => write!(f, "NameKw"),
466            Self::CvParametersKw => write!(f, "CvParametersKw"),
467            Self::FeatUiLabelNameIdKw => write!(f, "FeatUiLabelNameIdKw"),
468            Self::FeatUiTooltipTextNameIdKw => write!(f, "FeatUiTooltipTextNameIdKw"),
469            Self::SampleTextNameIdKw => write!(f, "SampleTextNameId"),
470            Self::ParamUiLabelNameIdKw => write!(f, "ParamUiLabelNameId"),
471            Self::CharacterKw => write!(f, "CharacterKw"),
472
473            Self::LigatureKw => write!(f, "LigatureKw"),
474            Self::BaseKw => write!(f, "BaseKw"),
475
476            Self::AnchorMarkNode => write!(f, "AnchorMarkNode"),
477            Self::LigatureComponentNode => write!(f, "LigatureComponentNode"),
478            Self::ValueRecordNode => write!(f, "ValueRecordNode"),
479            Self::ValueRecordDefNode => write!(f, "ValueRecordDefNode"),
480            Self::GsubNode => write!(f, "GsubNode"),
481            Self::GsubNodeNeedsRewrite => write!(f, "GsubNodeNeedsRewrite"),
482            Self::GsubType1 => write!(f, "GsubType1"),
483            Self::GsubType2 => write!(f, "GsubType2"),
484            Self::GsubType3 => write!(f, "GsubType3"),
485            Self::GsubType4 => write!(f, "GsubType4"),
486            Self::GsubType5 => write!(f, "GsubType5"),
487            Self::GsubType6 => write!(f, "GsubType6"),
488            Self::GsubType7 => write!(f, "GsubType7"),
489            Self::GsubType8 => write!(f, "GsubType8"),
490            Self::GsubIgnore => write!(f, "GsubIgnore"),
491            Self::GposNode => write!(f, "GposNode"),
492            Self::GposNodeNeedsRewrite => write!(f, "GposNodeNeedsRewrite"),
493            Self::GposType1 => write!(f, "GposType1"),
494            Self::GposType2 => write!(f, "GposType2"),
495            Self::GposType3 => write!(f, "GposType3"),
496            Self::GposType4 => write!(f, "GposType4"),
497            Self::GposType5 => write!(f, "GposType5"),
498            Self::GposType6 => write!(f, "GposType6"),
499            Self::GposType7 => write!(f, "GposType7"),
500            Self::GposType8 => write!(f, "GposType8"),
501            Self::GposIgnore => write!(f, "GposIgnore"),
502
503            Self::BacktrackSequence => write!(f, "BacktrackSequence"),
504            Self::LookaheadSequence => write!(f, "LookaheadSequence"),
505            Self::ContextSequence => write!(f, "ContextSequence"),
506            Self::ContextGlyphNode => write!(f, "ContextGlyphNode"),
507            Self::InlineSubNode => write!(f, "InlineSubNode"),
508            Self::IgnoreRuleStatementNode => write!(f, "IgnoreRuleStatementNode"),
509
510            Self::LookupRefNode => write!(f, "LookupRefNode"),
511            Self::LookupBlockNode => write!(f, "LookupBlockNode"),
512            Self::ScriptRecordNode => write!(f, "ScriptRecoordNode"),
513            Self::TableEntryNode => write!(f, "TableEntryNode"),
514            Self::IncludeNode => write!(f, "IncludeNode"),
515            Self::MarkClassNode => write!(f, "MarkClassNode"),
516            Self::AnchorDefNode => write!(f, "AnchorDefNode"),
517            Self::AnchorNode => write!(f, "AnchorNode"),
518            Self::ConditionSetNode => write!(f, "ConditionSetNode"),
519            Self::ConditionNode => write!(f, "ConditionNode"),
520            Self::VariationNode => write!(f, "VariationNode"),
521            Self::VariableMetricNode => write!(f, "VariableMetricNode"),
522            Self::LocationValueNode => write!(f, "LocationValueNode"),
523            Self::LocationSpecNode => write!(f, "LocationSpecNode"),
524            Self::LocationSpecItemNode => write!(f, "LocationSpecItemNode"),
525            Self::AxisLocationNode => write!(f, "AxisLocationNode"),
526
527            Self::DeviceNode => write!(f, "DeviceNode"),
528            Self::AnonBlockNode => write!(f, "AnonBlockNode"),
529            Self::GlyphClassDefNode => write!(f, "GlyphClassDefNode"),
530            Self::LanguageSystemNode => write!(f, "LanguageSystemNode"),
531            Self::FeatureNode => write!(f, "FeatureNode"),
532            Self::SizeMenuNameNode => write!(f, "SizeMenuNameNode"),
533            Self::ParametersNode => write!(f, "ParametersNode"),
534            Self::ScriptNode => write!(f, "ScriptNode"),
535            Self::LanguageNode => write!(f, "LanguageNode"),
536            Self::LookupFlagNode => write!(f, "LookupFlagNode"),
537            Self::SubtableNode => write!(f, "SubtableNode"),
538            Self::TableNode => write!(f, "TableNode"),
539            Self::HeadTableNode => write!(f, "HeadTableNode"),
540            Self::HheaTableNode => write!(f, "HheaTableNode"),
541            Self::NameTableNode => write!(f, "NameTableNode"),
542            Self::BaseTableNode => write!(f, "BaseTableNode"),
543            Self::BaseTagListNode => write!(f, "BaseTagListNode"),
544            Self::BaseScriptListNode => write!(f, "BaseScriptListNode"),
545            Self::BaseMinMaxNode => write!(f, "BaseMinMaxNode"),
546            Self::BaseMinMaxFeatureNode => write!(f, "BaseMinMaxFeatureNode"),
547            Self::GdefTableNode => write!(f, "GdefTableNode"),
548            Self::Os2TableNode => write!(f, "Os2TableNode"),
549            Self::VheaTableNode => write!(f, "VheaTableNode"),
550            Self::VmtxTableNode => write!(f, "VmtxTableNode"),
551            Self::StatTableNode => write!(f, "StatTableNode"),
552            Self::StatElidedFallbackNameNode => write!(f, "StatElidedFallbackNameNode"),
553            Self::StatDesignAxisNode => write!(f, "StatDesignAxisNode"),
554            Self::StatAxisValueNode => write!(f, "StatAxisValueNode"),
555            Self::StatAxisValueLocationNode => write!(f, "StatAxisValueLocationNode"),
556            Self::StatAxisValueFlagNode => write!(f, "StatAxisValueFlagNode"),
557            Self::VmtxEntryNode => write!(f, "VmtxEntryNode"),
558            Self::Os2PanoseNode => write!(f, "Os2PanoseNode"),
559            Self::Os2UnicodeRangeNode => write!(f, "Os2UnicodeRangeNode"),
560            Self::Os2CodePageRangeNode => write!(f, "Os2CodePageRangeNode"),
561            Self::Os2VendorNode => write!(f, "Os2VendorNode"),
562            Self::GdefClassDefNode => write!(f, "GdefClassDefNode"),
563            Self::GdefClassDefEntryNode => write!(f, "GdefClassDefEntryNode"),
564            Self::GdefAttachNode => write!(f, "GdefAttachNode"),
565            Self::GdefLigatureCaretNode => write!(f, "GdefLigatureCaretNode"),
566            Self::NameRecordNode => write!(f, "NameRecordNode"),
567            Self::NameSpecNode => write!(f, "NameSpecNode"),
568            Self::HeadFontRevisionNode => write!(f, "HeadFontRevisionNode"),
569            Self::MetricValueNode => write!(f, "MetricValueNode"), // shared between hhea, vhea, and os2
570            Self::NumberValueNode => write!(f, "NumberNode"),      // used in os2
571            Self::StringValueNode => write!(f, "StringNode"),      // used in os2
572            Self::Os2NumberListNode => write!(f, "Os2NumberListNode"),
573            Self::Os2FamilyClassNode => write!(f, "Os2FamilyClassNode"),
574            Self::CvParamsNameNode => write!(f, "CvParamsNameNode"),
575            Self::AaltFeatureNode => write!(f, "AaltFeatureNode"),
576
577            //glyphs syntax
578            Self::Dollar => write!(f, "$"),
579            Self::Plus => write!(f, "+"),
580            Self::Slash => write!(f, "/"),
581            Self::Asterisk => write!(f, "*"),
582            Self::GlyphsNumberValueNode => write!(f, "GlyphsNumberValueNode"),
583            Self::GlyphsNumberValueExprNode => write!(f, "GlyphsNumberValueExprNode"),
584            Self::GlyphsNumberIdent => write!(f, "GlyphsNumberIdent"),
585        }
586    }
587}