Skip to content

Commit 22c8561

Browse files
authored
feat: Added possiblity to clone expressions (both AST node + tokenstream) (#268)
* feat: Added possiblity to clone expressions (both AST node + tokenstream) This will make it easier to create copies out of existing expressions without having to rebuild them yourself manually (especially if their structure is not fixed). * feat: Added cloning of regexes * fix: Fixed Python bindings build * tests: Added Python bindings clone tests (very limited for now) * fix: regex parsing with \/ * fix: Fixed print in Dump Rules AST example for RegexpText visitor * fix: Fixed (finally) parser for regexes and their escape sequences * fix: Fixed Python type hints
1 parent 593dfcd commit 22c8561

File tree

17 files changed

+3881
-43
lines changed

17 files changed

+3881
-43
lines changed

include/yaramod/types/expression.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ class Expression
8383
}
8484
virtual TokenIt getFirstTokenIt() const = 0;
8585
virtual TokenIt getLastTokenIt() const = 0;
86+
virtual Expression::Ptr clone(const std::shared_ptr<TokenStream>& /*target*/) const = 0;
8687
/// @}
8788

8889

0 commit comments

Comments
 (0)