Skip to content

feat(bashkit): Phase 4 - Here documents, builtins, and parameter expansion#5

Merged
chaliy merged 1 commit intomainfrom
claude/bash-filesystem-library-cYGoo
Jan 31, 2026
Merged

feat(bashkit): Phase 4 - Here documents, builtins, and parameter expansion#5
chaliy merged 1 commit intomainfrom
claude/bash-filesystem-library-cYGoo

Conversation

@chaliy
Copy link
Contributor

@chaliy chaliy commented Jan 31, 2026

Summary

  • Added here document support (<<EOF) with lexer heredoc parsing
  • Added new builtins: set, unset, shift, local, source/.
  • Implemented full parameter expansion with defaults, length, and pattern removal

Features

Here Documents

Supports heredoc syntax for multi-line input.

New Builtins

  • set -e / set +e - shell options
  • unset VAR - remove variables
  • shift [n] - shift positional parameters
  • local VAR=value - local variables in functions
  • source file / . file - execute script from file

Parameter Expansion

  • ${var:-default} use default if unset/empty
  • ${var:=default} assign default if unset/empty
  • ${var:+replacement} use replacement if set
  • ${var:?error} error if unset/empty
  • ${#var} length of value
  • ${var#pattern} remove shortest prefix
  • ${var##pattern} remove longest prefix
  • ${var%pattern} remove shortest suffix
  • ${var%%pattern} remove longest suffix

Test plan

  • 100 tests passing
  • Heredoc tests
  • Parameter expansion tests
  • New builtin tests
  • Clippy clean

…nsion

Here documents:
- Add read_heredoc method to lexer for <<EOF syntax
- Support heredoc content as stdin input

New builtins:
- set: display/set shell options
- unset: remove variables
- shift: shift positional parameters
- local: declare local variables
- source/.: execute script from file

Parameter expansion:
- ${var:-default} use default if unset/empty
- ${var:=default} assign default if unset/empty
- ${var:+replacement} use replacement if set
- ${var:?error} error if unset/empty
- ${#var} length of value
- ${var#pattern} remove shortest prefix match
- ${var##pattern} remove longest prefix match
- ${var%pattern} remove shortest suffix match
- ${var%%pattern} remove longest suffix match

Tests: 100 passing

https://claude.ai/code/session_01A16cD8ztbTJs2PB2iHe1Ua
@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@chaliy chaliy merged commit ccecc62 into main Jan 31, 2026
1 check 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