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