Skip to content

feat(interpreter): implement caller builtin#264

Merged
chaliy merged 1 commit intomainfrom
claude/bashkit-bash-compatibility-BsDKD
Feb 25, 2026
Merged

feat(interpreter): implement caller builtin#264
chaliy merged 1 commit intomainfrom
claude/bashkit-bash-compatibility-BsDKD

Conversation

@chaliy
Copy link
Contributor

@chaliy chaliy commented Feb 25, 2026

Summary

  • Implement caller builtin for call stack introspection
  • caller 0: reports immediate caller context (line, function, source)
  • caller N: walks up N frames in the call stack
  • Returns exit code 1 when called outside a function
  • 4 spec tests covering: in-function, nested, outside-function, no-args

Test plan

  • cargo test --all-features passes
  • cargo clippy --all-targets --all-features -- -D warnings clean
  • cargo fmt --check clean
  • Spec counts updated (Bash 947→951, Total 1365→1369)

Reports the calling context (line, function name, source) from within
functions. Returns exit code 1 when called outside a function. Supports
caller N for walking up the call stack.

https://claude.ai/code/session_012rzB3FRw7yoQWCG1mxyW7J
@chaliy chaliy merged commit f60c32c into main Feb 25, 2026
16 checks passed
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.

2 participants