Commits

trunk
Switch branches/tags
All users
Until Dec 30, 2025
December 2025
Su Mo Tu We Th Fr Sa
30 1 2 3 4 5 6
7 8 9 10 11 12 13
14 15 16 17 18 19 20
21 22 23 24 25 26 27
28 29 30 31 1 2 3
4 5 6 7 8 9 10

Commits on December 30, 2025

  1. feat: implement control flow execution and fix parsing
    - Add control_flow.rs module with execution for if/while/for/case statements
    - Add Statement::Script variant for multi-line scripts
    - Fix grammar to reserve keywords (if, then, fi, while, do, done, for, in, case, esac)
    - Fix bare_word_part to exclude semicolons
    - Make NEWLINE silent to prevent parse tree pollution
    - Update command_line grammar to support multiple commands
    - Add keyword_boundary rule for proper keyword matching
    - Update CLI to handle Statement::Script and execute all control flow types
    - Add parser tests for if statements and multiline scripts
    
    If statements are fully working. While/for/case loops need additional testing and fixes.
    espadonne committed
  2. feat(executor): implement built-in test command
    Add comprehensive test builtin with support for:
    - String tests: -z (empty), -n (non-empty), = (equal), != (not equal)
    - Numeric comparisons: -eq, -ne, -lt, -le, -gt, -ge
    - File tests: -e (exists), -f (file), -d (directory), -r (readable), -w (writable), -x (executable), -s (has size)
    - Logical operators: ! (negation), -a (and), -o (or)
    - Both 'test' and '[' command aliases
    
    Also fix grammar to allow '=' in bare words (needed for test expressions).
    espadonne committed
  3. feat: implement && and || command chaining
    Grammar fix:
    - Exclude & from bare_word_part to allow && and || operators to parse correctly
    
    Executor implementation:
    - Add execute_and_or_list function in pipeline.rs
    - Implement short-circuit evaluation:
      - && executes next command only if previous succeeded (exit code 0)
      - || executes next command only if previous failed (exit code != 0)
    - Export execute_and_or_list from lib.rs
    
    CLI integration:
    - Update execute_complete_command to handle AndOrList
    - Remove TODO placeholder
    
    Tests passing:
    - echo first && echo second → first, second
    - false || echo fallback → fallback
    - false && echo not_shown || echo shown && echo also_shown → shown, also_shown
    espadonne committed
  4. feat(cli): integrate control flow parser with CLI
    - Update execute_line to handle Statement::Complete(CompleteCommand)
    - Add execute_complete_command dispatcher for all command types
    - Maintain existing Simple and Pipeline execution
    - Add TODO placeholders for control flow execution:
      - AndOrList (&&, ||)
      - If statements
      - While loops
      - For loops
      - Case statements
    - Shell remains functional with existing features
    espadonne committed
  5. feat(parser): implement control flow parsing
    Parser implementation:
    - Rewrite parse_command_line to handle complete_command
    - Add parse_complete_command dispatcher for all statement types
    - Add parse_and_or_list for && and || operators
    - Add parse_if_statement with elif_clause and else_clause support
    - Add parse_while_statement for while loops
    - Add parse_for_statement for for-in loops
    - Add parse_case_statement with case_clause pattern matching
    - Add parse_command_list for command sequences
    - Update parse_pipeline to return Pipeline directly
    - Update all 15 existing tests to use Statement::Complete(CompleteCommand)
    - All tests passing
    
    Library exports:
    - Export all new AST types: CompleteCommand, AndOrList, AndOrOp, IfStatement,
      ElifClause, WhileStatement, ForStatement, CaseStatement, CaseClause, Pipeline, Redirect
    espadonne committed
  6. feat(parser): add grammar and AST for control flow structures
    Grammar additions:
    - Add if/then/elif/else/fi statement syntax
    - Add while/do/done loop syntax
    - Add for/in/do/done loop syntax
    - Add case/in/esac statement syntax with pattern matching
    - Add && and || operators for command chaining
    - Add complete_command, and_or_list, command_list rules
    - Add separator rule for newlines and semicolons
    
    AST additions:
    - Add CompleteCommand enum with 7 variants (Simple, Pipeline, AndOrList, If, While, For, Case)
    - Add IfStatement with condition, then_body, elif_clauses, else_body
    - Add WhileStatement with condition and body
    - Add ForStatement with var_name, words, and body
    - Add CaseStatement with word and clauses
    - Add AndOrList with first pipeline and rest (op, pipeline) pairs
    - Add helper structures: ElifClause, CaseClause, AndOrOp enum
    - Update Statement enum to use Complete(CompleteCommand)
    espadonne committed
  7. feat(cli): integrate pipeline and redirection support
    - Simplify execute_line() to use new executor functions
      - Use execute_simple_with_redirects() for simple commands
      - Use execute_pipeline() for multi-command pipelines
    - Handle Statement::Pipeline variant
    - Remove manual assignment processing (now in executor)
    - Maintain proper exit status tracking for both command types
    espadonne committed
  8. feat(executor): implement pipeline and I/O redirection execution
    - Add redirect.rs module for handling all I/O redirections
      - Implement apply_redirects() to configure Command stdio
      - Support input (<), output (>), append (>>), stderr (2>), and combined (&>) redirects
      - Proper file expansion and error handling
    - Add pipeline.rs module for executing command pipelines
      - Create pipes between commands using Stdio::piped()
      - Chain stdout of each command to stdin of next
      - Wait for all processes and return last exit status
      - Implement execute_simple_with_redirects() for unified command execution
    - Update command.rs to expose helper functions
      - Make find_in_path, execute_builtin, success_result public(crate)
    - Add rush-expand dependency to rush-executor
    espadonne committed
  9. feat(parser): implement pipeline and redirection parsing
    - Implement parse_pipeline() to handle multiple piped commands
    - Implement parse_redirect() for all redirect types
    - Update parse_command_line() to handle pipeline syntax
    - Update parse_simple_command() to capture redirects
    - Add comprehensive tests for pipelines (simple, three-command)
    - Add tests for all redirect types (input, output, append, stderr, combined)
    - All 15 parser tests passing
    espadonne committed
  10. feat(parser): add grammar and AST for pipelines and redirections
    - Add pipeline syntax: cmd1 | cmd2 | cmd3
    - Add redirect operators: <, >, >>, 2>, 2>&1, &>, &>>
    - Add Pipeline struct to AST with commands vector
    - Add Redirect enum with 5 variants (Input, Output, OutputAppend, StderrToStdout, AllOutput)
    - Extend SimpleCommand to include redirects field
    - Add Statement::Pipeline variant
    - Update simple_command grammar to support interleaved redirects
    espadonne committed
  11. feat(cli): integrate variable expansion and context
    - add Context to all execution modes
    - update execute_line to handle assignments and expansion
      - process variable assignments before command
      - expand all words (variables, command substitution)
      - track exit status in context
    - persist Context across commands in REPL
    - maintain separate Context per execution mode
    
    Working features:
    - variable assignment: FOO=bar
    - variable expansion: $FOO, ${FOO}
    - command substitution: $(pwd)
    - quoted strings with expansion: "Hello $NAME"
    - assignments persist across commands in same session
    espadonne committed
  12. feat(expand): implement command substitution
    - add execute_command_substitution() function
    - execute commands via sh -c (for now)
    - trim trailing newlines (bash behavior)
    - integrate with expand_word()
    - add tests for command substitution
    - 16 tests passing total
    espadonne committed
  13. feat(expand): implement variable expansion engine
    - move Context from rush-eval to rush-expand (avoid circular deps)
    - implement expand_word() for all expansion types:
      - literal text
      - variable expansion ($VAR, ${VAR})
      - default values (${VAR:-default})
    - implement expand_words() for multiple words
    - add Context for variable storage:
      - local and exported variables
      - environment variable initialization
      - exit status tracking
    - 10 passing tests for expansion and context
    espadonne committed
  14. feat(parser): add support for variables and expansions
    - extend Pest grammar for variable syntax
      - variable assignments: VAR=value
      - variable expansion: $VAR, ${VAR}, ${VAR:-default}
      - command substitution: $(cmd)
      - double-quoted strings with expansions
    - update AST to support:
      - Assignment type
      - Word composed of multiple WordParts
      - VarExpansion types (Simple, Braced, WithDefault)
      - CommandSubstitution
    - rewrite parser for new grammar
      - explicit whitespace handling to prevent word merging
      - proper separation of assignments and words
    - add comprehensive tests for new features
    espadonne committed

