Commit 36e32ea
Fix #1029: correct left-associativity for arithmetic operators in script parser
The scripting engine evaluated "A - B + C" as "A - (B + C)" instead of
"(A - B) + C". The root cause was that string_concat's operand chain
referenced math_sum, causing it to appear twice in lexy's operation list
with conflicting binding power levels. Changed string_concat::operand
from math_sum to math_prefix to eliminate the duplicate entry.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent b3dbe30 commit 36e32ea
File tree
2 files changed
+40
-1
lines changed- include/behaviortree_cpp/scripting
- tests
2 files changed
+40
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
747 | 747 | | |
748 | 748 | | |
749 | 749 | | |
750 | | - | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
751 | 754 | | |
752 | 755 | | |
753 | 756 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
424 | 424 | | |
425 | 425 | | |
426 | 426 | | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
| 458 | + | |
| 459 | + | |
| 460 | + | |
| 461 | + | |
| 462 | + | |
427 | 463 | | |
428 | 464 | | |
429 | 465 | | |
| |||
0 commit comments