From 20e327d9dd22846620beea19fd8b1c2f6cd58833 Mon Sep 17 00:00:00 2001 From: Paolo Donadeo Date: Mon, 24 Nov 2025 23:40:31 +0100 Subject: [PATCH] refactor(parser): translate comments from Italian to English --- internal/parser/parser.go | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/internal/parser/parser.go b/internal/parser/parser.go index 435cc0d..f76309f 100644 --- a/internal/parser/parser.go +++ b/internal/parser/parser.go @@ -65,7 +65,7 @@ var ( completedHead = regexp.MustCompile(`^x\s+`) spaceRe = regexp.MustCompile(`\s+`) dateLayout = "2006-01-02" - // Protocols da escludere come chiave dei metadati + // Protocols to exclude as metadata keys protocols = map[string]struct{}{ "http": {}, "https": {}, @@ -74,7 +74,7 @@ var ( } ) -// isProtocolKey controlla se la chiave è un protocollo standard. +// isProtocolKey checks if the key is a standard protocol. func isProtocolKey(k string) bool { _, found := protocols[strings.ToLower(k)] return found @@ -165,13 +165,12 @@ func ParseLine(line string) (Task, error) { t.Contexts = append(t.Contexts, tok[1:]) continue } - // Nuova logica per metadati: nessuno spazio, almeno un ':', chiave non protocollo if !strings.ContainsAny(tok, " \t") && strings.Contains(tok, ":") { parts := strings.SplitN(tok, ":", 2) k, v := parts[0], parts[1] if k != "" && v != "" && !isProtocolKey(k) { t.Metadata[k] = v - // Se il campo è due:YYYY-MM-DD, parsalo anche come DueDate + // If the field is due:YYYY-MM-DD, also parse it as DueDate if k == "due" && dateRe.MatchString(v) { if dt, err := time.Parse(dateLayout, v); err == nil { t.DueDate = &dt