Skip to content

Commit d198332

Browse files
Remove lexy dependency, replace with hand-written tokenizer and Pratt parser (#1099)
* conditionally use from_char when available * lexy removed * Add hand-written tokenizer for scripting language Implement BT::Scripting::tokenize() to replace the lexy-based tokenizer that was removed. Handles all token types: identifiers (with @ prefix for root blackboard vars), numbers (int/hex/real/exponent), single-quoted strings, two-char operators, and single-char operators/delimiters. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Fix clang-tidy warnings in script parser and tokenizer - Add explicit != 0 for implicit int->bool conversions from ctype functions (readability-implicit-bool-conversion) - Value-initialize op variables in switch statements (cppcoreguidelines-init-variables) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Address SonarCloud warnings in script parser and tokenizer Tokenizer: - Extract scanHexNumber(), scanDecimalNumber(), matchTwoCharOp(), matchSingleCharOp() to reduce cognitive complexity of tokenize() - Use init-statement in if for identifier text variable (S6004) Parser: - Replace std::runtime_error with RuntimeError (S112) - Remove redundant lambda return type (S3574) - Catch RuntimeError instead of std::exception (S1181) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * Add unit tests for tokenizer and parser edge cases New test cases: - TokenizerEdgeCases: unterminated strings, hex errors (0x, 0xG), exponent errors (3e, 3e+), DotDot with numbers, empty/whitespace scripts - ChainedComparisons: 1<2<3, 3>2>1, mixed chains, chained equality - OperatorPrecedence: bitwise vs logical, parenthesized subexpressions - UnaryOperators: !, !!, ~, unary minus in expressions - TernaryExpressions: basic, with subexpressions, comparison conditions - MultipleStatements: extra semicolons, return value of last expression Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> * fix test and coverage script --------- Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 1792196 commit d198332

File tree

140 files changed

+1133
-28221
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

140 files changed

+1133
-28221
lines changed

.github/workflows/ros2-rolling.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ jobs:
1919
- uses: 'ros-industrial/industrial_ci@master'
2020
env: ${{matrix.env}}
2121
with:
22-
package-name: plotjuggler
22+
package-name: behaviortree_cpp

.github/workflows/ros2.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,4 @@ jobs:
2020
- uses: 'ros-industrial/industrial_ci@master'
2121
env: ${{matrix.env}}
2222
with:
23-
package-name: plotjuggler
23+
package-name: behaviortree_cpp

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ tags
2424
/llvm.sh
2525
t11_groot_howto.btlog
2626
minitrace.json
27+
28+
TODO.md
2729
/.worktrees/*
2830
/docs/plans/*
2931
/coverage_report/*
32+
/coverage.info

3rdparty/lexy/CMakeLists.txt

Lines changed: 0 additions & 79 deletions
This file was deleted.

3rdparty/lexy/LICENSE

Lines changed: 0 additions & 23 deletions
This file was deleted.

3rdparty/lexy/README.adoc

Lines changed: 0 additions & 175 deletions
This file was deleted.

3rdparty/lexy/cmake/lexyConfig.cmake.in

Lines changed: 0 additions & 8 deletions
This file was deleted.

3rdparty/lexy/include/lexy/_detail/any_ref.hpp

Lines changed: 0 additions & 68 deletions
This file was deleted.

0 commit comments

Comments
 (0)