Changeset - 1e7b35645ea4
[Not reviewed]
default
1 5 1
Laman - 9 months ago 2024-07-09 14:07:29

renamed the package to regular-expresso
6 files changed with 10 insertions and 9 deletions:
0 comments (0 inline, 0 general)
Cargo.lock
Show inline comments
 
@@ -3,5 +3,5 @@
 
version = 3
 

	
 
[[package]]
 
name = "regexp"
 
name = "regular-expresso"
 
version = "1.0.0"
Cargo.toml
Show inline comments
 
[package]
 
name = "regexp"
 
name = "regular-expresso"
 
version = "1.0.0"
 
edition = "2021"
 
license = " GPL-3.0-or-later"
README.md
Show inline comments
 
@@ -16,16 +16,19 @@ Licensed under GNU GPLv3 or newer.
 
The python code supports Python 3.9 and higher. The rust code is written for Rust edition 2021.
 

	
 
```
 
# If you want to use Rust, compile it first
 
cargo build --release
 

	
 
# Match a string against a pattern (returns true or false)
 
python regexp.py match PATTERN STRING
 
python regular-expresso.py match PATTERN STRING
 
# or
 
cargo run match PATTERN STRING
 
./target/release/regular-expresso match PATTERN STRING
 

	
 
# Compare two regexps and return None of they are equivalent, or the shortest string that can distinguish them
 
# That is, it gets accepted by one, but not the other
 
python regexp.py compare PATTERN1 PATTERN2
 
# or
 
cargo run compare PATTERN1 PATTERN2
 
./target/release/regular-expresso compare PATTERN1 PATTERN2
 
```
 

	
 
## Theory
regular-expresso.py
Show inline comments
 
file renamed from regexp.py to regular-expresso.py
src/main.rs
Show inline comments
 
use std::env;
 
use regexp::RegexpDFA;
 
use regular_expresso::RegexpDFA;
 

	
 
fn test() {
 
	let tests = ["", "a", "ab", "aabb", "abab", "abcd", "abcbcdbcd"];
tests/test_regexp.rs
Show inline comments
 
use regexp::RegexpNFA;
 
use regexp::RegexpDFA;
 
use regexp::ParsingError;
 
use regular_expresso::{RegexpNFA, RegexpDFA, ParsingError};
 

	
 
#[test]
 
fn test_eval_basic_nfa() {
0 comments (0 inline, 0 general)