203 Commits

Author SHA1 Message Date
openharmony_ci 54b0403bcb !5 merge master into master
aho-corasick新增bundle.json部件化

Created-by: dragonswordy
Commit-by: ljy9810
Merged-by: openharmony_ci
Description: ### 一、内容说明(相关的Issue)
https://gitcode.com/openharmony/third_party_rust_autocfg/issues/3


### 二、建议测试周期和提测地址  
  建议测试完成时间:xxxx.xx.xx  
  投产上线时间:xxxx.xx.xx  
  提测地址:CI环境/压测环境  
  测试账号:  

### 三、变更内容
  * 3.1 关联PR列表

  * 3.2 数据库和部署说明  
    1. 常规更新 
    2. 重启unicorn
    3. 重启sidekiq
    4. 迁移任务:是否有迁移任务,没有写 "无"
    5. rake脚本:`bundle exec xxx RAILS_ENV = production`;没有写 "无"

  * 3.4 其他技术优化内容(做了什么,变更了什么)
    - 重构了 xxxx 代码
    - xxxx 算法优化


  * 3.5 废弃通知(什么字段、方法弃用?)



  * 3.6  后向不兼容变更(是否有无法向后兼容的变更?)


  
### 四、研发自测点(自测哪些?冒烟用例全部自测?)
  自测测试结论:


### 五、测试关注点(需要提醒QA重点关注的、可能会忽略的地方)
  检查点:

| 需求名称 | 是否影响xx公共模块 | 是否需要xx功能 | 需求升级是否依赖其他子产品 |
|------|------------|----------|---------------|
| xxx  | 否          | 需要       | 不需要           |
|      |            |          |               |

  接口测试:

  性能测试:

  并发测试:

  其他:



See merge request: openharmony/third_party_rust_aho-corasick!5
OpenHarmony-v6.1-Release OpenHarmony-v7.0-Beta1
2025-12-31 22:04:59 +08:00
ljy9810 0790e541ad aho-corasick新增bundle.json部件化
Signed-off-by: ljy9810 <longjianyin@h-partners.com>
2025-12-24 09:19:03 +08:00
openharmony_ci 213f14d2cb !3 修改软件名
Merge pull request !3 from archane/master
OpenHarmony-v6.0.0.1-Release OpenHarmony-v6.0-Release OpenHarmony-v6.0-Beta1 OpenHarmony-v5.1.0-Release OpenHarmony-v6.0.0.2-Release
2024-11-04 08:10:59 +00:00
zhaipeizhe 985bfdf99d update Name in README.OpenSource
Signed-off-by: zhaipeizhe <zhaipeizhe@huawei.com>
Change-Id: I3741af390f8f8373cddd3043b788676b1062c8c3
2024-10-31 16:19:15 +08:00
openharmony_ci 741ee37edd !2 Add OAT.xml and README.OpenSource
Merge pull request !2 from fangting/master
OpenHarmony-v4.1.4-Release OpenHarmony-v4.1.3-Release OpenHarmony-v4.1.2-Release OpenHarmony-v4.0.4-Release OpenHarmony-v5.0.0-Release OpenHarmony-v4.0.3-Release OpenHarmony-v4.0.2-Release OpenHarmony-v5.0-Beta1 OpenHarmony-v4.1-Beta1 OpenHarmony-v4.0-Beta1 OpenHarmony-v4.0-Beta2 OpenHarmony-v4.0-Release OpenHarmony-v4.0.1-Release OpenHarmony-v4.1-Release OpenHarmony-v4.1.1-Release master-v weekly_20240115-v
2023-04-14 08:11:08 +00:00
fangting 0045b58b48 Add OAT.xml and README.OpenSource
Signed-off-by: fangting <fangting12@huawei.com>
2023-04-14 14:14:34 +08:00
openharmony_ci 33187bc398 !1 [aho-corasick]Add GN Build Files and Custom Modifications to Rust Third-party Libraries
Merge pull request !1 from lubinglun/master
2023-04-13 11:34:10 +00:00
lubinglun 339fac44be Add GN Build Files and Custom Modifications
Issue:https://gitee.com/openharmony/build/issues/I6UFTP
Signed-off-by: lubinglun <lubinglun@huawei.com>
2023-04-12 17:25:42 +08:00
Andrew Gallant 9efa6b93d9 0.7.20 github.com/BurntSushi/aho-corasick/0.7.20 github.com/BurntSushi/aho-corasick.git/0.7.20 2022-11-21 22:35:53 -05:00
Andrew Gallant 188a9d929d nfa: fix 'heap_bytes' calculation
We weren't previously accounting for the memory used by 'State' itself,
and instead only counts the *heap* memory used by 'State'.

