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    GdefTableNode,
277    GdefClassDefNode,
278    GdefClassDefEntryNode,
279    GdefAttachNode,
280    GdefLigatureCaretNode,
281    Os2TableNode,
282    Os2PanoseNode,
283    Os2UnicodeRangeNode,
284    Os2CodePageRangeNode,
285    Os2VendorNode,
286    VheaTableNode,
287    VmtxTableNode,
288    VmtxEntryNode,
289    StatTableNode,
290    StatElidedFallbackNameNode,
291    StatDesignAxisNode,
292    StatAxisValueNode,
293    StatAxisValueLocationNode,
294    StatAxisValueFlagNode,
295    CvParamsNameNode,
296    AaltFeatureNode,
297
298    // glyphs syntax extension
299    Dollar,
300    Plus,
301    Asterisk,
302    Slash,
303    GlyphsNumberValueNode,
304    GlyphsNumberValueExprNode,
305    GlyphsNumberIdent,
306}
307
308impl Kind {
309    pub(crate) fn is_rule(&self) -> bool {
310        matches!(
311            self,
312            Self::GposType1
313                | Self::GposType2
314                | Self::GposType3
315                | Self::GposType4
316                | Self::GposType5
317                | Self::GposType6
318                | Self::GposType7
319                | Self::GposType8
320                | Self::GsubType1
321                | Self::GsubType2
322                | Self::GsubType3
323                | Self::GsubType4
324                | Self::GsubType5
325                | Self::GsubType6
326                | Self::GsubType7
327                | Self::GsubType8
328        )
329    }
330
331    pub(crate) fn is_trivia(self) -> bool {
332        matches!(self, Kind::Comment | Kind::Whitespace | Kind::Backslash)
333    }
334}
335
336impl std::fmt::Display for Kind {
337    fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
338        match self {
339            Self::Eof => write!(f, "EOF"),
340            //Self::Tombstone => write!(f, "X_X"),
341            Self::SourceFile => write!(f, "FILE"),
342            Self::Ident => write!(f, "ID"),
343            Self::StringUnterminated => write!(f, "STR OPEN"),
344            Self::String => write!(f, "STR"),
345            Self::Number => write!(f, "NUM"),
346            Self::Octal => write!(f, "OCT"),
347            Self::Hex => write!(f, "HEX"),
348            Self::HexEmpty => write!(f, "HEX EMPTY"),
349            Self::NumberSuffix => write!(f, "SUFFIX"),
350            Self::Float => write!(f, "FLOAT"),
351            Self::Whitespace => write!(f, "WS"),
352            Self::Semi => write!(f, ";"),
353            Self::Colon => write!(f, ":"),
354            Self::Comma => write!(f, ","),
355            Self::Backslash => write!(f, "\\"),
356            Self::Hyphen => write!(f, "-"), // also minus
357            Self::Eq => write!(f, "="),
358            Self::LBrace => write!(f, "{{"),
359            Self::RBrace => write!(f, "}}"),
360            Self::LSquare => write!(f, "["),
361            Self::RSquare => write!(f, "]"),
362            Self::LParen => write!(f, "("),
363            Self::RParen => write!(f, ")"),
364            Self::LAngle => write!(f, "<"),
365            Self::RAngle => write!(f, ">"),
366            Self::SingleQuote => write!(f, "'"),
367            Self::Comment => write!(f, "#"),
368
369            Self::Tag => write!(f, "Tag"),
370            Self::Path => write!(f, "Path"),
371            Self::GlyphClass => write!(f, "GlyphClass"),
372            Self::NamedGlyphClass => write!(f, "@GlyphClass"),
373            Self::GlyphRange => write!(f, "GlyphRange"),
374            Self::GlyphName => write!(f, "GlyphName"),
375            Self::GlyphNameOrRange => write!(f, "GlyphNameOrRange"),
376            Self::Cid => write!(f, "CID"),
377            //Self::Metric => write!(f, "METRIC"),
378            Self::Label => write!(f, "LABEL"),
379
380            Self::TableKw => write!(f, "TableKw"),
381            Self::LookupKw => write!(f, "LookupKw"),
382            Self::LanguagesystemKw => write!(f, "LanguagesystemKw"),
383            Self::AnchorDefKw => write!(f, "AnchorDefKw"),
384            Self::FeatureKw => write!(f, "FeatureKw"),
385            Self::MarkClassKw => write!(f, "MarkClassKw"),
386            Self::AnonKw => write!(f, "AnonKw"),
387            Self::ConditionSetKw => write!(f, "ConditionSetKw"),
388            Self::VariationKw => write!(f, "VariationKw"),
389            Self::AnchorKw => write!(f, "AnchorKw"),
390            Self::ByKw => write!(f, "ByKw"),
391            Self::ContourpointKw => write!(f, "ContourpointKw"),
392            Self::CursiveKw => write!(f, "CursiveKw"),
393            Self::DeviceKw => write!(f, "DeviceKw"),
394            Self::EnumKw => write!(f, "EnumKw"),
395            Self::ExcludeDfltKw => write!(f, "ExcludeDfltKw"),
396            Self::FromKw => write!(f, "FromKw"),
397            Self::IgnoreKw => write!(f, "IgnoreKw"),
398            Self::IgnoreBaseGlyphsKw => write!(f, "IgnoreBaseGlyphsKw"),
399            Self::IgnoreLigaturesKw => write!(f, "IgnoreLigaturesKw"),
400            Self::IgnoreMarksKw => write!(f, "IgnoreMarksKw"),
401            Self::IncludeKw => write!(f, "IncludeKw"),
402            Self::IncludeDfltKw => write!(f, "IncludeDfltKw"),
403            Self::LanguageKw => write!(f, "LanguageKw"),
404            Self::LookupflagKw => write!(f, "LookupflagKw"),
405            Self::MarkKw => write!(f, "MarkKw"),
406            Self::MarkAttachmentTypeKw => write!(f, "MarkAttachmentTypeKw"),
407            Self::NameIdKw => write!(f, "NameIdKw"),
408            Self::NullKw => write!(f, "NullKw"),
409            Self::ParametersKw => write!(f, "ParametersKw"),
410            Self::PosKw => write!(f, "PosKw"),
411            Self::RequiredKw => write!(f, "RequiredKw"),
412            Self::RightToLeftKw => write!(f, "RightToLeftKw"),
413            Self::RsubKw => write!(f, "RsubKw"),
414            Self::ScriptKw => write!(f, "ScriptKw"),
415            Self::SubKw => write!(f, "SubKw"),
416            Self::SubtableKw => write!(f, "SubtableKw"),
417            Self::UseExtensionKw => write!(f, "UseExtensionKw"),
418            Self::UseMarkFilteringSetKw => write!(f, "UseMarkFilteringSetKw"),
419            Self::ValueRecordDefKw => write!(f, "ValueRecordDefKw"),
420            Self::HorizAxisBaseScriptListKw => write!(f, "HorizAxis.BaseScriptList"),
421            Self::HorizAxisBaseTagListKw => write!(f, "HorizAxis.BaseTagList"),
422            Self::HorizAxisMinMaxKw => write!(f, "HorizAxis.MinMax"),
423            Self::VertAxisBaseScriptListKw => write!(f, "VertAxis.BaseScriptList"),
424            Self::VertAxisBaseTagListKw => write!(f, "VertAxis.BaseTagList"),
425            Self::VertAxisMinMaxKw => write!(f, "VertAxis.MinMax"),
426            Self::AttachKw => write!(f, "Attach"),
427            Self::GlyphClassDefKw => write!(f, "GlyphClassDef"),
428            Self::LigatureCaretByDevKw => write!(f, "LigatureCaretByDev"),
429            Self::LigatureCaretByIndexKw => write!(f, "LigatureCaretByIndex"),
430            Self::LigatureCaretByPosKw => write!(f, "LigatureCaretByPos"),
431            Self::MarkAttachClassKw => write!(f, "MarkAttachClass"),
432            Self::FontRevisionKw => write!(f, "FontRevision"),
433            Self::AscenderKw => write!(f, "Ascender"),
434            Self::CaretOffsetKw => write!(f, "CaretOffset"),
435            Self::DescenderKw => write!(f, "Descender"),
436            Self::LineGapKw => write!(f, "LineGap"),
437            Self::CapHeightKw => write!(f, "CapHeight"),
438            Self::CodePageRangeKw => write!(f, "CodePageRange"),
439            Self::PanoseKw => write!(f, "Panose"),
440            Self::TypoAscenderKw => write!(f, "TypoAscender"),
441            Self::TypoDescenderKw => write!(f, "TypoDescender"),
442            Self::TypoLineGapKw => write!(f, "TypoLineGap"),
443            Self::UnicodeRangeKw => write!(f, "UnicodeRange"),
444            Self::VendorKw => write!(f, "Vendor"),
445            Self::WinAscentKw => write!(f, "winAscent"),
446            Self::WinDescentKw => write!(f, "winDescent"),
447            Self::XHeightKw => write!(f, "XHeight"),
448            Self::SizemenunameKw => write!(f, "sizemenuname"),
449            Self::VertTypoAscenderKw => write!(f, "VertTypoAscender"),
450            Self::VertTypoDescenderKw => write!(f, "VertTypoDescender"),
451            Self::VertTypoLineGapKw => write!(f, "VertTypoLineGap"),
452            Self::VertAdvanceYKw => write!(f, "VertAdvanceY"),
453            Self::VertOriginYKw => write!(f, "VertOriginY"),
454            Self::ElidedFallbackNameKw => write!(f, "ElidedFallbackName"),
455            Self::ElidedFallbackNameIDKw => write!(f, "ElidedFallbackNameID"),
456            Self::DesignAxisKw => write!(f, "DesignAxis"),
457            Self::AxisValueKw => write!(f, "AxisValue"),
458            Self::FlagKw => write!(f, "flag"),
459            Self::LocationKw => write!(f, "location"),
460            Self::ElidableAxisValueNameKw => write!(f, "ElidableAxisValueName"),
461            Self::OlderSiblingFontAttributeKw => write!(f, "OlderSiblingFontAttribute"),
462
463            Self::FeatureNamesKw => write!(f, "FeatureNamesKw"),
464            Self::NameKw => write!(f, "NameKw"),
465            Self::CvParametersKw => write!(f, "CvParametersKw"),
466            Self::FeatUiLabelNameIdKw => write!(f, "FeatUiLabelNameIdKw"),
467            Self::FeatUiTooltipTextNameIdKw => write!(f, "FeatUiTooltipTextNameIdKw"),
468            Self::SampleTextNameIdKw => write!(f, "SampleTextNameId"),
469            Self::ParamUiLabelNameIdKw => write!(f, "ParamUiLabelNameId"),
470            Self::CharacterKw => write!(f, "CharacterKw"),
471
472            Self::LigatureKw => write!(f, "LigatureKw"),
473            Self::BaseKw => write!(f, "BaseKw"),
474
475            Self::AnchorMarkNode => write!(f, "AnchorMarkNode"),
476            Self::LigatureComponentNode => write!(f, "LigatureComponentNode"),
477            Self::ValueRecordNode => write!(f, "ValueRecordNode"),
478            Self::ValueRecordDefNode => write!(f, "ValueRecordDefNode"),
479            Self::GsubNode => write!(f, "GsubNode"),
480            Self::GsubNodeNeedsRewrite => write!(f, "GsubNodeNeedsRewrite"),
481            Self::GsubType1 => write!(f, "GsubType1"),
482            Self::GsubType2 => write!(f, "GsubType2"),
483            Self::GsubType3 => write!(f, "GsubType3"),
484            Self::GsubType4 => write!(f, "GsubType4"),
485            Self::GsubType5 => write!(f, "GsubType5"),
486            Self::GsubType6 => write!(f, "GsubType6"),
487            Self::GsubType7 => write!(f, "GsubType7"),
488            Self::GsubType8 => write!(f, "GsubType8"),
489            Self::GsubIgnore => write!(f, "GsubIgnore"),
490            Self::GposNode => write!(f, "GposNode"),
491            Self::GposNodeNeedsRewrite => write!(f, "GposNodeNeedsRewrite"),
492            Self::GposType1 => write!(f, "GposType1"),
493            Self::GposType2 => write!(f, "GposType2"),
494            Self::GposType3 => write!(f, "GposType3"),
495            Self::GposType4 => write!(f, "GposType4"),
496            Self::GposType5 => write!(f, "GposType5"),
497            Self::GposType6 => write!(f, "GposType6"),
498            Self::GposType7 => write!(f, "GposType7"),
499            Self::GposType8 => write!(f, "GposType8"),
500            Self::GposIgnore => write!(f, "GposIgnore"),
501
502            Self::BacktrackSequence => write!(f, "BacktrackSequence"),
503            Self::LookaheadSequence => write!(f, "LookaheadSequence"),
504            Self::ContextSequence => write!(f, "ContextSequence"),
505            Self::ContextGlyphNode => write!(f, "ContextGlyphNode"),
506            Self::InlineSubNode => write!(f, "InlineSubNode"),
507            Self::IgnoreRuleStatementNode => write!(f, "IgnoreRuleStatementNode"),
508
509            Self::LookupRefNode => write!(f, "LookupRefNode"),
510            Self::LookupBlockNode => write!(f, "LookupBlockNode"),
511            Self::ScriptRecordNode => write!(f, "ScriptRecoordNode"),
512            Self::TableEntryNode => write!(f, "TableEntryNode"),
513            Self::IncludeNode => write!(f, "IncludeNode"),
514            Self::MarkClassNode => write!(f, "MarkClassNode"),
515            Self::AnchorDefNode => write!(f, "AnchorDefNode"),
516            Self::AnchorNode => write!(f, "AnchorNode"),
517            Self::ConditionSetNode => write!(f, "ConditionSetNode"),
518            Self::ConditionNode => write!(f, "ConditionNode"),
519            Self::VariationNode => write!(f, "VariationNode"),
520            Self::VariableMetricNode => write!(f, "VariableMetricNode"),
521            Self::LocationValueNode => write!(f, "LocationValueNode"),
522            Self::LocationSpecNode => write!(f, "LocationSpecNode"),
523            Self::LocationSpecItemNode => write!(f, "LocationSpecItemNode"),
524            Self::AxisLocationNode => write!(f, "AxisLocationNode"),
525
526            Self::DeviceNode => write!(f, "DeviceNode"),
527            Self::AnonBlockNode => write!(f, "AnonBlockNode"),
528            Self::GlyphClassDefNode => write!(f, "GlyphClassDefNode"),
529            Self::LanguageSystemNode => write!(f, "LanguageSystemNode"),
530            Self::FeatureNode => write!(f, "FeatureNode"),
531            Self::SizeMenuNameNode => write!(f, "SizeMenuNameNode"),
532            Self::ParametersNode => write!(f, "ParametersNode"),
533            Self::ScriptNode => write!(f, "ScriptNode"),
534            Self::LanguageNode => write!(f, "LanguageNode"),
535            Self::LookupFlagNode => write!(f, "LookupFlagNode"),
536            Self::SubtableNode => write!(f, "SubtableNode"),
537            Self::TableNode => write!(f, "TableNode"),
538            Self::HeadTableNode => write!(f, "HeadTableNode"),
539            Self::HheaTableNode => write!(f, "HheaTableNode"),
540            Self::NameTableNode => write!(f, "NameTableNode"),
541            Self::BaseTableNode => write!(f, "BaseTableNode"),
542            Self::BaseTagListNode => write!(f, "BaseTagListNode"),
543            Self::BaseScriptListNode => write!(f, "BaseScriptListNode"),
544            Self::BaseMinMaxNode => write!(f, "BaseMinMaxNode"),
545            Self::GdefTableNode => write!(f, "GdefTableNode"),
546            Self::Os2TableNode => write!(f, "Os2TableNode"),
547            Self::VheaTableNode => write!(f, "VheaTableNode"),
548            Self::VmtxTableNode => write!(f, "VmtxTableNode"),
549            Self::StatTableNode => write!(f, "StatTableNode"),
550            Self::StatElidedFallbackNameNode => write!(f, "StatElidedFallbackNameNode"),
551            Self::StatDesignAxisNode => write!(f, "StatDesignAxisNode"),
552            Self::StatAxisValueNode => write!(f, "StatAxisValueNode"),
553            Self::StatAxisValueLocationNode => write!(f, "StatAxisValueLocationNode"),
554            Self::StatAxisValueFlagNode => write!(f, "StatAxisValueFlagNode"),
555            Self::VmtxEntryNode => write!(f, "VmtxEntryNode"),
556            Self::Os2PanoseNode => write!(f, "Os2PanoseNode"),
557            Self::Os2UnicodeRangeNode => write!(f, "Os2UnicodeRangeNode"),
558            Self::Os2CodePageRangeNode => write!(f, "Os2CodePageRangeNode"),
559            Self::Os2VendorNode => write!(f, "Os2VendorNode"),
560            Self::GdefClassDefNode => write!(f, "GdefClassDefNode"),
561            Self::GdefClassDefEntryNode => write!(f, "GdefClassDefEntryNode"),
562            Self::GdefAttachNode => write!(f, "GdefAttachNode"),
563            Self::GdefLigatureCaretNode => write!(f, "GdefLigatureCaretNode"),
564            Self::NameRecordNode => write!(f, "NameRecordNode"),
565            Self::NameSpecNode => write!(f, "NameSpecNode"),
566            Self::HeadFontRevisionNode => write!(f, "HeadFontRevisionNode"),
567            Self::MetricValueNode => write!(f, "MetricValueNode"), // shared between hhea, vhea, and os2
568            Self::NumberValueNode => write!(f, "NumberNode"),      // used in os2
569            Self::StringValueNode => write!(f, "StringNode"),      // used in os2
570            Self::Os2NumberListNode => write!(f, "Os2NumberListNode"),
571            Self::Os2FamilyClassNode => write!(f, "Os2FamilyClassNode"),
572            Self::CvParamsNameNode => write!(f, "CvParamsNameNode"),
573            Self::AaltFeatureNode => write!(f, "AaltFeatureNode"),
574
575            //glyphs syntax
576            Self::Dollar => write!(f, "$"),
577            Self::Plus => write!(f, "+"),
578            Self::Slash => write!(f, "/"),
579            Self::Asterisk => write!(f, "*"),
580            Self::GlyphsNumberValueNode => write!(f, "GlyphsNumberValueNode"),
581            Self::GlyphsNumberValueExprNode => write!(f, "GlyphsNumberValueExprNode"),
582            Self::GlyphsNumberIdent => write!(f, "GlyphsNumberIdent"),
583        }
584    }
585}