-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: BufferManip for way better maintainability; Composition > Inher…
…itance (#10) - The `BufferManip` class now composes `BufferInfo`, which only holds variables. - Stop using `std::any`. Instead, use a custom `PointerID` class, which stores a `typeid` corresponding to the original type of the `void*` for further type checks. - Use `Executor` instead of `Context`. This leads to a composition class with `Context` for executing runnable fmt strings. Should be totally backward compatible for API use. For flags, `=` has been replaced by `#` to follow <fmt> format
- Loading branch information
Showing
143 changed files
with
5,002 additions
and
8,551 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
Examples/ | ||
external_dev/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: CodeChecker | ||
|
||
on: | ||
push: | ||
branches: | ||
- '**' | ||
pull_request: | ||
branches: | ||
- '**' | ||
|
||
jobs: | ||
codechecker-ubuntu-latest: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: bazelbuild/setup-bazelisk@v3 | ||
- name: Mount bazel cache | ||
uses: actions/cache@v4 | ||
with: | ||
path: "~/.cache/bazel" | ||
key: bazel | ||
|
||
- name: build & retreive compile_commands.json | ||
run: | | ||
bazelisk clean | ||
bazelisk build //... | ||
bazelisk run //conf:compile_commands | ||
- uses: whisperity/[email protected] | ||
id: codechecker | ||
with: | ||
logfile: ${{ github.workspace }}/compile_commands.json | ||
|
||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: "CodeChecker Bug Reports" | ||
path: ${{ steps.codechecker.outputs.result-html-dir }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") | ||
|
||
http_archive( | ||
name = "bazel_utilities", | ||
strip_prefix = "bazel_utilities-7c379bd1b6a4ae0ff5123b63385f92fb527bd687", | ||
urls = [ "https://github.com/0-Sacha/bazel_utilities/archive/7c379bd1b6a4ae0ff5123b63385f92fb527bd687.zip" ], | ||
integrity = "sha256-L5hWrjLMFOdplqV6X0xCyvINMjhnQHSTXynUYZNm9Qs=" | ||
) | ||
|
||
http_archive( | ||
name = "bazel_winlibs_mingw", | ||
strip_prefix = "bazel_winlibs_mingw-09c1b538db4fa262bba152b24b7c1d61079e5abe", | ||
urls = [ "https://github.com/0-Sacha/bazel_winlibs_mingw/archive/09c1b538db4fa262bba152b24b7c1d61079e5abe.zip" ], | ||
integrity = "sha256-rxd9695aR8gQ7sOFiz1YUDURvdgqi+3o3GLygEVLuas=" | ||
) | ||
|
||
load("@bazel_winlibs_mingw//:rules.bzl", "winlibs_mingw_toolchain") | ||
# winlibs_mingw_toolchain( | ||
# "mingw", | ||
# copts = [ "-g", "-O0" ], | ||
# ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,72 @@ | ||
#include "BaseFMTTests.h" | ||
|
||
#include "StreamFormat/FMT/Context/ParserContext/UtilityFunctions.h" | ||
#include "StreamFormat/FMT/Context/ParserExecutor/UtilityFunctions.h" | ||
|
||
#include "StreamFormat/FMT/Buffer/Utils/PatternMatching/Glob.h" | ||
#include "StreamFormat/FMT/Buffer/Utils/BufferGlobberManip.h" | ||
|
||
PCT_TEST_GROUP(FMT, GLOBBER); | ||
#define TEST_GLOBBER(data, glob) \ | ||
{ \ | ||
StreamFormat::FMT::Detail::BasicBufferIn<char> p_buffer(data); \ | ||
StreamFormat::FMT::Detail::BasicBufferIn<char> p_glob(glob); \ | ||
StreamFormat::FMT::Detail::Globber<char, char>::BufferInExecGlob(p_buffer, p_glob); \ | ||
PCT_ASSERT(p_buffer.IsEnd()); \ | ||
} | ||
#define TEST_GLOBBER(data, glob) \ | ||
{ \ | ||
StreamFormat::FMT::Detail::BufferInfoView<char> p_buffer(data); \ | ||
StreamFormat::FMT::Detail::BufferInfoView<char> p_glob(glob); \ | ||
StreamFormat::FMT::Detail::Globber<const char>::BufferInExecGlob(p_buffer, \ | ||
p_glob); \ | ||
PCT_ASSERT( \ | ||
StreamFormat::FMT::Detail::BufferAccess(p_buffer).IsEndOfString()); \ | ||
} | ||
|
||
PCT_TEST_FUNC(GLOBBER, BASIC_WILDCARD){TEST_GLOBBER("qwerty", "qwerty") TEST_GLOBBER("qwerty", "q?erty") TEST_GLOBBER("qwerty", "q?????") TEST_GLOBBER("qwerty", "qwer?y") | ||
TEST_GLOBBER("qwerty", "qwert?") TEST_GLOBBER("qwerty", "??????") TEST_GLOBBER("qwerty", "*") TEST_GLOBBER("qwerty", "******") | ||
TEST_GLOBBER("qwerty", "*?**?*")} | ||
PCT_TEST_FUNC(GLOBBER, BASIC_WILDCARD){ | ||
TEST_GLOBBER("qwerty", "qwerty") TEST_GLOBBER("qwerty", "q?erty") | ||
TEST_GLOBBER("qwerty", "q?????") TEST_GLOBBER("qwerty", "qwer?y") | ||
TEST_GLOBBER("qwerty", "qwert?") TEST_GLOBBER("qwerty", "??????") | ||
TEST_GLOBBER("qwerty", "*") TEST_GLOBBER("qwerty", "******") | ||
TEST_GLOBBER("qwerty", "*?**?*")} | ||
|
||
PCT_TEST_GROUP(FMT, PARSE_GLOBBER); | ||
PCT_TEST_FUNC(PARSE_GLOBBER, PG_BASIC_WILDCARD) | ||
{ | ||
int k = 0; | ||
StreamFormat::FMT::Parse("|123|", "|{}|", k); | ||
PCT_EQ(k, 123); | ||
PCT_TEST_FUNC(PARSE_GLOBBER, PG_BASIC_WILDCARD) { | ||
int k = 0; | ||
StreamFormat::FMT::Parse("|123|", "|{}|", k); | ||
PCT_EQ(k, 123); | ||
|
||
{ | ||
char test[5]; | ||
StreamFormat::FMT::Parse("|test|", "|{}|", test); | ||
PCT_EQ(std::string(test), std::string("test")); | ||
} | ||
{ | ||
char test[5]; | ||
StreamFormat::FMT::Parse("|test|", "|{}|", test); | ||
// PCT_EQ(std::string(test), std::string("test")); | ||
} | ||
|
||
{ | ||
char test[4]; | ||
StreamFormat::FMT::Parse("|test|", "|{:no-zero-end}|", test); | ||
PCT_EQ(std::string(test, 4), std::string("test")); | ||
} | ||
{ | ||
char test[4]; | ||
StreamFormat::FMT::Parse("|test|", "|{:no-zero-end}|", test); | ||
// PCT_EQ(std::string(test, 4), std::string("test")); | ||
} | ||
|
||
{ | ||
char test[4]; | ||
StreamFormat::FMT::Parse("|test|", "|{}t|", test); | ||
PCT_EQ(std::string(test), std::string("tes")); | ||
} | ||
{ | ||
char test[4]; | ||
StreamFormat::FMT::Parse("|test|", "|{}t|", test); | ||
// PCT_EQ(std::string(test), std::string("tes")); | ||
} | ||
|
||
{ | ||
char test[11]; | ||
StreamFormat::FMT::Parse("|test123456|", "|{}|", test); | ||
PCT_EQ(std::string(test), std::string("test123456")); | ||
} | ||
{ | ||
char test[11]; | ||
StreamFormat::FMT::Parse("|test123456|", "|{}|", test); | ||
// PCT_EQ(std::string(test), std::string("test123456")); | ||
} | ||
|
||
{ | ||
char test[11]; | ||
StreamFormat::FMT::Parse("|test123456|", "|{:glob='*1'}23456|", test); | ||
PCT_EQ(std::string(test), std::string("test1")); | ||
} | ||
{ | ||
char test[11]; | ||
StreamFormat::FMT::Parse("|test123456|", "|{:glob='*1'}23456|", test); | ||
// PCT_EQ(std::string(test), std::string("test1")); | ||
} | ||
|
||
{ | ||
char test[11]; | ||
// just glob = '????' but compiler are anrgy about trigraph on '??' | ||
StreamFormat::FMT::Parse("|test123456|", | ||
"|{:glob='?" | ||
"?" | ||
"?" | ||
"?'}123456|", | ||
test); | ||
PCT_EQ(std::string(test), std::string("test")); | ||
} | ||
{ | ||
char test[11]; | ||
// just glob = '????' but compiler are anrgy about trigraph on '??' | ||
StreamFormat::FMT::Parse("|test123456|", | ||
"|{:glob='?" | ||
"?" | ||
"?" | ||
"?'}123456|", | ||
test); | ||
// PCT_EQ(std::string(test), std::string("test")); | ||
} | ||
} |
Oops, something went wrong.