Fixes #85
2022-11-21 22:00:54 -05:00
Andrew Gallant dc10f6b33c doc: note that Unicode case folding is unlikely to happen
Closes #70
2022-11-21 22:00:54 -05:00
Alex Touchet 5fc413694c cargo: fix license specification + badge
PR #87
2022-11-21 21:47:06 -05:00
James Youngman aa17ac3329 doc: fix wording
PR #90
2022-11-21 21:45:36 -05:00
Bráulio Bezerra d3e228e4ba doc: remove duplicate "the"
PR #94
2022-11-21 21:44:52 -05:00
Andrew Gallant f335ae6ab5 nfa: massively simplify leftmost failure transitions
The key insight here is that all we need to do to support leftmost
semantics is to omit ALL failure transitions that appear after a match
state in the trie. (And to omit any entries in the trie that cross a
previously existing match state for leftmost-first semantics, and keep
them for leftmost-longest.)

Previously, I had somehow convinced myself that the subset was more
difficult to identify and required comparing depths. But this is just
not the case. Moreover, once you set the match state to have a failure
transition to the dead state, it automatically propagates to all
subsequent states.

This is such a huge simplification that I combined the 'standard' and
'leftmost' failure transition construction into a single method.

Fixes #92
2022-11-21 21:41:46 -05:00
Andrew Gallant 0f01af07fa 0.7.19 2022-09-03 13:30:50 -04:00
Andrew Gallant 1701e28080 ci: switch from 'v1' to 'master' for dtolnay action 2022-09-03 13:30:01 -04:00
Ten0 162f9c187d api: add Match::len method
PR #97
2022-09-03 13:28:54 -04:00
Andrew Gallant 6cf8ffd7f4 ci: switch to dtolnay/rust-toolchain
The actions-rs/toolchain project appears dead.
2022-07-14 13:21:10 -04:00
Andrew Gallant 1936502eaa ci: pin cross to v0.2.1
Ref https://github.com/rust-lang/regex/pull/869
2022-06-14 09:15:27 -04:00
Andrew Gallant 4fe9458b1d lint: remove dead code
The unused 'start' field in NonMatch is likely a remnant of some
experiments I was doing to get streaming search working with
leftmost match semantics.

The fact that 'config' is unused in the packed searcher was at
first surprising, but it's only ever used as part of construction.
2022-06-02 11:58:26 -04:00
Eli Doran fd2ee08bc8 doc: fix a few typos
PR #86
2021-07-03 07:52:44 -04:00
Petar Dambovaliev cd0718fc87 impl: remove unused field and elide lifetime
Fixes #80
2021-05-12 12:01:21 -04:00
Alex Touchet b5141eb8ac doc: update links
PR #79
2021-05-06 10:49:21 -04:00
Andrew Gallant 5133d93638 readme: add link to Python wrapper
Kudos to @itamarst for putting in the work to build a nice wrapper!

Closes #77
2021-05-03 17:48:34 -04:00
Andrew Gallant f7e6fc8684 0.7.18 2021-04-30 19:53:19 -04:00
Andrew Gallant 9c8acf53d6 build: fix compilation on i686
It looks like 'cargo fix' didn't quite fix all 'use' statements.
2021-04-30 19:52:55 -04:00
Andrew Gallant 722ef21bb1 0.7.17 2021-04-30 19:38:02 -04:00
Andrew Gallant 85ff1d5edc deps: update to memchr 2.4
We also use the 'std' feature in lieu of the 'use_std' feature, which
was deprecated quite some time ago.
2021-04-30 19:35:31 -04:00
Andrew Gallant 2c492bfe4c msrv: bump to Rust 1.41
This is in line with similar changes to the regex and memchr crates:
https://github.com/BurntSushi/memchr/pull/82
and
https://github.com/rust-lang/regex/pull/767
2021-04-30 19:35:31 -04:00
Andrew Gallant ffc2858726 api: deprecate byte classes and premultiply options
These options aren't really carrying their weight. In a future release,
aho-corasick will make both options enabled by default all the time with
the impossibility of disabling them. The main reason for this is that
these options require a quadrupling in the amount of code in this crate.

While it's possible to see a performance hit when using byte classes, it
should generally be very small. The improvement, if one exists, just
doesn't see worth it.

Please see https://github.com/BurntSushi/aho-corasick/issues/57 for more
discussion.

This is meant to mirror a similar decision occurring in regex-automata:
https://github.com/BurntSushi/regex-automata/issues/7.
2021-04-30 19:35:31 -04:00
Andrew Gallant 3add3a7327 bench: update to criterion 0.3.4 2021-04-30 19:35:31 -04:00
Andrew Gallant 09e34c19d4 edition: run 'cargo fix --edition --edition-idioms' 2021-04-30 19:35:31 -04:00
Andrew Gallant e506f5c9b2 edition: run 'cargo fix --edition --all' 2021-04-30 19:35:31 -04:00
Andrew Gallant f9f59880a7 0.7.15 2020-11-03 12:20:49 -05:00
Andrew Gallant fc54fd9e85 nfa: fix another ASCII case insensitive bug
When building the failure transitions, we iterate over the transitions
of each state. When ASCII case insensitivity is enabled, it's possible
for this transition list to contain duplicate states which in turn
results in creating duplicate matches in the NFA graph. It turns out
that this is strictly redundant work, so if we had already see that
state, we can skip it.

