@@ -11,13 +11,13 @@ type Expression interface {
1111// Ident is a named identifier expression.
1212type Ident struct {
1313 // Name is the ident's name.
14- Name string
14+ Name string `yaml:"name"`
1515
1616 // The [token.Ident] token.
17- Token token.Token
17+ Token token.Token `yaml:"token"`
1818
1919 // Type is the kind of ast node, in this case [KindIdent].
20- Type Kind
20+ Type Kind `yaml:"type"`
2121}
2222
2323// Start returns the first token in the Ident, which is
@@ -43,13 +43,13 @@ func (i Ident) expressionNode() {}
4343// TextLiteral is a literal text expression.
4444type TextLiteral struct {
4545 // The text value (unquoted)
46- Value string
46+ Value string `yaml:"value"`
4747
4848 // The [token.Text] token.
49- Token token.Token
49+ Token token.Token `yaml:"token"`
5050
5151 // Type is [KindTextLiteral].
52- Type Kind
52+ Type Kind `yaml:"type"`
5353}
5454
5555// Start returns the first token of the TextLiteral, which is
@@ -75,13 +75,13 @@ func (t TextLiteral) expressionNode() {}
7575// URL is a literal URL expression.
7676type URL struct {
7777 // The url value (unquoted)
78- Value string
78+ Value string `yaml:"value"`
7979
8080 // The [token.URL] token.
81- Token token.Token
81+ Token token.Token `yaml:"token"`
8282
8383 // Type is [KindURL].
84- Type Kind
84+ Type Kind `yaml:"type"`
8585}
8686
8787// Start returns the first token of the URL, which is
@@ -107,16 +107,16 @@ func (u URL) expressionNode() {}
107107// Interp is a text interpolation expression.
108108type Interp struct {
109109 // Expr is the expression inside the interpolation.
110- Expr Expression
110+ Expr Expression `yaml:"expr"`
111111
112112 // Open is the opening interpolation token.
113- Open token.Token
113+ Open token.Token `yaml:"open"`
114114
115115 // Close is the closing interpolation token.
116- Close token.Token
116+ Close token.Token `yaml:"close"`
117117
118118 // Type is [KindInterp].
119- Type Kind
119+ Type Kind `yaml:"type"`
120120}
121121
122122// Start returns the first token of the interpolation, i.e
@@ -154,17 +154,17 @@ func (i Interp) expressionNode() {}
154154type InterpolatedExpression struct {
155155 // Left is the expression before the interp, it may itself
156156 // be any other valid expression, including more nested InterpolatedExpressions.
157- Left Expression
157+ Left Expression `yaml:"left"`
158158
159159 // Right is the expression immediately after the interp, like Left
160160 // it may also be any valid expression.
161- Right Expression
161+ Right Expression `yaml:"right"`
162162
163163 // Interp is the [Interp] expression in between Left and Right.
164- Interp Interp
164+ Interp Interp `yaml:"interp"`
165165
166166 // Type is [KindInterpolatedExpression].
167- Type Kind
167+ Type Kind `yaml:"type"`
168168}
169169
170170// Start returns the first token associated with the left expression if there is one,
@@ -198,10 +198,10 @@ func (i InterpolatedExpression) expressionNode() {}
198198// Body is the http body expression.
199199type Body struct {
200200 // Token is the [token.Body] token.
201- Token token.Token
201+ Token token.Token `yaml:"token"`
202202
203203 // Type is [KindBody].
204- Type Kind
204+ Type Kind `yaml:"type"`
205205}
206206
207207// Start returns the first token associated with the body, which
@@ -227,13 +227,13 @@ func (b Body) expressionNode() {}
227227// BodyFile is a http body from a filepath.
228228type BodyFile struct {
229229 // Value is the expression of the filepath.
230- Value Expression
230+ Value Expression `yaml:"value"`
231231
232232 // Token is the [token.LeftAngle] token.
233- Token token.Token
233+ Token token.Token `yaml:"token"`
234234
235235 // Type is [KindBodyFile].
236- Type Kind
236+ Type Kind `yaml:"type"`
237237}
238238
239239// Start returns the first token associated with the BodyFile, which
0 commit comments