Skip to content

Commit

Permalink
fix parsing of tab indent in single quote
Browse files Browse the repository at this point in the history
  • Loading branch information
goccy committed Dec 14, 2024
1 parent 0b9a668 commit d5db17f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion scanner/scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,17 @@ func (s *Scanner) scanSingleQuote(ctx *Context) (*token.Token, error) {
}
}
continue
} else if isFirstLineChar && (c == ' ' || c == '\t') {
} else if isFirstLineChar && c == ' ' {
continue
} else if isFirstLineChar && c == '\t' {
if s.lastDelimColumn >= s.column {
return nil, ErrInvalidToken(
token.Invalid(
"tab character cannot be used for indentation in single-quoted text",
string(ctx.obuf), s.pos(),
),
)
}
continue
} else if c != '\'' {
value = append(value, c)
Expand Down

0 comments on commit d5db17f

Please sign in to comment.