Skip to content

Rrivera/allow string field arithmetic#334

Merged
rrivera747 merged 23 commits intodevelopfrom
rrivera/allowStringFieldArithmetic
Feb 18, 2026
Merged

Rrivera/allow string field arithmetic#334
rrivera747 merged 23 commits intodevelopfrom
rrivera/allowStringFieldArithmetic

Conversation

@rrivera747
Copy link
Contributor

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for arithmetic evaluation inside configuration strings and improves trace/logging clarity in several supervisors and utilities.

Changes:

  • Add $((...)) arithmetic expansion support in StringMacros::convertEnvironmentVariables() (evaluated via StringMacros::getNumber()), plus additional trace points.
  • Adjust StringMacros::getNumber() operator parsing to better handle patterns like + -1, and introduce trace-level constants for debugging.
  • Misc logging/message tweaks across Gateway/Configuration/Core supervisors and a small state-string spelling correction.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
otsdaq/TablePlugins/XDAQContextTable/XDAQContextTable.cc Add end-of-function comments (no functional change).
otsdaq/Macros/StringMacros.icc Add trace levels + more tracing; tweak numeric parsing around empty tokens/operators.
otsdaq/Macros/StringMacros.cc Add $((...)) arithmetic expansion handling and trace level constants; adjust trace usage.
otsdaq/Macros/CoutMacros.h Add (commented) trace macro note and spacing.
otsdaq/GatewaySupervisor/GatewaySupervisor.cc Improve remote gateway timeout message; small logging change; add <sstream>.
otsdaq/CoreSupervisors/CorePropertySupervisorBase.cc Improve supervisor startup logging and an error message.
otsdaq/CoreSupervisors/ConfigurationSupervisorBase.cc Avoid warning log when there are no accumulated warnings.
otsdaq/ConfigurationInterface/ConfigurationManager.cc Refine warnings/logging around group-name parsing and structure-status output.
otsdaq/ARTDAQSupervisor/ARTDAQSupervisor.cc Change expected “nonexistent” state spelling in mapping function.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

rrivera747 and others added 3 commits February 17, 2026 17:09
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI commented Feb 17, 2026

@rrivera747 I've opened a new pull request, #339, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Contributor

Copilot AI commented Feb 17, 2026

@rrivera747 I've opened a new pull request, #340, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 2 commits February 17, 2026 23:21
…tVariables

Co-authored-by: rrivera747 <107584474+rrivera747@users.noreply.github.com>
Copy link
Contributor

Copilot AI commented Feb 17, 2026

@rrivera747 I've opened a new pull request, #341, to work on those changes. Once the pull request is ready, I'll request review from you.

rrivera747 and others added 3 commits February 17, 2026 17:22
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…ation

Co-authored-by: rrivera747 <107584474+rrivera747@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copilot AI and others added 6 commits February 17, 2026 23:25
Fixes issue where expressions like 1--1, 1- -1, 1+-1, and 1*-2 were not
correctly handling unary operators after binary operators. The solution
processes empty tokens created by consecutive delimiters and folds the
unary sign into the following numeric token.

Test cases verified:
- 1--1 becomes ["1", "-1"] with op ['-'] (result: 2)
- 1- -1 becomes ["1", "-1"] with op ['-'] (result: 2)
- 1+-1 becomes ["1", "-1"] with op ['+'] (result: 0)
- 1*-2 becomes ["1", "-2"] with op ['*'] (result: -2)
- Leading unary operators (+5, -5) continue to work correctly

Co-authored-by: rrivera747 <107584474+rrivera747@users.noreply.github.com>
Removed redundant conditionals and improved bounds checking:
- Eliminated duplicate if-else branches that performed identical operations
- Removed redundant checks of numIdx + 1 < numbers.size()
- Added bounds check before accessing processedNumbers[0][0]
- Removed speculative edge case handling that was unclear

All tests continue to pass with the simplified logic.

Co-authored-by: rrivera747 <107584474+rrivera747@users.noreply.github.com>
Add bounds check to prevent out-of-bounds access on trailing '$' in convertEnvironmentVariables
Fix misleading comments about arithmetic expansion in StringMacros
Handle unary operators after binary operators in string arithmetic
@rrivera747 rrivera747 merged commit 8a42f02 into develop Feb 18, 2026
11 checks passed
@rrivera747 rrivera747 deleted the rrivera/allowStringFieldArithmetic branch February 18, 2026 00:09
@github-project-automation github-project-automation bot moved this from 📋 Triage to 🎉 Done in art-daq Work Tracker Feb 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🎉 Done

Development

Successfully merging this pull request may close these issues.

4 participants