mirror of
https://github.com/BurntSushi/ripgrep.git
synced 2025-08-03 05:32:04 -07:00
Compare commits
3 Commits
grep-0.2.1
...
ag/index
Author | SHA1 | Date | |
---|---|---|---|
|
60a1db34a6 | ||
|
87b33c96c0 | ||
|
5e975c43f8 |
8
Cargo.lock
generated
8
Cargo.lock
generated
@@ -179,6 +179,14 @@ dependencies = [
|
|||||||
"winapi-util",
|
"winapi-util",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "grep-index"
|
||||||
|
version = "0.0.1"
|
||||||
|
dependencies = [
|
||||||
|
"bstr 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
"regex-syntax 0.6.14 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "grep-matcher"
|
name = "grep-matcher"
|
||||||
version = "0.1.5"
|
version = "0.1.5"
|
||||||
|
@@ -32,6 +32,7 @@ members = [
|
|||||||
"crates/globset",
|
"crates/globset",
|
||||||
"crates/grep",
|
"crates/grep",
|
||||||
"crates/cli",
|
"crates/cli",
|
||||||
|
"crates/index",
|
||||||
"crates/matcher",
|
"crates/matcher",
|
||||||
"crates/pcre2",
|
"crates/pcre2",
|
||||||
"crates/printer",
|
"crates/printer",
|
||||||
|
@@ -146,9 +146,9 @@ pub const DEFAULT_TYPES: &[(&str, &[&str])] = &[
|
|||||||
]),
|
]),
|
||||||
("mako", &["*.mako", "*.mao"]),
|
("mako", &["*.mako", "*.mao"]),
|
||||||
("man", &["*.[0-9lnpx]", "*.[0-9][cEFMmpSx]"]),
|
("man", &["*.[0-9lnpx]", "*.[0-9][cEFMmpSx]"]),
|
||||||
("markdown", &["*.markdown", "*.md", "*.mdown", "*.mkdn"]),
|
("markdown", &["*.markdown", "*.md", "*.mdown", "*.mkd", "*.mkdn"]),
|
||||||
("matlab", &["*.m"]),
|
("matlab", &["*.m"]),
|
||||||
("md", &["*.markdown", "*.md", "*.mdown", "*.mkdn"]),
|
("md", &["*.markdown", "*.md", "*.mdown", "*.mkd", "*.mkdn"]),
|
||||||
("meson", &["meson.build", "meson_options.txt"]),
|
("meson", &["meson.build", "meson_options.txt"]),
|
||||||
("minified", &["*.min.html", "*.min.css", "*.min.js"]),
|
("minified", &["*.min.html", "*.min.css", "*.min.js"]),
|
||||||
("mint", &["*.mint"]),
|
("mint", &["*.mint"]),
|
||||||
@@ -167,7 +167,12 @@ pub const DEFAULT_TYPES: &[(&str, &[&str])] = &[
|
|||||||
("pascal", &["*.pas", "*.dpr", "*.lpr", "*.pp", "*.inc"]),
|
("pascal", &["*.pas", "*.dpr", "*.lpr", "*.pp", "*.inc"]),
|
||||||
("pdf", &["*.pdf"]),
|
("pdf", &["*.pdf"]),
|
||||||
("perl", &["*.perl", "*.pl", "*.PL", "*.plh", "*.plx", "*.pm", "*.t"]),
|
("perl", &["*.perl", "*.pl", "*.PL", "*.plh", "*.plx", "*.pm", "*.t"]),
|
||||||
("php", &["*.php", "*.php3", "*.php4", "*.php5", "*.phtml"]),
|
("php", &[
|
||||||
|
// note that PHP 6 doesn't exist
|
||||||
|
// See: https://wiki.php.net/rfc/php6
|
||||||
|
"*.php", "*.php3", "*.php4", "*.php5", "*.php7", "*.php8",
|
||||||
|
"*.pht", "*.phtml"
|
||||||
|
]),
|
||||||
("po", &["*.po"]),
|
("po", &["*.po"]),
|
||||||
("pod", &["*.pod"]),
|
("pod", &["*.pod"]),
|
||||||
("postscript", &["*.eps", "*.ps"]),
|
("postscript", &["*.eps", "*.ps"]),
|
||||||
|
19
crates/index/Cargo.toml
Normal file
19
crates/index/Cargo.toml
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
[package]
|
||||||
|
publish = false
|
||||||
|
name = "grep-index"
|
||||||
|
version = "0.0.1" #:version
|
||||||
|
authors = ["Andrew Gallant <jamslam@gmail.com>"]
|
||||||
|
description = """
|
||||||
|
Grep, but with an index.
|
||||||
|
"""
|
||||||
|
documentation = "https://docs.rs/grep-index"
|
||||||
|
homepage = "https://github.com/BurntSushi/ripgrep"
|
||||||
|
repository = "https://github.com/BurntSushi/ripgrep"
|
||||||
|
readme = "README.md"
|
||||||
|
keywords = ["regex", "grep", "search", "index", "ngram"]
|
||||||
|
license = "Unlicense/MIT"
|
||||||
|
edition = "2018"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
bstr = "0.2"
|
||||||
|
regex-syntax = "0.6.14"
|
21
crates/index/LICENSE-MIT
Normal file
21
crates/index/LICENSE-MIT
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
The MIT License (MIT)
|
||||||
|
|
||||||
|
Copyright (c) 2015 Andrew Gallant
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in
|
||||||
|
all copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||||
|
THE SOFTWARE.
|
8
crates/index/README.md
Normal file
8
crates/index/README.md
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
grep-index
|
||||||
|
----------
|
||||||
|
WIP.
|
||||||
|
|
||||||
|
[](https://github.com/BurntSushi/ripgrep/actions)
|
||||||
|
[](https://crates.io/crates/grep-index)
|
||||||
|
|
||||||
|
Dual-licensed under MIT or the [UNLICENSE](http://unlicense.org).
|
24
crates/index/UNLICENSE
Normal file
24
crates/index/UNLICENSE
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
This is free and unencumbered software released into the public domain.
|
||||||
|
|
||||||
|
Anyone is free to copy, modify, publish, use, compile, sell, or
|
||||||
|
distribute this software, either in source code form or as a compiled
|
||||||
|
binary, for any purpose, commercial or non-commercial, and by any
|
||||||
|
means.
|
||||||
|
|
||||||
|
In jurisdictions that recognize copyright laws, the author or authors
|
||||||
|
of this software dedicate any and all copyright interest in the
|
||||||
|
software to the public domain. We make this dedication for the benefit
|
||||||
|
of the public at large and to the detriment of our heirs and
|
||||||
|
successors. We intend this dedication to be an overt act of
|
||||||
|
relinquishment in perpetuity of all present and future rights to this
|
||||||
|
software under copyright law.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||||
|
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||||
|
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||||
|
OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
For more information, please refer to <http://unlicense.org/>
|
7
crates/index/src/lib.rs
Normal file
7
crates/index/src/lib.rs
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
/*!
|
||||||
|
TODO
|
||||||
|
*/
|
||||||
|
|
||||||
|
#![allow(warnings)]
|
||||||
|
|
||||||
|
mod literal;
|
1040
crates/index/src/literal.rs
Normal file
1040
crates/index/src/literal.rs
Normal file
File diff suppressed because it is too large
Load Diff
@@ -191,7 +191,7 @@ impl ConfiguredHIR {
|
|||||||
/// text anchors. We disable it by not returning a line terminator, since
|
/// text anchors. We disable it by not returning a line terminator, since
|
||||||
/// without a line terminator, the fast search path can't be executed.
|
/// without a line terminator, the fast search path can't be executed.
|
||||||
///
|
///
|
||||||
/// See: https://github.com/BurntSushi/ripgrep/issues/2260
|
/// See: <https://github.com/BurntSushi/ripgrep/issues/2260>
|
||||||
pub fn line_terminator(&self) -> Option<LineTerminator> {
|
pub fn line_terminator(&self) -> Option<LineTerminator> {
|
||||||
if self.is_any_anchored() {
|
if self.is_any_anchored() {
|
||||||
None
|
None
|
||||||
|
Reference in New Issue
Block a user