Fixes #68
2020-11-03 12:20:37 -05:00
Andrew Gallant 7ed57b504a ci: fix setting of environment variables
See: https://docs.github.com/en/free-pro-team@latest/actions/reference/workflow-commands-for-github-actions#environment-files

See: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/
2020-10-12 19:59:29 -04:00
Andrew Gallant 7ac7e0ae33 0.7.14 2020-10-12 19:34:57 -04:00
Andrew Gallant d7f1abaf36 prefilter: fix bug when doing a stream search
This fixes yet another bug in the prefilter. Sigh. This only occurs when
doing a stream search. The problem is that the stream handling code
assumes that if no match is found at the end of the buffer, then the
current state of the automaton is correctly updated and the buffer can
be rolled.

With most prefilters that look for a candidate *start* of a match, this
is okay. If a prefilter can't find anything, then there's nothing to
start and the current state remains in the starting state.

But if the prefilter looks for a byte that may not be at the start of
the match---like the rare byte prefilter---then we cannot assume that a
match doesn't begin near the end of the buffer searched. And in this
case, the internal implementation of search doesn't correctly hold up
it's contract because the current state won't be updated. That is, there
is an embedded assumption that if a prefilter fails then there is no
match and thus there is no need to update the current state ID. But of
course, this is just not true in a streaming context.

The right way to fix this is unfortunately to rethink how we've
implemented stream searching and make it aware of these kinds of
prefilters. I think, anyway. The other option would be to fix the lower
level search APIs to always make sure the current state ID is correct.
That would fix everything, but that seems tricky and probably requires
some delicate handling.

So for now, we just disable a prefilter entirely if it's a rare byte
prefilter and we're doing a stream search. We could build a backup
prefilter and still use that, but it feels like a gross hack. At least
now, we preserve correctness.

Kudos to @ogoffart who did the initial investigation here and came up
with a regression test, which is included in this commit. Note though,
that some tests do fail when the buffer's size is set to its minimum. So
there was a regression at some point because we aren't getting the best
test coverage. We should just bite the buffer and make the buffer size
configurable as an internal API so that tests can tweak it and provoke
more edge cases.

Fixes #64
2020-10-12 19:34:39 -04:00
Ten0 db5f33e30b doc: fix confusing typo
PR #63
2020-07-01 13:16:53 -04:00
Andrew Gallant 74f5e8b088 0.7.13 2020-06-23 08:27:48 -04:00
Andrew Gallant ad8f241143 tests: remove use of doc_comment crate
It relies on `cfg(doctest)`, which wasn't stabilized until Rust 1.43.
Interestingly, it compiled on Rust 1.28, but didn't compile on, e.g.,
Rust 1.39. This breaks our MSRV policy, so we unfortunately remove the
use of doc_comment for now. It's likely possible to conditionally
enable it, but the extra build script required to do version sniffing to
do it doesn't seem worth it.

The same problem occurred with the regex crate:
https://github.com/rust-lang/regex/commit/d7fbd158f7e62e9319fcc254bde43b954511a669

Fixes #62
2020-06-23 08:26:27 -04:00
Andrew Gallant 3af59a94cc 0.7.12 2020-06-22 13:33:20 -04:00
Andrew Gallant 4591efb451 doc: update some documentation
This adds a few things to the feature list and updates the section on
prefilters to be in line with the current implementation. (The section
on prefilters had been written before aho-corasick adopted the Teddy
implementation.)
2020-06-22 13:32:31 -04:00
Andrew Gallant 1f2880897f 0.7.11 2020-06-22 12:58:37 -04:00
Draphar 3b36868ace api: respect the closure return value
This fixes a bug where the replace_all_with routine wouldn't actually
stop when the closure returned false, even though the documentation
promised it would.

This commit includes test cases in the form of documentation examples.

Closes #59
2020-06-22 12:58:28 -04:00
Guillaume Gomez c3062d7a60 tests: replace "cfg(test)" with "cfg(doctest)" for readme testing
rustdoc now passes "doctest" when running in test mode.

PR #60
2020-05-07 08:07:51 -04:00
Andrew Gallant 21ff5a83f5 0.7.10 2020-03-08 19:56:29 -04:00
Andrew Gallant af01248baf style: fix rust-analyzer warnings
I still haven't figured out how to turn these warnings off. So just fix
them.
2020-03-08 19:56:08 -04:00
Andrew Gallant a108bdd9ce prefilter: fix another case insensitive prefilter bug
This fixes another bug in the handling of case insensitivity inside
the rare byte prefilter. In particular, we were not correctly populating
the byte offset table when ASCII case insensitivity was enabled. Instead
of just setting the offsets for bytes we've seen, we also need to set
offsets for the ASCII case insensitive version of each byte we see. We
add that in this commit along with a regression test.

Fixes #55
2020-03-08 19:56:08 -04:00