Skip to content

Commit

Permalink
syntax: absorb utf8-ranges crate
Browse files Browse the repository at this point in the history
This commit brings the utf8-ranges crate into regex-syntax as a utf8
sub-module.

This was done because it was observed that utf8-ranges is effectively
unused outside the context of regex-syntax. It is a very small amount of
code, and fits alongside the rest of regex-syntax. In particular, anyone
building a regex engine using regex-syntax will likely need this code
anyway.
  • Loading branch information
BurntSushi committed Aug 3, 2019
1 parent 6b86983 commit caa075f
Show file tree
Hide file tree
Showing 7 changed files with 524 additions and 7 deletions.
2 changes: 0 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,6 @@ memchr = "2.2.1"
thread_local = "0.3.6"
# For parsing regular expressions.
regex-syntax = { path = "regex-syntax", version = "0.6.9" }
# For compiling UTF-8 decoding into automata.
utf8-ranges = "1.0.1"

[dev-dependencies]
# For examples.
Expand Down
1 change: 0 additions & 1 deletion regex-debug/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,3 @@ regex = { version = "1.1", path = ".." }
regex-syntax = { version = "0.6", path = "../regex-syntax" }
serde = "1"
serde_derive = "1"
utf8-ranges = "1"
3 changes: 1 addition & 2 deletions regex-debug/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ extern crate regex_syntax as syntax;
extern crate serde;
#[macro_use]
extern crate serde_derive;
extern crate utf8_ranges;

use std::error;
use std::io::{self, Write};
Expand Down Expand Up @@ -207,8 +206,8 @@ fn cmd_compile(args: &Args) -> Result<()> {

fn cmd_utf8_ranges(args: &Args) -> Result<()> {
use syntax::hir::{self, HirKind};
use syntax::utf8::Utf8Sequences;
use syntax::ParserBuilder;
use utf8_ranges::Utf8Sequences;

let hir = ParserBuilder::new()
.build()
Expand Down
1 change: 1 addition & 0 deletions regex-syntax/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ pub mod hir;
mod parser;
mod unicode;
mod unicode_tables;
pub mod utf8;

/// Escapes all regular expression meta characters in `text`.
///
Expand Down
Loading

0 comments on commit caa075f

Please sign in to comment.