Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(arithmetic): recursively evaluate var references #351

Merged
merged 1 commit into from
Jan 22, 2025

Conversation

reubeno
Copy link
Owner

@reubeno reubeno commented Jan 22, 2025

In an arithmetic expression, we need to recursively parse and evaluate the body of any bare variable references.

Resolves #345.

Copy link

github-actions bot commented Jan 22, 2025

Test Results

    2 files      9 suites   1m 29s ⏱️
  623 tests   623 ✅ 0 💤 0 ❌
1 232 runs  1 232 ✅ 0 💤 0 ❌

Results for commit 882769f.

♻️ This comment has been updated with latest results.

Copy link

github-actions bot commented Jan 22, 2025

Performance Benchmark Report

Benchmark name Baseline (μs) Test/PR (μs) Delta (μs) Delta %
clone_shell_object 16.05 μs 16.67 μs 0.62 μs 🟠 +3.89%
eval_arithmetic 0.19 μs 0.19 μs 0.00 μs ⚪ Unchanged
expand_one_string 1.51 μs 1.57 μs 0.06 μs ⚪ Unchanged
for_loop 32.06 μs 34.67 μs 2.61 μs 🟠 +8.13%
function_call 3.29 μs 3.31 μs 0.02 μs ⚪ Unchanged
instantiate_shell 48.27 μs 48.75 μs 0.48 μs ⚪ Unchanged
instantiate_shell_with_init_scripts 21565.22 μs 22497.96 μs 932.74 μs 🟠 +4.33%
parse_bash_completion 1667.39 μs 1654.30 μs -13.10 μs ⚪ Unchanged
parse_sample_script 1.74 μs 1.74 μs -0.00 μs ⚪ Unchanged
run_echo_builtin_command 15.77 μs 15.77 μs -0.00 μs ⚪ Unchanged
run_one_external_command 4105.12 μs 2265.83 μs -1839.29 μs 🟢 -44.80%
tokenize_sample_script 2.88 μs 2.84 μs -0.03 μs 🟢 -1.18%

Code Coverage Report: Only Changed Files listed

Package Base Coverage New Coverage Difference
brush-core/src/arithmetic.rs 🟢 98.46% 🟢 98.47% 🟢 0.01%
brush-core/src/builtins/dot.rs 🟢 91.67% 🟢 95.83% 🟢 4.16%
brush-core/src/builtins/return_.rs 🟢 81.82% 🟢 100% 🟢 18.18%
brush-core/src/shell.rs 🟢 77.62% 🟢 78.34% 🟢 0.72%
Overall Coverage 🟢 74.7% 🟢 74.77% 🟢 0.07%

Minimum allowed coverage is 70%, this run produced 74.77%

@reubeno reubeno force-pushed the recursive-arith-refs branch from f3067dd to 882769f Compare January 22, 2025 08:28
@reubeno reubeno merged commit 1b82617 into main Jan 22, 2025
17 checks passed
@reubeno reubeno deleted the recursive-arith-refs branch January 22, 2025 08:41
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.

Bash arithmetic expressions are applied recursively
1 participant