mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-06-28 16:41:01 +03:00
literal API: remove HS_FLAG_MULTILINE flag support
fixes github issue #237
This commit is contained in:
parent
88a18dcf98
commit
765b8f9fb9
@ -110,8 +110,8 @@ Hyperscan needs to locate the end position of the input expression via clearly
|
|||||||
knowing each literal's length, not by simply identifying character ``\0`` of a
|
knowing each literal's length, not by simply identifying character ``\0`` of a
|
||||||
string.
|
string.
|
||||||
|
|
||||||
Supported flags: :c:member:`HS_FLAG_CASELESS`, :c:member:`HS_FLAG_MULTILINE`,
|
Supported flags: :c:member:`HS_FLAG_CASELESS`, :c:member:`HS_FLAG_SINGLEMATCH`,
|
||||||
:c:member:`HS_FLAG_SINGLEMATCH`, :c:member:`HS_FLAG_SOM_LEFTMOST`.
|
:c:member:`HS_FLAG_SOM_LEFTMOST`.
|
||||||
|
|
||||||
.. note:: We don't support literal compilation API with :ref:`extparam`. And
|
.. note:: We don't support literal compilation API with :ref:`extparam`. And
|
||||||
for runtime implementation, traditional runtime APIs can still be
|
for runtime implementation, traditional runtime APIs can still be
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2015-2019, Intel Corporation
|
* Copyright (c) 2015-2020, Intel Corporation
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are met:
|
* modification, are permitted provided that the following conditions are met:
|
||||||
@ -125,7 +125,7 @@ ParsedLitExpression::ParsedLitExpression(unsigned index_in,
|
|||||||
: expr(index_in, false, flags & HS_FLAG_SINGLEMATCH, false, false,
|
: expr(index_in, false, flags & HS_FLAG_SINGLEMATCH, false, false,
|
||||||
SOM_NONE, report, 0, MAX_OFFSET, 0, 0, 0, false) {
|
SOM_NONE, report, 0, MAX_OFFSET, 0, 0, 0, false) {
|
||||||
// For pure literal expression, below 'HS_FLAG_'s are unuseful:
|
// For pure literal expression, below 'HS_FLAG_'s are unuseful:
|
||||||
// DOTALL/ALLOWEMPTY/UTF8/UCP/PREFILTER/COMBINATION/QUIET
|
// DOTALL/ALLOWEMPTY/UTF8/UCP/PREFILTER/COMBINATION/QUIET/MULTILINE
|
||||||
|
|
||||||
if (flags & ~HS_FLAG_ALL) {
|
if (flags & ~HS_FLAG_ALL) {
|
||||||
DEBUG_PRINTF("Unrecognised flag, flags=%u.\n", flags);
|
DEBUG_PRINTF("Unrecognised flag, flags=%u.\n", flags);
|
||||||
@ -409,12 +409,11 @@ void addLitExpression(NG &ng, unsigned index, const char *expression,
|
|||||||
// filter out flags not supported by pure literal API.
|
// filter out flags not supported by pure literal API.
|
||||||
u64a not_supported = HS_FLAG_DOTALL | HS_FLAG_ALLOWEMPTY | HS_FLAG_UTF8 |
|
u64a not_supported = HS_FLAG_DOTALL | HS_FLAG_ALLOWEMPTY | HS_FLAG_UTF8 |
|
||||||
HS_FLAG_UCP | HS_FLAG_PREFILTER | HS_FLAG_COMBINATION |
|
HS_FLAG_UCP | HS_FLAG_PREFILTER | HS_FLAG_COMBINATION |
|
||||||
HS_FLAG_QUIET;
|
HS_FLAG_QUIET | HS_FLAG_MULTILINE;
|
||||||
|
|
||||||
if (flags & not_supported) {
|
if (flags & not_supported) {
|
||||||
throw CompileError("Only HS_FLAG_CASELESS, HS_FLAG_MULTILINE, "
|
throw CompileError("Only HS_FLAG_CASELESS, HS_FLAG_SINGLEMATCH and "
|
||||||
"HS_FLAG_SINGLEMATCH and HS_FLAG_SOM_LEFTMOST are "
|
"HS_FLAG_SOM_LEFTMOST are supported in literal API.");
|
||||||
"supported in literal API.");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// This expression must be a pure literal, we can build ue2_literal
|
// This expression must be a pure literal, we can build ue2_literal
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright (c) 2015-2019, Intel Corporation
|
* Copyright (c) 2015-2020, Intel Corporation
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
* modification, are permitted provided that the following conditions are met:
|
* modification, are permitted provided that the following conditions are met:
|
||||||
@ -563,7 +563,6 @@ hs_error_t HS_CDECL hs_compile_ext_multi(const char *const *expressions,
|
|||||||
* be used by ORing them together. Compared to @ref hs_compile(), fewer
|
* be used by ORing them together. Compared to @ref hs_compile(), fewer
|
||||||
* valid values are provided:
|
* valid values are provided:
|
||||||
* - HS_FLAG_CASELESS - Matching will be performed case-insensitively.
|
* - HS_FLAG_CASELESS - Matching will be performed case-insensitively.
|
||||||
* - HS_FLAG_MULTILINE - `^` and `$` anchors match any newlines in data.
|
|
||||||
* - HS_FLAG_SINGLEMATCH - Only one match will be generated for the
|
* - HS_FLAG_SINGLEMATCH - Only one match will be generated for the
|
||||||
* expression per stream.
|
* expression per stream.
|
||||||
* - HS_FLAG_SOM_LEFTMOST - Report the leftmost start of match offset
|
* - HS_FLAG_SOM_LEFTMOST - Report the leftmost start of match offset
|
||||||
@ -637,7 +636,6 @@ hs_error_t HS_CDECL hs_compile_lit(const char *expression, unsigned flags,
|
|||||||
* in place of an array will set the flags value for all patterns to zero.
|
* in place of an array will set the flags value for all patterns to zero.
|
||||||
* Compared to @ref hs_compile_multi(), fewer valid values are provided:
|
* Compared to @ref hs_compile_multi(), fewer valid values are provided:
|
||||||
* - HS_FLAG_CASELESS - Matching will be performed case-insensitively.
|
* - HS_FLAG_CASELESS - Matching will be performed case-insensitively.
|
||||||
* - HS_FLAG_MULTILINE - `^` and `$` anchors match any newlines in data.
|
|
||||||
* - HS_FLAG_SINGLEMATCH - Only one match will be generated for the
|
* - HS_FLAG_SINGLEMATCH - Only one match will be generated for the
|
||||||
* expression per stream.
|
* expression per stream.
|
||||||
* - HS_FLAG_SOM_LEFTMOST - Report the leftmost start of match offset
|
* - HS_FLAG_SOM_LEFTMOST - Report the leftmost start of match offset
|
||||||
|
Loading…
x
Reference in New Issue
Block a user