Skip to content

Commit f3996b2

Browse files
committed
fix: collapse tautological err check on lexBarePlaceholder (FP-11)
lexBarePlaceholder has no return-nil path — an unquoted '<' is always a parse error by design (PT-02(b)) — so `if err := ...; err != nil` at the call site was flagged by staticcheck (SA4023: always-true comparison) as pre-existing tech debt blocking the required Lint CI check on main (confirmed unrelated to FP-10/#265/#266). Collapses to a direct `return l.lexBarePlaceholder()` — behaviorally identical, since err was always non-nil anyway.
1 parent 78b5014 commit f3996b2

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

internal/parser/lexer.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,10 @@ func (l *Lexer) nextLine() error {
100100
return err
101101
}
102102
case ch == '<':
103-
if err := l.lexBarePlaceholder(); err != nil {
104-
return err
105-
}
103+
// lexBarePlaceholder has no success path — an unquoted '<' is
104+
// always a parse error (see its doc comment) — so there's
105+
// nothing to fall through to here.
106+
return l.lexBarePlaceholder()
106107
case ch == ':':
107108
l.emit(TOKEN_COLON, ":")
108109
l.pos++

0 commit comments

Comments
 (0)