@@ -46,64 +46,6 @@ struct ScalarEnumerationTraits<tok> {
46
46
}
47
47
};
48
48
49
- // / Serialization traits for TriviaPiece.
50
- // / - All trivia pieces will have a "kind" key that contains the serialized
51
- // / name of the trivia kind.
52
- // / - Comment trivia will have the associated text of the comment under the
53
- // / "value" key.
54
- // / - All other trivia will have the associated integer count of their
55
- // / occurrences under the "value" key.
56
- template <>
57
- struct ObjectTraits <syntax::TriviaPiece> {
58
- static void mapping (Output &out, syntax::TriviaPiece &value) {
59
- auto kind = value.getKind ();
60
- out.mapRequired (" kind" , kind);
61
- switch (kind) {
62
- case syntax::TriviaKind::Space:
63
- case syntax::TriviaKind::Tab:
64
- case syntax::TriviaKind::VerticalTab:
65
- case syntax::TriviaKind::Formfeed:
66
- case syntax::TriviaKind::Newline:
67
- case syntax::TriviaKind::CarriageReturn:
68
- case syntax::TriviaKind::CarriageReturnLineFeed:
69
- case syntax::TriviaKind::Backtick: {
70
- auto count = value.getCount ();
71
- out.mapRequired (" value" , count);
72
- break ;
73
- }
74
- case syntax::TriviaKind::LineComment:
75
- case syntax::TriviaKind::BlockComment:
76
- case syntax::TriviaKind::DocLineComment:
77
- case syntax::TriviaKind::DocBlockComment:
78
- case syntax::TriviaKind::GarbageText: {
79
- auto text = value.getText ();
80
- out.mapRequired (" value" , text);
81
- break ;
82
- }
83
- }
84
- }
85
- };
86
-
87
- // / Serialization traits for TriviaKind.
88
- template <>
89
- struct ScalarEnumerationTraits <syntax::TriviaKind> {
90
- static void enumeration (Output &out, syntax::TriviaKind &value) {
91
- out.enumCase (value, " Space" , syntax::TriviaKind::Space);
92
- out.enumCase (value, " Tab" , syntax::TriviaKind::Tab);
93
- out.enumCase (value, " VerticalTab" , syntax::TriviaKind::VerticalTab);
94
- out.enumCase (value, " Formfeed" , syntax::TriviaKind::Formfeed);
95
- out.enumCase (value, " Newline" , syntax::TriviaKind::Newline);
96
- out.enumCase (value, " CarriageReturn" , syntax::TriviaKind::CarriageReturn);
97
- out.enumCase (value, " CarriageReturnLineFeed" , syntax::TriviaKind::CarriageReturnLineFeed);
98
- out.enumCase (value, " LineComment" , syntax::TriviaKind::LineComment);
99
- out.enumCase (value, " BlockComment" , syntax::TriviaKind::BlockComment);
100
- out.enumCase (value, " DocLineComment" , syntax::TriviaKind::DocLineComment);
101
- out.enumCase (value, " DocBlockComment" , syntax::TriviaKind::DocBlockComment);
102
- out.enumCase (value, " Backtick" , syntax::TriviaKind::Backtick);
103
- out.enumCase (value, " GarbageText" , syntax::TriviaKind::GarbageText);
104
- }
105
- };
106
-
107
49
// / Serialization traits for Trivia.
108
50
// / Trivia will serialize as an array of the underlying TriviaPieces.
109
51
template <>
0 commit comments