Found in an adversarial language review at 95a0d76.
docs/GRAMMAR.md's postfix note claims "postfix indexing and dot access apply to NUM, STR, IDENT, list literals, dict literals, and parenthesized expressions". Two divergences:
- The STR, NUM, and list-literal branches of
parse_primary loop only on TOK_LBRACKET (src/parser.c:656, 667, 816) — no .key:
y is [10, 20].x # Parse error line 1: unexpected '.' in expression
s is "ab".foo # same
- F-strings (unlisted in the note) DO take postfix, because they desugar to a parenthesized expression (src/lexer.c:319):
print of f"hello"[1] # → e, rc=0
Either give all primaries the uniform postfix loop, or fix the note to match the implementation (and add FSTR to it).
Found in an adversarial language review at 95a0d76.
docs/GRAMMAR.md's postfix note claims "postfix indexing and dot access apply to NUM, STR, IDENT, list literals, dict literals, and parenthesized expressions". Two divergences:
parse_primaryloop only onTOK_LBRACKET(src/parser.c:656, 667, 816) — no.key:Either give all primaries the uniform postfix loop, or fix the note to match the implementation (and add FSTR to it).