google / effcee Goto Github PK
View Code? Open in Web Editor NEWEffcee is a C++ library for stateful pattern matching of strings, inspired by LLVM's FileCheck
License: Apache License 2.0
Effcee is a C++ library for stateful pattern matching of strings, inspired by LLVM's FileCheck
License: Apache License 2.0
Hi there (cross-post from re2),
Hopefully not a silly question, but is there a way to capture the variables of all possible matches and perform checks with them?
For example, if I use the following made-up SPIR-V:
%end = OpVariable %_ptr_Function_int Function
%15 = OpLoad %int %n
%16 = OpLoad %int %n
OpStore %end %16
...the following checks will return false
...
const std::string check = R"(
CHECK: [[END:%\w+]] = OpVariable
CHECK: [[LOADED:%\w+]] = OpLoad %int %n
CHECK: OpStore [[END]] [[LOADED]]
)";
...despite OpStore %end %16
being a possibility.
Is there a better syntactical way to capture all possible versions of what LOADED
might be and return success if a match is found with one of these versions (instead of stopping after the first match)?
If I add the following test to effcee, it fails. It seems like CHECK-NOT is checking right to the end of the string stead of checking just to the line that matches the following CHECK.
TEST(Match, AppearsAfterNextCheck) {
const auto result =
Match("Hello\nWorld\nBorg", "CHECK: Hello\nCHECK-NOT: Borg\nCHECK: World");
EXPECT_TRUE(result);
}
There is no a single windows DLL export, it would be good to add
set(CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS ON) in CMakeLists.txt
absl::string_view and std::string_view do not have a as_string() operator. This makes porting effcee to other environments a bit difficult. It would be nice to change such code to use an explicit std::string conversion, e.g. std::string(StringPiece), or to use a helper function.
TEST(Match, other) {
const auto result = Match("Hello\n1\n2\n3\n4\n2\n3", "CHECK: Hello\nCHECK 1\nCHECK-NEXT 2\nCHECK-NEXT: 3\nCHECK: 4");
EXPECT_TRUE(result);
}
This test fails, but I don't think it should.
It's annoying to maintain both Travis and AppVeyor configurations, and this is a small enough project that GitHub Actions is a better fit than Kokoro.
Greetings effcee developers and contributors,
We’re reaching out because your project is an important part of the open source ecosystem, and we’d like to invite you to integrate with our fuzzing service, OSS-Fuzz. OSS-Fuzz is a free fuzzing infrastructure you can use to identify security vulnerabilities and stability bugs in your project. OSS-Fuzz will:
Many widely used open source projects like OpenSSL, FFmpeg, LibreOffice, and ImageMagick are fuzzing via OSS-Fuzz, which helps them find and remediate critical issues.
Even though typical integrations can be done in < 100 LoC, we have a reward program in place which aims to recognize folks who are not just contributing to open source, but are also working hard to make it more secure.
We want to stress that anyone who meets the eligibility criteria and integrates a project with OSS-Fuzz is eligible for a reward.
To help you getting started, we can provide an internal fuzzer for your project that you are welcome to use directly, or to use it as a starting point.
If you're not interested in integrating with OSS-Fuzz, it would be helpful for us to understand why—lack of interest, lack of time, or something else—so we can better support projects like yours in the future.
If we’ve missed your question in our FAQ, feel free to reply or reach out to us at [email protected].
Thanks!
Tommy
OSS-Fuzz Team
When using the latest RE2, the windows debug builds give an assert.
Line 121 in 77a53ba
This subtraction with two iterators from different stringpieces gives an assert:
C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.36.32532\include\xstring(1086) : Assertion failed: cannot subtract incompatible string_view iterators
This is caused by the definition of the re2 StringPiece class being replaced with std::string_view.
Is there another way to do what we want to do in effcee?
From the bot run for #59
FAILED: effcee/CMakeFiles/effcee-test.dir/cursor_test.cc.obj
C:\PROGRA2\MIB0551\2019\COMMUN1\VC\Tools\MSVC\14291.301\bin\Hostx64\x64\cl.exe /nologo /TP -DGTEST_HAS_COMBINE=1 -IT:\src\github\effcee\effcee.. -IT:\src\github\effcee\third_party\re2 -IT:\src\github\effcee\third_party\abseil_cpp -external:IT:\src\github\effcee\third_party\googletest\googlemock\include -external:IT:\src\github\effcee\third_party\googletest\googletest\include -external:IT:\src\github\effcee\third_party\googletest\googlemock -external:IT:\src\github\effcee\third_party\googletest\googletest -external:W0 /DWIN32 /D_WINDOWS /GR /EHsc /Zi /O2 /Ob1 /DNDEBUG -MD /wd4800 -std:c++17 /showIncludes /Foeffcee\CMakeFiles\effcee-test.dir\cursor_test.cc.obj /Fdeffcee\CMakeFiles\effcee-test.dir\ /FS -c T:\src\github\effcee\effcee\cursor_test.cc
T:\src\github\effcee\effcee\cursor_test.cc(139): error C2664: 'std::basic_string_view<char,std::char_traits>::basic_string_view(const char *const ,const std::basic_string_view<char,std::char_traits>::size_type) noexcept': cannot convert argument 1 from 'std::_String_view_iterator<_Traits>' to 'const char *const '
with
[
_Traits=std::char_traits
]
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.