8000 docs(grammar): document line comments and Unicode identifiers (#650) by adityamukho · Pull Request #658 · project-minigraf/minigraf · GitHub
[go: up one dir, main page]

Skip to content

docs(grammar): document line comments and Unicode identifiers (#650) - #658

Merged
adityamukho merged 1 commit into
v3from
docs/650-grammar-comments-unicode
Oct 20, 2026
Merged

adityamukho merged 1 commit into
v3from
docs/650-grammar-comments-unicode

Conversation

@adityamukho
Copy link
Copy Markdown
Collaborator

Resolves #650 by documenting, not restricting: the parser has accepted ; line comments since v1.1.0 and Unicode identifiers always, so restricting would break existing inputs.

Changes

  • tests/grammar/grammar.pest: COMMENT = _{ ";" ~ (!"\n" ~ ANY)* }; word_cont, plain_sym, bind_slot use ALPHABETIC / NUMBER (the classes behind char::is_alphabetic / is_numeric); "-" ~ !NUMBER ~ word_cont+, since the parser reads - + numeral as a number (without it the verifier finds 81 -٣-style inputs pest accepts and the parser rejects with INT-008).
  • verifier.rs: Comment and UnicodeLetter causes and their KNOWN_DRIFT entries removed; is_plain_symbol mirrors the new plain_sym.
  • tests/grammar_doc.rs: renders COMMENT into the skip note (panics on any other comment shape), maps ALPHABETIC→letter, NUMBER→numeral; new test comment_joins_the_note. docs/GRAMMAR.md regenerated (the docs site reads it per tag, so no minigraf-docs PR).
  • CHANGELOG, CLAUDE.md, README, TEST_COVERAGE (1662 tests).

No parser behaviour changes.

Verification

🤖 Generated with Claude Code

https://claude.ai/code/session_01PtCdzbJMSS1V8qEPaJ4jXz

The parser has always skipped `;` line comments and read Unicode letters
and numerals in symbols, variables, keywords and bind slots. grammar.pest
now says so: COMMENT is skipped like WHITESPACE, word_cont, plain_sym and
bind_slot use ALPHABETIC and NUMBER, and `-` followed by a numeral is not
a symbol (the parser reads it as a number). The verifier's Comment and
UnicodeLetter drift entries are gone; GRAMMAR.md is regenerated, with the
comment in the skip note and the new letter/numeral definitions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PtCdzbJMSS1V8qEPaJ4jXz
@codecov
codecov Bot commented Oct 20, 2026
Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@adityamukho
adityamukho merged commit f508260 into v3 Oct 20, 2026
25 checks passed
@adityamukho
adityamukho deleted the docs/650-grammar-comments-unicode branch October 20, 2026 14:19
adityamukho added a commit that referenced this pull request Oct 20, 2026
…660)

Backport of #658 from v3. grammar.pest skips `;` line comments like
whitespace, and symbols, variables, keywords and bind slots use
ALPHABETIC and NUMBER, as the tokenizer does; `-` followed by a numeral
is a number, not a symbol. The verifier's Comment and UnicodeLetter
drift entries are removed. No parser change.


Claude-Session: https://claude.ai/code/session_01PtCdzbJMSS1V8qEPaJ4jXz

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0