diff options
| author | Paul Buetow <paul@buetow.org> | 2026-04-11 21:50:15 +0300 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-04-11 21:50:15 +0300 |
| commit | b315ebbcd92e58249c6ed8f04217ef7adcdde5d5 (patch) | |
| tree | d264b595dd2215523ecd1f50540342a3697b612b /internal/rpn/rpn_parse.go | |
| parent | 8dbe047feaae419d9a5bdc34dfe9153e6704fd7f (diff) | |
more on this
Diffstat (limited to 'internal/rpn/rpn_parse.go')
| -rw-r--r-- | internal/rpn/rpn_parse.go | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/internal/rpn/rpn_parse.go b/internal/rpn/rpn_parse.go index 45531bb..9d6d8e2 100644 --- a/internal/rpn/rpn_parse.go +++ b/internal/rpn/rpn_parse.go @@ -506,8 +506,10 @@ func (r *RPN) handleOperator(stack *Stack, token string, tokenIndex int) (string // isValidIdentifier checks if a token looks like a valid variable identifier. // Valid identifiers contain only alphanumeric characters and underscores, // and start with a letter or underscore (not a digit or special character). -// For RPN symbol support, we also limit to single-character identifiers -// (like x, y, z) to avoid converting percentage expression words into symbols. +// +// IMPORTANT: To prevent natural language words (like "what", "is", "of") from +// being incorrectly treated as RPN symbols in mixed-mode expressions, +// this function currently restricts valid identifiers to a length of 1. func isValidIdentifier(token string) bool { if len(token) == 0 { return false |
