Skip to content

feat: add variadic defmacro parameters and macro helpers - #155

Merged
thsfranca merged 3 commits into
mainfrom
feat/variadic-defmacro
Mar 21, 2026
Merged

feat: add variadic defmacro parameters and macro helpers#155
thsfranca merged 3 commits into
mainfrom
feat/variadic-defmacro

Conversation

@thsfranca

Copy link
Copy Markdown
Owner

Summary

  • Add & rest variadic parameter support to defmacro — extra arguments are collected into an SList
  • Add empty? and keyword? macro helpers to the AST evaluator
  • Move prelude.vx from src/ to stdlib/ for language/compiler separation
  • Update TopForm::DefMacro AST node with rest_param: Option<String> field

Test plan

  • All 554 tests pass (8 new tests for variadic macros, helpers, and parser)
  • cargo clippy clean
  • Variadic macro collects excess args into rest param as SList
  • Variadic macro with zero rest args produces empty list
  • Variadic macro with fixed + rest params works correctly
  • Error on too few args for variadic macro
  • empty? and keyword? helpers work in macro bodies
  • Parser handles [& items] and [a b & rest] syntax

Thales de França added 2 commits March 21, 2026 20:25
Vex library source (prelude) now lives in lib/, separate from the Rust
compiler implementation in src/. Updated include_str! path and the
architecture doc file structure section accordingly.
@thsfranca
thsfranca enabled auto-merge (squash) March 21, 2026 23:27
@thsfranca
thsfranca merged commit c5b55f2 into main Mar 21, 2026
2 checks passed
@thsfranca
thsfranca deleted the feat/variadic-defmacro branch March 21, 2026 23:28
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