Rrivera/allow string field arithmetic#334
Conversation
There was a problem hiding this comment.
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 inStringMacros::convertEnvironmentVariables()(evaluated viaStringMacros::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.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@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. |
|
@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. |
…tVariables Co-authored-by: rrivera747 <107584474+rrivera747@users.noreply.github.com>
|
@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. |
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>
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
No description provided.