Skip to content

Commit 06417ca

Browse files
osteeleTest User
authored andcommitted
chore: fix lint errors
1 parent 5b2e062 commit 06417ca

File tree

12 files changed

+29
-20
lines changed

12 files changed

+29
-20
lines changed

expressions/expressions.y

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ string: LITERAL {
9696

9797
loop: IDENTIFIER IN filtered loop_modifiers {
9898
name, expr, mods := $1, $3, $4
99-
$$ = Loop{name, &expression{expr}, mods}
99+
$$ = Loop{mods, name, &expression{expr}}
100100
}
101101
;
102102

expressions/scanner.go

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

expressions/statements.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,10 @@ type Cycle struct {
2929

3030
// A Loop is a parse of a {% loop %} statement
3131
type Loop struct {
32+
loopModifiers
33+
3234
Variable string
3335
Expr Expression
34-
loopModifiers
3536
}
3637

3738
type loopModifiers struct {

expressions/y.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

parser/ast.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@ type ASTBlock struct {
1818

1919
// ASTRaw holds the text between the start and end of a raw tag.
2020
type ASTRaw struct {
21-
Slices []string
2221
sourcelessNode
22+
23+
Slices []string
2324
}
2425

2526
// ASTTag is a tag {% tag %} that is not a block start or end.
@@ -41,8 +42,9 @@ type ASTObject struct {
4142

4243
// ASTSeq is a sequence of nodes.
4344
type ASTSeq struct {
44-
Children []ASTNode
4545
sourcelessNode
46+
47+
Children []ASTNode
4648
}
4749

4850
// TrimDirection determines the trim direction of an ASTTrim object.

render/compiler.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,14 @@ func (c *Config) compileNode(n parser.ASTNode) (Node, parser.Error) {
5151

5252
return &node, nil
5353
case *parser.ASTRaw:
54-
return &RawNode{n.Slices, sourcelessNode{}}, nil
54+
return &RawNode{sourcelessNode{}, n.Slices}, nil
5555
case *parser.ASTSeq:
5656
children, err := c.compileNodes(n.Children)
5757
if err != nil {
5858
return nil, err
5959
}
6060

61-
return &SeqNode{children, sourcelessNode{}}, nil
61+
return &SeqNode{sourcelessNode{}, children}, nil
6262
case *parser.ASTTag:
6363
if td, ok := c.FindTagDefinition(n.Name); ok {
6464
f, err := td(n.Args)

render/context.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ func (c rendererContext) RenderFile(filename string, b map[string]any) (string,
196196
// InnerString renders the children to a string.
197197
func (c rendererContext) InnerString() (string, error) {
198198
buf := new(bytes.Buffer)
199+
199200
err := c.RenderChildren(buf)
200201
if err != nil {
201202
return "", err

render/nodes.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@ type BlockNode struct {
2525

2626
// RawNode holds the text between the start and end of a raw tag.
2727
type RawNode struct {
28-
slices []string
2928
sourcelessNode
29+
30+
slices []string
3031
}
3132

3233
// TagNode renders itself via a render function that is created during parsing.
@@ -50,8 +51,9 @@ type ObjectNode struct {
5051

5152
// SeqNode is a sequence of nodes.
5253
type SeqNode struct {
53-
Children []Node
5454
sourcelessNode
55+
56+
Children []Node
5557
}
5658

5759
// TrimNode is a trim object.

render/render.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
// Render renders the render tree.
1717
func Render(node Node, w io.Writer, vars map[string]any, c Config) Error {
1818
tw := trimWriter{w: w}
19+
1920
err := node.render(&tw, newNodeContext(vars, c))
2021
if err != nil {
2122
return err

tags/standard_tags.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,19 +38,19 @@ func makeAssignTag(cfg *render.Config) func(string) (func(io.Writer, render.Cont
3838
}
3939

4040
// Check if dot notation is used without Jekyll extensions enabled
41-
if len(stmt.Assignment.Path) > 1 && !cfg.JekyllExtensions {
41+
if len(stmt.Path) > 1 && !cfg.JekyllExtensions {
4242
return nil, errors.New("syntax error: dot notation in assign tag (e.g., 'obj.property = value') requires Jekyll extensions to be enabled")
4343
}
4444

4545
return func(w io.Writer, ctx render.Context) error {
46-
value, err := ctx.Evaluate(stmt.Assignment.ValueFn)
46+
value, err := ctx.Evaluate(stmt.ValueFn)
4747
if err != nil {
4848
return err
4949
}
5050

5151
// Use Path if available (dot notation), otherwise fall back to Variable (simple assignment)
52-
if len(stmt.Assignment.Path) > 1 {
53-
return ctx.SetPath(stmt.Assignment.Path, value)
52+
if len(stmt.Path) > 1 {
53+
return ctx.SetPath(stmt.Path, value)
5454
}
5555

5656
// Simple assignment (backward compatibility and standard mode)

0 commit comments

Comments
 (0)