polserver/pol-core/bscript/compiler/file
Kevin Eady 5cf6949ea7
Add support for regular expressions (#818)
* implementation

* tests

* maybe fix windows compilation?

* undo change of match_flag_type

* switch to boost regex

* move flags to BRegExp object

* fix tests due to cmake 4 update

* update grammar

* update prettifier

* move flag parsing to BRegExp ctor

* add AST nodes, update instr generation and execution

* copy tests but use regular expression literals

* fix grammar for handling division correctly

* modify return values a bit, update tests
- string.match: make groups hold structs of matched, offset
- string.match: add offset
- string.replace: use a groups array like string.match vs individual arguments

* bundle of changes

- standardize error messages
- add more tests for coverage
- move BRegExp creation to static method:  previous implementation had
  ctor throwing, which was no good inside executor since it didn't have
  a try/catch

* more tests; add OT_REGEXP to basic.em

* move string regex stuff to bregexp and support regex/wregex via std::visit

* maybe fix compilation errors?

* add unicode escape sequence handling

* really maybe fix compilation error?

* fix compiler warnings

* refactor a bit to remove duplicate code

* address discord comments
- just return wstring, no need for vector<wchar_t> method

* Add string.split by string and regexp

* Use Max_Split instead of Limit
This makes it match basic::SplitWords

* add support for empty string delim in SplitWords

* remove duplicate code across string.split and mf_SplitWords

* Squashed commit of the following:

commit b3148e069f
Author: turleypol <turley@polserver.com>
Date:   Sat Sep 27 17:02:22 2025 +0200

    memorylocation of input string is not allowed to changed, switched back
    to uniqueptr

commit 5a4d1c8fcb
Author: turleypol <turley@polserver.com>
Date:   Sat Sep 27 10:18:01 2025 +0200

    no need to use ptr for input

commit 90fa0edc66
Author: turleypol <turley@polserver.com>
Date:   Sat Sep 27 09:56:29 2025 +0200

    fixed typo

commit bed4ff3ac9
Author: turleypol <turley@polserver.com>
Date:   Sat Sep 27 09:47:36 2025 +0200

    make Callback for BContinuation move only

* use uninit when group isn't matched

* fix multiline flag handling; add test

* add docs and doc example tests

* some cleanup

* address review comments
- allow move assignment

* add core-changes
2025-11-17 18:02:45 +01:00
..
ConformingCharStream.cpp Add error listener, and convert lexer symbols to lowercase (#216) 2020-08-14 03:28:37 -07:00
ConformingCharStream.h Fewer compile warnings (#413) 2021-08-28 22:26:15 +02:00
ErrorListener.cpp POLLOG* macros use the new formatting (#598) 2024-01-16 17:55:42 +01:00
ErrorListener.h Fewer compile warnings (#413) 2021-08-28 22:26:15 +02:00
PrettifyBuilder.cpp "Preview/Initial"- Version sourcecode formatting feature (#626) 2024-02-26 21:21:44 +01:00
PrettifyBuilder.h "Preview/Initial"- Version sourcecode formatting feature (#626) 2024-02-26 21:21:44 +01:00
PrettifyFileProcessor.cpp Add support for regular expressions (#818) 2025-11-17 18:02:45 +01:00
PrettifyFileProcessor.h Add support for regular expressions (#818) 2025-11-17 18:02:45 +01:00
PrettifyLineBuilder.cpp Add support for spread operator in dictionary and struct initializers; FormatterEllipsisSpacing formatter option (#763) 2025-02-19 18:33:56 +01:00
PrettifyLineBuilder.h Add support for spread operator in dictionary and struct initializers; FormatterEllipsisSpacing formatter option (#763) 2025-02-19 18:33:56 +01:00
SourceFile.cpp Use SLL parsing with ANTLR (#708) 2024-08-31 09:16:14 +02:00
SourceFile.h Use SLL parsing with ANTLR (#708) 2024-08-31 09:16:14 +02:00
SourceFileCache.cpp Add daemon watch mode to ecompile (#630) 2024-03-16 00:08:06 +01:00
SourceFileCache.h Add daemon watch mode to ecompile (#630) 2024-03-16 00:08:06 +01:00
SourceFileIdentifier.cpp Short Circuit Optimizer (#797) 2025-07-28 21:48:34 +02:00
SourceFileIdentifier.h Short Circuit Optimizer (#797) 2025-07-28 21:48:34 +02:00
SourceLocation.cpp Short Circuit Optimizer (#797) 2025-07-28 21:48:34 +02:00
SourceLocation.h Short Circuit Optimizer (#797) 2025-07-28 21:48:34 +02:00