Commit d198332
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- .github/workflows
- 3rdparty/lexy
- cmake
- include
- lexy_ext
- lexy
- _detail
- action
- callback
- dsl
- input
- src
- input
- include/behaviortree_cpp/scripting
- src
- tests
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| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
| 22 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| 32 | + | |
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
This file was deleted.
0 commit comments