diff --git a/building/main.cpp b/building/main.cpp index 8fe329f..c74e000 100644 --- a/building/main.cpp +++ b/building/main.cpp @@ -14,7 +14,7 @@ struct Libregexis024BuildSystem { "-Wno-unused-but-set-variable", "-Wno-reorder"}; std::vector version_flags = {"--std", "c++14", "-D", "_POSIX_C_SOURCE=200809L"}; - std::vector debug_defines_release = {}; + std::vector debug_defines_release = {"_GLIBCXX_DEBUG"}; std::vector debug_defines_debug = {"_GLIBCXX_DEBUG", "LIBREGEXIS024_DEBUG", "LIBREGEXIS024_ALLOW_LOUD"}; std::vector opt_flags_release = {"-g", "-O2"}; std::vector opt_flags_debug = {"-g", "-ggdb", "-O0"}; diff --git a/src/libregexis024sol/backslash_expression.cpp b/src/libregexis024sol/backslash_expression.cpp index f265e3e..283b4f9 100644 --- a/src/libregexis024sol/backslash_expression.cpp +++ b/src/libregexis024sol/backslash_expression.cpp @@ -56,6 +56,7 @@ namespace regexis024 { if (leader >= 0){ ret_is_multicode = false; ret_set = codeset_of_one_char(leader); + readChar(ctx); } else { report(ctx, "backslash in the wrong place"); } diff --git a/src/libregexis024sol/part_of_expr_that_tracks.h b/src/libregexis024sol/part_of_expr_that_tracks.h index 85ce883..49fc5ae 100644 --- a/src/libregexis024sol/part_of_expr_that_tracks.h +++ b/src/libregexis024sol/part_of_expr_that_tracks.h @@ -8,19 +8,9 @@ namespace regexis024 { struct SubtrackingNameUsageInfo: public TrackingVariableInfo{ - bool stored_in_ca = true; - bool stored_in_sa = false; - bool discovered = false; - tracking_var_type_t type; - /* These fields will be -1 if unused */ - int colarr_first = -1; - int colarr_second = -1; - bool used_in_sifting = false; bool minimizing = false; - int selarr_first = -1; - int selarr_second = -1; }; struct KnownTrackingTools { diff --git a/src/libregexis024test/test4.cpp b/src/libregexis024test/test4.cpp index 8524331..40b8804 100644 --- a/src/libregexis024test/test4.cpp +++ b/src/libregexis024test/test4.cpp @@ -51,6 +51,17 @@ void boba(const vector>& input, const string& pattern) { } int main() { +#define reg_ALPHA "[a-zA-Z]" +#define reg_pchar "([a-zA-Z0-9\\-._~\\!$\\&'()*+@:,;=]|%[0-9a-hA-H]!r{2})" +#define reg_query "(" reg_pchar"|[?/])*" +#define reg_lin_ws "([ \t]|\r\n[ \t])*" +#define reg_request_line "#method(" reg_ALPHA"+) #uri_path(/(" reg_pchar"|/)*)(\\?#uri_query(" reg_query"))? HTTP/#http_version(!digit;+.!digit;+)\r\n" +#define reg_filed_value "(" reg_lin_ws"#header_field_value_part([\\u0021-\\u007e&^\r\n]+))*" reg_lin_ws +#define reg_HTTP_message reg_request_line "(#header_field_name([\\u0021-\\u007E&^:]+):" reg_filed_value "\r\n)*\r\n" + test("P /aa?:: HTTP/1.1\r\nr--r: qwe\r\n\r\n", reg_HTTP_message, MatchInfo( + {{0, 0}, {1, 1}, {2, 2}, {3, 5}, {4, 6}, {5, 8}, {6, 14}, {7, 17}, {8, 19}, {9, 23}, {10, 25}, {11, 28}}, {})); + test("d3", "[abc]3", MatchInfo()); + boba({{"", true}, {"a", false}}, ""); boba({{"", true}, {"a", true}, {"aab", true}, {"aac", false}, {"c", false}, {"abbababa", true}}, "[ab]*"); test("", "", MatchInfo({}, {})); @@ -58,10 +69,8 @@ int main() { test("1b", "1\\