Commits on December 29, 2025

  1. chore: update gitignore
    - remove docs/ from gitignore (now tracked)
    - add CLAUDE.md to gitignore
    espadonne committed
  2. feat: add placeholder modules for future phases
    - rush-eval: control flow evaluation
    - rush-expand: variable and glob expansion
    - rush-interactive: fish-like features
    - rush-job: job control
    espadonne committed
  3. feat(cli): implement multi-mode shell interface
    - add command-line argument parsing with clap
    - implement interactive mode with reedline REPL
    - implement non-interactive modes:
      - command string (-c flag)
      - script file execution
      - stdin execution
    - set up signal handlers on startup
    - detect terminal vs stdin for mode selection
    espadonne committed
  4. feat(executor): add terminal-aware execution with signal handling
    - implement process group management for child processes
    - add signal handling (SIGINT, SIGTSTP, SIGTTOU)
    - give foreground processes terminal control
    - properly wait for child processes with WUNTRACED
    - handle stopped processes (Ctrl+Z)
    - restore terminal control to shell after command
    espadonne committed
  5. feat(executor): implement command execution engine
    - execute external commands with PATH resolution
    - implement built-in commands (cd, pwd, exit)
    - handle execution errors
    - add tests for command execution
    espadonne committed
  6. feat(parser): implement Pest-based shell parser
    - add PEG grammar for simple commands
    - define AST types (Statement, SimpleCommand)
    - implement parser with quoted string support
    - add unit tests for parsing
    espadonne committed
  7. feat: initialize rush workspace
    - create Cargo workspace with 7 crates
    - configure workspace dependencies (pest, reedline, nix, etc)
    - configure gitignore
    espadonne committed