mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-25 14:35:54 +00:00
bbf1737cc2
- to compensate for the slower parser, optimised it a little - change basic_string to fray, a refcounted immutable string - add 'xml' tool, prints the parser tree in XML
28 lines
746 B
C++
28 lines
746 B
C++
/*
|
|
* Copyright (c) 2008 Andrew Garrett.
|
|
* Copyright (c) 2008 River Tarnell <river@wikimedia.org>
|
|
* Derived from public domain code contributed by Victor Vasiliev.
|
|
*
|
|
* Permission is granted to anyone to use this software for any purpose,
|
|
* including commercial applications, and to alter it and redistribute it
|
|
* freely. This software is provided 'as-is', without any express or
|
|
* implied warranty.
|
|
*/
|
|
|
|
#include "filter_evaluator.h"
|
|
|
|
int main(int argc, char** argv) {
|
|
afp::u32filter_evaluator f;
|
|
|
|
if (argc != 2) {
|
|
std::cerr << "usage: " << argv[0] << " <filter>\n";
|
|
return 1;
|
|
}
|
|
|
|
try {
|
|
std::cout << f.evaluate(make_u32fray(argv[1])) << '\n';
|
|
} catch (std::exception &e) {
|
|
std::cerr << "exception: " << e.what() << '\n';
|
|
}
|
|
}
|