Skip to content

Accept keyword datums in quotes#76

Merged
pmatos merged 1 commit into
mainfrom
issue-72
Jul 1, 2026
Merged

Accept keyword datums in quotes#76
pmatos merged 1 commit into
mainfrom
issue-72

Conversation

@pmatos

@pmatos pmatos commented Jul 1, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add a Keyword ValueNode (analogous to Symbol) so quoted keyword literals like '#:foo parse and evaluate. The lexer already emitted Tok::KEYWORD for #:foo, but parseValue had no branch for it, so (linklet () () '#:foo) failed to parse.
  • parseKeyword consumes the KEYWORD token; the node stores the bare keyword and prints in Racket's read form (#:foo). Keywords are not self-quoting, so the enclosing QuotedExpr adds the leading quote — '#:foo prints as '#:foo, and '(#:foo 1) as '(#:foo 1).
  • Wire the new node through the ASTVisitor interface (Interpreter, AnalysisFreeVars).

Closes #72

Test plan

  • ctest --preset debug — 14/14 unit tests pass, incl. new "Lexing Keyword tokens"
  • nora-lit test/integration — 50/50 pass, incl. new quote19.rkt ('#:foo) and quote20.rkt ('(#:foo 1))
  • cmake --build --preset debug — warning-clean (warnings-as-errors)
  • clang-format — clean on all edited files

Add a Keyword ValueNode so quoted keyword literals like '#:foo parse and print in Racket's read form; the lexer already emitted KEYWORD tokens that parseValue had no branch for.
@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.87097% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.58%. Comparing base (1ca9b29) to head (c3ced0c).

Files with missing lines Patch % Lines
src/Interpreter.cpp 0.00% 3 Missing ⚠️
src/AST.cpp 50.00% 1 Missing ⚠️
src/AnalysisFreeVars.cpp 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #76      +/-   ##
==========================================
+ Coverage   73.19%   73.58%   +0.38%     
==========================================
  Files          24       24              
  Lines        2108     2139      +31     
  Branches      290      292       +2     
==========================================
+ Hits         1543     1574      +31     
  Misses        565      565              
Flag Coverage Δ
integration 73.58% <83.87%> (+0.38%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@claude

claude Bot commented Jul 1, 2026

Copy link
Copy Markdown

Code review

No issues found. Checked for bugs and CLAUDE.md compliance.

@pmatos pmatos merged commit 0e5f847 into main Jul 1, 2026
20 checks passed
@pmatos pmatos deleted the issue-72 branch July 1, 2026 20:24
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.

Support quoted keyword datums (#:foo)

1 participant