From 442ae421cf98d11734f2a530b8e9f7c6a3067ef4 Mon Sep 17 00:00:00 2001 From: Ludwig Stecher Date: Sat, 2 Jul 2022 23:02:23 +0200 Subject: [PATCH] Rename rulex to pomsky --- .github/ISSUE_TEMPLATE/bug_report.md | 16 +++-- .github/workflows/release.yml | 15 ++--- CHANGELOG.md | 40 ++++++------ Cargo.lock | 64 +++++++++---------- Cargo.toml | 4 +- README.md | 33 +++++----- benchmark/Cargo.toml | 4 +- benchmark/benches/main.rs | 18 +++--- justfile | 16 ++--- {rulex-bin => pomsky-bin}/Cargo.toml | 20 +++--- {rulex-bin => pomsky-bin}/README.md | 33 ++++------ {rulex-bin => pomsky-bin}/src/main.rs | 16 ++--- {rulex-lib => pomsky-lib}/Cargo.toml | 12 ++-- {rulex-lib => pomsky-lib}/afl-fuzz/.gitignore | 0 {rulex-lib => pomsky-lib}/afl-fuzz/Cargo.lock | 20 +++--- {rulex-lib => pomsky-lib}/afl-fuzz/Cargo.toml | 2 +- {rulex-lib => pomsky-lib}/afl-fuzz/in/1.txt | 0 .../afl-fuzz/src/main.rs | 4 +- {rulex-lib => pomsky-lib}/fuzz/.gitignore | 0 {rulex-lib => pomsky-lib}/fuzz/Cargo.lock | 34 +++++----- {rulex-lib => pomsky-lib}/fuzz/Cargo.toml | 4 +- .../fuzz/fuzz_targets/parse_and_compile.rs | 6 +- {rulex-lib => pomsky-lib}/src/alternation.rs | 6 +- {rulex-lib => pomsky-lib}/src/boundary.rs | 4 +- .../src/char_class/ascii.rs | 0 .../src/char_class/char_group.rs | 0 .../src/char_class/mod.rs | 4 +- .../src/char_class/unicode.rs | 0 {rulex-lib => pomsky-lib}/src/compile.rs | 0 .../src/error/compile_error.rs | 4 +- .../src/error/diagnostics.rs | 4 +- {rulex-lib => pomsky-lib}/src/error/mod.rs | 2 +- .../src/error/parse_error.rs | 2 +- {rulex-lib => pomsky-lib}/src/features.rs | 22 +++---- {rulex-lib => pomsky-lib}/src/grapheme.rs | 4 +- {rulex-lib => pomsky-lib}/src/group.rs | 4 +- {rulex-lib => pomsky-lib}/src/lib.rs | 42 ++++++------ {rulex-lib => pomsky-lib}/src/literal.rs | 0 {rulex-lib => pomsky-lib}/src/lookaround.rs | 10 +-- {rulex-lib => pomsky-lib}/src/options.rs | 18 +++--- {rulex-lib => pomsky-lib}/src/parse/input.rs | 0 {rulex-lib => pomsky-lib}/src/parse/mod.rs | 0 .../src/parse/parsers.rs | 2 +- {rulex-lib => pomsky-lib}/src/parse/token.rs | 0 .../src/parse/tokenize.rs | 0 {rulex-lib => pomsky-lib}/src/range.rs | 4 +- {rulex-lib => pomsky-lib}/src/reference.rs | 4 +- {rulex-lib => pomsky-lib}/src/regex/mod.rs | 0 {rulex-lib => pomsky-lib}/src/repetition.rs | 0 {rulex-lib => pomsky-lib}/src/rule.rs | 2 +- {rulex-lib => pomsky-lib}/src/span.rs | 0 {rulex-lib => pomsky-lib}/src/stmt.rs | 6 +- {rulex-lib => pomsky-lib}/src/var.rs | 0 {rulex-lib => pomsky-lib}/src/warning.rs | 0 {rulex-lib => pomsky-lib}/tests/it/args.rs | 0 {rulex-lib => pomsky-lib}/tests/it/color.rs | 0 {rulex-lib => pomsky-lib}/tests/it/files.rs | 4 +- {rulex-lib => pomsky-lib}/tests/it/fuzzer.rs | 4 +- {rulex-lib => pomsky-lib}/tests/it/main.rs | 0 {rulex-lib => pomsky-lib}/tests/it/timeout.rs | 0 .../tests/testcases/basics/0.txt | 0 .../tests/testcases/basics/1.txt | 0 .../tests/testcases/basics/2.txt | 0 .../tests/testcases/basics/3.txt | 0 .../tests/testcases/basics/4.txt | 0 .../tests/testcases/basics/5.txt | 0 .../tests/testcases/basics/6.txt | 0 .../tests/testcases/basics/7.txt | 0 .../tests/testcases/classes/0.txt | 0 .../tests/testcases/classes/1.txt | 0 .../tests/testcases/classes/10.txt | 0 .../tests/testcases/classes/11.txt | 0 .../tests/testcases/classes/12.txt | 0 .../tests/testcases/classes/13.txt | 0 .../tests/testcases/classes/14.txt | 0 .../tests/testcases/classes/15.txt | 0 .../tests/testcases/classes/16.txt | 0 .../tests/testcases/classes/17.txt | 0 .../tests/testcases/classes/18.txt | 0 .../tests/testcases/classes/19.txt | 0 .../tests/testcases/classes/2.txt | 0 .../tests/testcases/classes/3.txt | 0 .../tests/testcases/classes/4.txt | 0 .../tests/testcases/classes/5.txt | 0 .../tests/testcases/classes/6.txt | 0 .../tests/testcases/classes/7.txt | 0 .../tests/testcases/classes/8.txt | 0 .../tests/testcases/classes/9.txt | 0 .../tests/testcases/errors/0.txt | 0 .../tests/testcases/errors/1.txt | 0 .../tests/testcases/errors/10.txt | 0 .../tests/testcases/errors/11.txt | 0 .../tests/testcases/errors/12.txt | 0 .../tests/testcases/errors/13.txt | 0 .../tests/testcases/errors/14.txt | 0 .../tests/testcases/errors/15.txt | 0 .../tests/testcases/errors/16.txt | 0 .../tests/testcases/errors/17.txt | 0 .../tests/testcases/errors/18.txt | 0 .../tests/testcases/errors/19.txt | 0 .../tests/testcases/errors/2.txt | 0 .../tests/testcases/errors/20.txt | 0 .../tests/testcases/errors/21.txt | 0 .../tests/testcases/errors/22.txt | 0 .../tests/testcases/errors/23.txt | 2 +- .../tests/testcases/errors/24.txt | 2 +- .../tests/testcases/errors/25.txt | 0 .../tests/testcases/errors/3.txt | 0 .../tests/testcases/errors/4.txt | 0 .../tests/testcases/errors/5.txt | 0 .../tests/testcases/errors/6.txt | 0 .../tests/testcases/errors/7.txt | 0 .../tests/testcases/errors/9.txt | 0 .../tests/testcases/negation/1.txt | 0 .../tests/testcases/negation/10.txt | 0 .../tests/testcases/negation/11.txt | 0 .../tests/testcases/negation/12.txt | 0 .../tests/testcases/negation/13.txt | 0 .../tests/testcases/negation/14.txt | 0 .../tests/testcases/negation/15.txt | 0 .../tests/testcases/negation/16.txt | 0 .../tests/testcases/negation/17.txt | 0 .../tests/testcases/negation/18.txt | 0 .../tests/testcases/negation/2.txt | 0 .../tests/testcases/negation/3.txt | 0 .../tests/testcases/negation/4.txt | 0 .../tests/testcases/negation/5.txt | 0 .../tests/testcases/negation/6.txt | 0 .../tests/testcases/negation/7.txt | 0 .../tests/testcases/negation/8.txt | 0 .../tests/testcases/negation/9.txt | 0 .../tests/testcases/ranges/1.txt | 0 .../tests/testcases/ranges/10.txt | 0 .../tests/testcases/ranges/11.txt | 0 .../tests/testcases/ranges/12.txt | 0 .../tests/testcases/ranges/13.txt | 0 .../tests/testcases/ranges/14.txt | 0 .../tests/testcases/ranges/15.txt | 0 .../tests/testcases/ranges/2.txt | 0 .../tests/testcases/ranges/3.txt | 0 .../tests/testcases/ranges/4.txt | 0 .../tests/testcases/ranges/5.txt | 0 .../tests/testcases/ranges/6.txt | 0 .../tests/testcases/ranges/7.txt | 0 .../tests/testcases/ranges/8.txt | 0 .../tests/testcases/ranges/9.txt | 0 .../tests/testcases/regex-diagnostics/1.txt | 0 .../tests/testcases/regex-diagnostics/10.txt | 0 .../tests/testcases/regex-diagnostics/11.txt | 0 .../tests/testcases/regex-diagnostics/12.txt | 0 .../tests/testcases/regex-diagnostics/13.txt | 0 .../tests/testcases/regex-diagnostics/14.txt | 0 .../tests/testcases/regex-diagnostics/15.txt | 0 .../tests/testcases/regex-diagnostics/16.txt | 0 .../tests/testcases/regex-diagnostics/17.txt | 0 .../tests/testcases/regex-diagnostics/18.txt | 0 .../tests/testcases/regex-diagnostics/2.txt | 0 .../tests/testcases/regex-diagnostics/3.txt | 0 .../tests/testcases/regex-diagnostics/4.txt | 0 .../tests/testcases/regex-diagnostics/5.txt | 0 .../tests/testcases/regex-diagnostics/6.txt | 0 .../tests/testcases/regex-diagnostics/7.txt | 0 .../tests/testcases/regex-diagnostics/8.txt | 0 .../tests/testcases/regex-diagnostics/9.txt | 0 .../tests/testcases/repetitions/0.txt | 0 .../tests/testcases/repetitions/1.txt | 0 .../tests/testcases/repetitions/10.txt | 0 .../tests/testcases/repetitions/11.txt | 0 .../tests/testcases/repetitions/12.txt | 0 .../tests/testcases/repetitions/13.txt | 0 .../tests/testcases/repetitions/2.txt | 0 .../tests/testcases/repetitions/3.txt | 0 .../tests/testcases/repetitions/4.txt | 0 .../tests/testcases/repetitions/5.txt | 0 .../tests/testcases/repetitions/6.txt | 0 .../tests/testcases/repetitions/7.txt | 0 .../tests/testcases/repetitions/8.txt | 0 .../tests/testcases/repetitions/9.txt | 0 .../tests/testcases/strings/0.txt | 0 .../tests/testcases/strings/1.txt | 0 .../tests/testcases/strings/100.txt | 0 .../tests/testcases/strings/101.txt | 0 .../tests/testcases/strings/2.txt | 0 .../tests/testcases/strings/3.txt | 0 .../tests/testcases/variables/0.txt | 0 .../tests/testcases/variables/1.txt | 0 .../tests/testcases/variables/10.txt | 0 .../tests/testcases/variables/100.txt | 0 .../tests/testcases/variables/101.txt | 0 .../tests/testcases/variables/102.txt | 0 .../tests/testcases/variables/103.txt | 0 .../tests/testcases/variables/104.txt | 0 .../tests/testcases/variables/105.txt | 0 .../tests/testcases/variables/106.txt | 0 .../tests/testcases/variables/107.txt | 0 .../tests/testcases/variables/108.txt | 0 .../tests/testcases/variables/109.txt | 0 .../tests/testcases/variables/2.txt | 0 .../tests/testcases/variables/3.txt | 0 .../tests/testcases/variables/4.txt | 0 .../tests/testcases/variables/5.txt | 0 .../tests/testcases/variables/6.txt | 0 .../tests/testcases/variables/7.txt | 0 .../tests/testcases/variables/8.txt | 0 .../tests/testcases/variables/9.txt | 0 .../tests/testcases/warnings/1.txt | 0 pomsky-macro/Cargo.toml | 22 +++++++ {rulex-macro => pomsky-macro}/README.md | 12 ++-- .../src/diagnostic.rs | 2 +- {rulex-macro => pomsky-macro}/src/lib.rs | 12 ++-- .../tests/test_macro.rs | 8 +-- rulex-macro/Cargo.toml | 22 ------- 212 files changed, 292 insertions(+), 303 deletions(-) rename {rulex-bin => pomsky-bin}/Cargo.toml (64%) rename {rulex-bin => pomsky-bin}/README.md (61%) rename {rulex-bin => pomsky-bin}/src/main.rs (93%) rename {rulex-lib => pomsky-lib}/Cargo.toml (77%) rename {rulex-lib => pomsky-lib}/afl-fuzz/.gitignore (100%) rename {rulex-lib => pomsky-lib}/afl-fuzz/Cargo.lock (99%) rename {rulex-lib => pomsky-lib}/afl-fuzz/Cargo.toml (94%) rename {rulex-lib => pomsky-lib}/afl-fuzz/in/1.txt (100%) rename {rulex-lib => pomsky-lib}/afl-fuzz/src/main.rs (70%) rename {rulex-lib => pomsky-lib}/fuzz/.gitignore (100%) rename {rulex-lib => pomsky-lib}/fuzz/Cargo.lock (98%) rename {rulex-lib => pomsky-lib}/fuzz/Cargo.toml (90%) rename {rulex-lib => pomsky-lib}/fuzz/fuzz_targets/parse_and_compile.rs (67%) rename {rulex-lib => pomsky-lib}/src/alternation.rs (93%) rename {rulex-lib => pomsky-lib}/src/boundary.rs (96%) rename {rulex-lib => pomsky-lib}/src/char_class/ascii.rs (100%) rename {rulex-lib => pomsky-lib}/src/char_class/char_group.rs (100%) rename {rulex-lib => pomsky-lib}/src/char_class/mod.rs (99%) rename {rulex-lib => pomsky-lib}/src/char_class/unicode.rs (100%) rename {rulex-lib => pomsky-lib}/src/compile.rs (100%) rename {rulex-lib => pomsky-lib}/src/error/compile_error.rs (97%) rename {rulex-lib => pomsky-lib}/src/error/diagnostics.rs (98%) rename {rulex-lib => pomsky-lib}/src/error/mod.rs (85%) rename {rulex-lib => pomsky-lib}/src/error/parse_error.rs (99%) rename {rulex-lib => pomsky-lib}/src/features.rs (91%) rename {rulex-lib => pomsky-lib}/src/grapheme.rs (90%) rename {rulex-lib => pomsky-lib}/src/group.rs (98%) rename {rulex-lib => pomsky-lib}/src/lib.rs (73%) rename {rulex-lib => pomsky-lib}/src/literal.rs (100%) rename {rulex-lib => pomsky-lib}/src/lookaround.rs (91%) rename {rulex-lib => pomsky-lib}/src/options.rs (74%) rename {rulex-lib => pomsky-lib}/src/parse/input.rs (100%) rename {rulex-lib => pomsky-lib}/src/parse/mod.rs (100%) rename {rulex-lib => pomsky-lib}/src/parse/parsers.rs (99%) rename {rulex-lib => pomsky-lib}/src/parse/token.rs (100%) rename {rulex-lib => pomsky-lib}/src/parse/tokenize.rs (100%) rename {rulex-lib => pomsky-lib}/src/range.rs (99%) rename {rulex-lib => pomsky-lib}/src/reference.rs (97%) rename {rulex-lib => pomsky-lib}/src/regex/mod.rs (100%) rename {rulex-lib => pomsky-lib}/src/repetition.rs (100%) rename {rulex-lib => pomsky-lib}/src/rule.rs (98%) rename {rulex-lib => pomsky-lib}/src/span.rs (100%) rename {rulex-lib => pomsky-lib}/src/stmt.rs (94%) rename {rulex-lib => pomsky-lib}/src/var.rs (100%) rename {rulex-lib => pomsky-lib}/src/warning.rs (100%) rename {rulex-lib => pomsky-lib}/tests/it/args.rs (100%) rename {rulex-lib => pomsky-lib}/tests/it/color.rs (100%) rename {rulex-lib => pomsky-lib}/tests/it/files.rs (99%) rename {rulex-lib => pomsky-lib}/tests/it/fuzzer.rs (98%) rename {rulex-lib => pomsky-lib}/tests/it/main.rs (100%) rename {rulex-lib => pomsky-lib}/tests/it/timeout.rs (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/basics/0.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/basics/1.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/basics/2.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/basics/3.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/basics/4.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/basics/5.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/basics/6.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/basics/7.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/classes/0.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/classes/1.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/classes/10.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/classes/11.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/classes/12.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/classes/13.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/classes/14.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/classes/15.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/classes/16.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/classes/17.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/classes/18.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/classes/19.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/classes/2.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/classes/3.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/classes/4.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/classes/5.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/classes/6.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/classes/7.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/classes/8.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/classes/9.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/errors/0.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/errors/1.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/errors/10.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/errors/11.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/errors/12.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/errors/13.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/errors/14.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/errors/15.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/errors/16.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/errors/17.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/errors/18.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/errors/19.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/errors/2.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/errors/20.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/errors/21.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/errors/22.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/errors/23.txt (84%) rename {rulex-lib => pomsky-lib}/tests/testcases/errors/24.txt (72%) rename {rulex-lib => pomsky-lib}/tests/testcases/errors/25.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/errors/3.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/errors/4.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/errors/5.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/errors/6.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/errors/7.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/errors/9.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/negation/1.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/negation/10.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/negation/11.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/negation/12.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/negation/13.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/negation/14.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/negation/15.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/negation/16.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/negation/17.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/negation/18.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/negation/2.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/negation/3.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/negation/4.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/negation/5.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/negation/6.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/negation/7.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/negation/8.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/negation/9.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/ranges/1.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/ranges/10.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/ranges/11.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/ranges/12.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/ranges/13.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/ranges/14.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/ranges/15.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/ranges/2.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/ranges/3.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/ranges/4.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/ranges/5.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/ranges/6.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/ranges/7.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/ranges/8.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/ranges/9.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/regex-diagnostics/1.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/regex-diagnostics/10.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/regex-diagnostics/11.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/regex-diagnostics/12.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/regex-diagnostics/13.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/regex-diagnostics/14.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/regex-diagnostics/15.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/regex-diagnostics/16.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/regex-diagnostics/17.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/regex-diagnostics/18.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/regex-diagnostics/2.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/regex-diagnostics/3.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/regex-diagnostics/4.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/regex-diagnostics/5.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/regex-diagnostics/6.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/regex-diagnostics/7.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/regex-diagnostics/8.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/regex-diagnostics/9.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/repetitions/0.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/repetitions/1.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/repetitions/10.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/repetitions/11.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/repetitions/12.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/repetitions/13.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/repetitions/2.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/repetitions/3.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/repetitions/4.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/repetitions/5.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/repetitions/6.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/repetitions/7.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/repetitions/8.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/repetitions/9.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/strings/0.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/strings/1.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/strings/100.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/strings/101.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/strings/2.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/strings/3.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/variables/0.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/variables/1.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/variables/10.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/variables/100.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/variables/101.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/variables/102.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/variables/103.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/variables/104.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/variables/105.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/variables/106.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/variables/107.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/variables/108.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/variables/109.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/variables/2.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/variables/3.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/variables/4.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/variables/5.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/variables/6.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/variables/7.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/variables/8.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/variables/9.txt (100%) rename {rulex-lib => pomsky-lib}/tests/testcases/warnings/1.txt (100%) create mode 100644 pomsky-macro/Cargo.toml rename {rulex-macro => pomsky-macro}/README.md (64%) rename {rulex-macro => pomsky-macro}/src/diagnostic.rs (98%) rename {rulex-macro => pomsky-macro}/src/lib.rs (92%) rename {rulex-macro => pomsky-macro}/tests/test_macro.rs (76%) delete mode 100644 rulex-macro/Cargo.toml diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 9021daa..6216f87 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,31 +1,33 @@ --- name: Bug report about: Create a report to help us improve -title: '' +title: "" labels: bug -assignees: '' - +assignees: "" --- ### Describe the bug + A clear and concise description of what the bug is. ### To Reproduce -The rulex expression, the command, or the source code for reproducing the bug. + +The pomsky expression, the command, or the source code for reproducing the bug. ### Expected behavior -A clear and concise description of what you expected to happen. +A clear and concise description of what you expected to happen. ### Additional context -How do you use rulex? E.g. via playground, the CLI, the Rust macro, NodeJS bindings, ... + +How do you use Pomsky? E.g. via playground, the CLI, the Rust macro, NodeJS bindings, ... If you use the CLI or a library, which version? diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a5cf4c8..9327158 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -31,18 +31,13 @@ jobs: draft: false prerelease: false body: | - This is a new release of `rulex`. See what's new in the [changelog](https://github.com/rulex-rs/rulex/blob/${{ steps.vars.outputs.tag }}/CHANGELOG.md). + This is a new release of Pomsky. See what's new in the [changelog](https://github.com/rulex-rs/pomsky/blob/${{ steps.vars.outputs.tag }}/CHANGELOG.md). ### Installation If you're running on Linux, macOS or Windows, you can use the binaries below. - On Arch Linux, you can install the [AUR package](https://aur.archlinux.org/packages/rulex-rs-bin) with - ```sh - yay -S rulex-rs-bin - ``` - - You can also build `rulex` with Cargo, Rusts package manager. To install the Rust toolchain, see the [installation manual](https://www.rust-lang.org/tools/install). Then run + You can also build Pomsky with Cargo, Rusts package manager. To install the Rust toolchain, see the [installation manual](https://www.rust-lang.org/tools/install). Then run ```shell - $ cargo install rulex-bin + $ cargo install pomsky-bin ``` You might have to add the `.cargo/bin` folder to your `PATH` afterwards. Please file issues if you run into any problems or have suggestions. @@ -85,6 +80,6 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: upload_url: ${{ needs.create_release.outputs.upload_url }} - asset_name: rulex_${{ matrix.platform }}_${{ steps.vars.outputs.tag }}${{ matrix.file_ending }} - asset_path: target/release/rulex${{ matrix.file_ending }} + asset_name: pomsky_${{ matrix.platform }}_${{ steps.vars.outputs.tag }}${{ matrix.file_ending }} + asset_path: target/release/pomsky${{ matrix.file_ending }} asset_content_type: application/octet-stream diff --git a/CHANGELOG.md b/CHANGELOG.md index c4d58e7..ad29f17 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ # Changelog -All notable changes to the _rulex regular expression language_ will be documented in this file. +All notable changes to the _Pomsky regular expression language_ will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). @@ -46,7 +46,7 @@ the ASCII line break. ### Fixed/improved -- [#29](https://github.com/rulex-rs/rulex/pull/29): Fix a miscompilation of a repeated empty group, +- [#29](https://github.com/rulex-rs/pomsky/pull/29): Fix a miscompilation of a repeated empty group, e.g. `()?`. Thanks, [sebastiantoh](https://github.com/sebastiantoh)! - Make the parser more permissive to parse arbitrary negated expressions. This results in better @@ -75,14 +75,14 @@ the ASCII line break. ## [0.4.0] - 2022-06-03 The repository was moved to its own organization! ๐ŸŽ‰ It also has a new website with an -[online playground](https://rulex-rs.github.io/playground/)! +[online playground](https://playground.pomsky-lang.org/)! ### Added - API to selectively disable some language features -- [Online playground](https://rulex-rs.github.io/playground/) to try out rulex. You can write - rulex expressions on the left and immediately see the output on the right. +- [Online playground](https://playground.pomsky-lang.org/) to try out Pomsky. You can write + pomsky expressions on the left and immediately see the output on the right. ### Changed @@ -92,18 +92,18 @@ The repository was moved to its own organization! ๐ŸŽ‰ It also has a new website runtime with regard to the number of digits. - `ParseOptions` was moved out of `CompileOptions`. This means that the - [`parse_and_compile`](https://docs.rs/rulex/latest/rulex/struct.Rulex.html#method.parse_and_compile) + [`parse_and_compile`](https://docs.rs/rulex/0.4.0/rulex/struct.Rulex.html#method.parse_and_compile) method now expects three parameters instead of two. ## [0.3.0] - 2022-03-29 ### Added -- A [**book**](https://rulex-rs.github.io/), with instructions, a language tour and a formal +- A [**book**](https://pomsky-lang.org/docs/), with instructions, a language tour and a formal grammar! - **Variables**! For example, `let x = 'test';` declares a variable `x` that can be used below. Read - [this chapter](https://rulex-rs.github.io/docs/language-tour/variables) from the book to find + [this chapter](https://pomsky-lang.org/docs/language-tour/variables) from the book to find out more. - **Number range expressions**! For example, `range '0'-'255'` generates this regex: @@ -133,9 +133,9 @@ The repository was moved to its own organization! ๐ŸŽ‰ It also has a new website - Improved Unicode support - - In addition to Unicode general categories and scripts, rulex now supports blocks and other + - In addition to Unicode general categories and scripts, pomsky now supports blocks and other boolean properties - - Rulex now validates properties and tells you when a property isn't supported by the target + - Pomsky now validates properties and tells you when a property isn't supported by the target regex flavor - Shorthands (`[h]` and `[v]`) are substituted with character classes when required to support Unicode everywhere @@ -161,7 +161,7 @@ The repository was moved to its own organization! ๐ŸŽ‰ It also has a new website ### Changed -- Improved the Rust macro; rulex expressions are written directly in the Rust source code, not in a +- Improved the Rust macro; pomsky expressions are written directly in the Rust source code, not in a string literal: ```rs let regex: &str = rulex!("hello" | "world" '!'+); @@ -170,17 +170,17 @@ The repository was moved to its own organization! ๐ŸŽ‰ It also has a new website - Strings with more than 1 code point must be enclosed in double quotes, single quotes don't work - Strings can't contain backslashes; this will be fixed in a future release - Code points must be written without the `+`, e.g. `U10FFFF` instead of `U+10FFFF` - - Rulexes can contain Rust comments; they can't contain comments starting with `#` + - Pomsky expressions can contain Rust comments; they can't contain comments starting with `#` ## [0.1.0] - 2022-03-11 Initial release -[unreleased]: https://github.com/rulex-rs/rulex/compare/v0.4.3...HEAD -[0.4.3]: https://github.com/rulex-rs/rulex/compare/v0.4.2...v0.4.3 -[0.4.2]: https://github.com/rulex-rs/rulex/compare/v0.4.1...v0.4.2 -[0.4.1]: https://github.com/rulex-rs/rulex/compare/v0.4...v0.4.1 -[0.4.0]: https://github.com/rulex-rs/rulex/compare/v0.3...v0.4 -[0.3.0]: https://github.com/rulex-rs/rulex/compare/v0.2...v0.3 -[0.2.0]: https://github.com/rulex-rs/rulex/compare/v0.1...v0.2 -[0.1.0]: https://github.com/rulex-rs/rulex/releases/tag/v0.1 +[unreleased]: https://github.com/rulex-rs/pomsky/compare/v0.4.3...HEAD +[0.4.3]: https://github.com/rulex-rs/pomsky/compare/v0.4.2...v0.4.3 +[0.4.2]: https://github.com/rulex-rs/pomsky/compare/v0.4.1...v0.4.2 +[0.4.1]: https://github.com/rulex-rs/pomsky/compare/v0.4...v0.4.1 +[0.4.0]: https://github.com/rulex-rs/pomsky/compare/v0.3...v0.4 +[0.3.0]: https://github.com/rulex-rs/pomsky/compare/v0.2...v0.3 +[0.2.0]: https://github.com/rulex-rs/pomsky/compare/v0.1...v0.2 +[0.1.0]: https://github.com/rulex-rs/pomsky/releases/tag/v0.1 diff --git a/Cargo.lock b/Cargo.lock index 7b98a0f..2644fa4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -48,7 +48,7 @@ name = "benchmark" version = "0.1.2" dependencies = [ "criterion", - "rulex", + "pomsky", ] [[package]] @@ -445,6 +445,37 @@ dependencies = [ "plotters-backend", ] +[[package]] +name = "pomsky" +version = "0.5.0" +dependencies = [ + "arbitrary", + "atty", + "miette", + "nom", + "once_cell", + "regex", + "thiserror", +] + +[[package]] +name = "pomsky-bin" +version = "0.5.0" +dependencies = [ + "atty", + "clap 3.1.18", + "miette", + "pomsky", + "thiserror", +] + +[[package]] +name = "pomsky-macro" +version = "0.5.0" +dependencies = [ + "pomsky", +] + [[package]] name = "proc-macro-error" version = "1.0.4" @@ -528,37 +559,6 @@ version = "0.6.26" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49b3de9ec5dc0a3417da371aab17d729997c15010e7fd24ff707773a33bddb64" -[[package]] -name = "rulex" -version = "0.4.3" -dependencies = [ - "arbitrary", - "atty", - "miette", - "nom", - "once_cell", - "regex", - "thiserror", -] - -[[package]] -name = "rulex-bin" -version = "0.4.3" -dependencies = [ - "atty", - "clap 3.1.18", - "miette", - "rulex", - "thiserror", -] - -[[package]] -name = "rulex-macro" -version = "0.4.3" -dependencies = [ - "rulex", -] - [[package]] name = "rustc_version" version = "0.4.0" diff --git a/Cargo.toml b/Cargo.toml index e542ada..4ffe761 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [workspace] -members = ["./rulex-lib", "./rulex-bin", "./rulex-macro", "./benchmark"] -default-members = ["./rulex-bin", "./rulex-lib"] +members = ["./pomsky-lib", "./pomsky-bin", "./pomsky-macro", "./benchmark"] +default-members = ["./pomsky-bin", "./pomsky-lib"] [profile.release] lto = "thin" diff --git a/README.md b/README.md index 485684b..b41e240 100644 --- a/README.md +++ b/README.md @@ -2,19 +2,19 @@ ![Crown in double quotes logo](./assets/logo.svg) -# rulex +# Pomsky -โš ๏ธ Rulex will be renamed to pomsky. [Read the announcement](https://rulex-rs.github.io/blog/renaming-rulex/) โš ๏ธ +โš ๏ธ Rulex is being be renamed to Pomsky. [Read the announcement](https://pomsky-lang.org/blog/renaming-rulex/) โš ๏ธ A new, portable, regular expression language -Read **[the book](https://rulex-rs.github.io/docs/)** to get started! +Read **[the book](https://pomsky-lang.org/docs/)** to get started! ## Examples -On the left are rulex expressions (_rulexes_ for short), on the right is the compiled regex: +On the left are pomsky expressions, on the right is the compiled regex: ```py # String @@ -86,9 +86,9 @@ number (operator number)* ## Usage -Read **[the book](https://rulex-rs.github.io/docs)** to get started, or check out the -[CLI program](./rulex-bin/), the [Rust library](./rulex-lib/) and the -[procedural macro](./rulex-macro/). +Read **[the book](https://pomsky-lang.org/docs)** to get started, or check out the +[CLI program](./pomsky-bin/), the [Rust library](./pomsky-lib/) and the +[procedural macro](./pomsky-macro/). ## Why use this instead of normal regexes? @@ -98,7 +98,7 @@ plethora of sigils and backslash escapes that follow no discernible system: `(?<=) (?P<>) .?? \N \p{} \k<> \g''` and so on. And with various inconsistencies between regex implementations, it's the perfect recipe for confusion. -Rulex solves these problems with a new, simpler but also more powerful syntax: +Pomsky solves these problems with a new, simpler but also more powerful syntax: - It's not whitespace sensitive and allows comments - Text must appear in quotes. This makes expressions longer, but also much easier to read @@ -108,28 +108,29 @@ Rulex solves these problems with a new, simpler but also more powerful syntax: ## Compatibility -Rulex is currently compatible with PCRE, JavaScript, Java, .NET, Python, Ruby and Rust. The regex -flavor must be specified during compilation, so rulex can ensure that the produced regex works as +Pomsky is currently compatible with PCRE, JavaScript, Java, .NET, Python, Ruby and Rust. The regex +flavor must be specified during compilation, so pomsky can ensure that the produced regex works as desired on the targeted regex engine. **Note**: You should enable Unicode support in your regex engine, if it isn't enabled by default. -This is [explained here](https://rulex-rs.github.io/docs/get-started/enable-unicode/). +This is [explained here](https://pomsky-lang.org/docs/get-started/enable-unicode/). ## Security -**Never compile or execute an untrusted rulex expression on your critical infrastructure**. +**Never compile or execute an untrusted Pomsky expression on your critical infrastructure**. This may make you vulnerable for denial of service attacks, like the [Billion Laughs attack](https://en.wikipedia.org/wiki/Billion_laughs_attack). -[Read more](https://rulex-rs.github.io/docs/reference/security/) +[Read more](https://pomsky-lang.org/docs/reference/security/) ## Diagnostics -Rulex looks for mistakes and displays helpful diagnostics: +Pomsky looks for mistakes and displays helpful diagnostics: - It shows an error if you use a feature not supported by the targeted regex flavor - It detects syntax errors and shows suggestions how to resolve them -- It parses backslash escapes (which are not allowed in a rulex) and explains what to write instead +- It parses backslash escapes (which are not allowed in a pomsky expression) and explains what to + write instead - It looks for likely mistakes and displays warnings - It looks for patterns that can be very slow for certain inputs and are susceptible to Denial-of-Service attacks _(coming soon)_ @@ -140,7 +141,7 @@ Rulex looks for mistakes and displays helpful diagnostics: ## Contributing -You can contribute by using rulex and providing feedback. If you find a bug or have a question, +You can contribute by using Pomsky and providing feedback. If you find a bug or have a question, please create an issue. I also gladly accept code contributions. To make sure that CI succeeds, please run `cargo fmt`, diff --git a/benchmark/Cargo.toml b/benchmark/Cargo.toml index 3f09e18..43afc10 100644 --- a/benchmark/Cargo.toml +++ b/benchmark/Cargo.toml @@ -6,10 +6,10 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -rulex = { version = "0.4.3", path = "../rulex-lib" } +pomsky = { version = "0.5.0", path = "../pomsky-lib" } criterion = { git = "https://github.com/bheisler/criterion.rs", branch = "version-0.4" } [[bench]] -# run benchmarks with `cargo criterion -p rulex` +# run benchmarks with `cargo criterion -p pomsky` name = "main" harness = false diff --git a/benchmark/benches/main.rs b/benchmark/benches/main.rs index e6f085d..77b676e 100644 --- a/benchmark/benches/main.rs +++ b/benchmark/benches/main.rs @@ -1,10 +1,10 @@ use std::time::Duration; use criterion::{black_box, AxisScale, BenchmarkId, Criterion, PlotConfiguration, Throughput}; -use rulex::{ - features::RulexFeatures, +use pomsky::{ + features::PomskyFeatures, options::{CompileOptions, ParseOptions, RegexFlavor}, - Rulex, + Expr, }; const STRINGS: &str = r#"'hello' "world" 'this is great!' "I absolutely love it!" '"'"#; @@ -56,7 +56,7 @@ pub fn parse(c: &mut Criterion) { for &(sample_name, sample) in SAMPLES { group.throughput(Throughput::Bytes(sample.len() as u64)); group.bench_function(sample_name, |b| { - b.iter(|| Rulex::parse(black_box(sample), Default::default()).unwrap()) + b.iter(|| Expr::parse(black_box(sample), Default::default()).unwrap()) }); } } @@ -67,8 +67,8 @@ pub fn compile(c: &mut Criterion) { for &(sample_name, sample) in SAMPLES { group.throughput(Throughput::Bytes(sample.len() as u64)); group.bench_function(sample_name, |b| { - let (rulex, _warnings) = Rulex::parse(black_box(sample), Default::default()).unwrap(); - b.iter(|| black_box(&rulex).compile(ruby()).unwrap()) + let (expr, _warnings) = Expr::parse(black_box(sample), Default::default()).unwrap(); + b.iter(|| black_box(&expr).compile(ruby()).unwrap()) }); } } @@ -83,13 +83,13 @@ pub fn range(c: &mut Criterion) { let max = "3458709621".repeat(((size + 9) / 10) as usize); let max = &max[..size as usize]; let input = format!("range '0'-'{max}'"); - let (rulex, _warnings) = Rulex::parse( + let (expr, _warnings) = Expr::parse( black_box(&input), - ParseOptions { max_range_size: 100, allowed_features: RulexFeatures::default() }, + ParseOptions { max_range_size: 100, allowed_features: PomskyFeatures::default() }, ) .unwrap(); - b.iter(|| black_box(&rulex).compile(Default::default()).unwrap()) + b.iter(|| black_box(&expr).compile(Default::default()).unwrap()) }); } } diff --git a/justfile b/justfile index 46785fd..7bc2a60 100644 --- a/justfile +++ b/justfile @@ -1,29 +1,29 @@ set positional-arguments -# run rulex (debug mode) +# run pomsky (debug mode) run S *args: cargo run -- "$@" -# install rulex +# install pomsky install: - cargo install --path=rulex-bin + cargo install --path=pomsky-bin -# benchmark rulex +# benchmark pomsky bench *flags: cargo bench -p benchmark -- {{flags}} -# benchmark rulex with the plotters backend +# benchmark pomsky with the plotters backend bench-plotters *flags: cargo bench -p benchmark -- --plotting-backend plotters {{flags}} -# test rulex +# test pomsky test: cargo test -# test rulex, include ignored tests +# test pomsky, include ignored tests test-ignored: cargo test -- --ignored -# fuzz rulex ranges +# fuzz pomsky ranges fuzz-ranges *flags: cargo test --test it -- --fuzz-ranges {{flags}} diff --git a/rulex-bin/Cargo.toml b/pomsky-bin/Cargo.toml similarity index 64% rename from rulex-bin/Cargo.toml rename to pomsky-bin/Cargo.toml index a52d6d5..aff5c8b 100644 --- a/rulex-bin/Cargo.toml +++ b/pomsky-bin/Cargo.toml @@ -1,19 +1,19 @@ [package] -name = "rulex-bin" -description = "Compile rulex expressions, a new regular expression language" -version = "0.4.3" +name = "pomsky-bin" +description = "Compile pomsky expressions, a new regular expression language" +version = "0.5.0" edition = "2021" authors = ["Ludwig Stecher "] license = "MIT OR Apache-2.0" -homepage = "https://github.com/rulex-rs/rulex" -repository = "https://github.com/rulex-rs/rulex" +homepage = "https://pomsky-lang.org/" +repository = "https://github.com/rulex-rs/pomsky" readme = "README.md" -keywords = ["regexp", "regex", "rulex"] +keywords = ["regexp", "regex", "pomsky"] categories = ["text-processing", "command-line-utilities"] [[bin]] -name = "rulex" +name = "pomsky" path = "src/main.rs" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html @@ -26,9 +26,9 @@ thiserror = "1.0.30" version = "4.2.1" features = ["fancy-no-backtrace"] -[dependencies.rulex] -version = "0.4.3" -path = "../rulex-lib" +[dependencies.pomsky] +version = "0.5.0" +path = "../pomsky-lib" features = ["dbg", "miette"] [dependencies.clap] diff --git a/rulex-bin/README.md b/pomsky-bin/README.md similarity index 61% rename from rulex-bin/README.md rename to pomsky-bin/README.md index d6c4ab9..379c1e8 100644 --- a/rulex-bin/README.md +++ b/pomsky-bin/README.md @@ -1,20 +1,11 @@ -# rulex CLI +# Pomsky CLI -This CLI allows you to compile [rulex expressions](../README.md) to regexes in the command line. +This CLI allows you to compile [pomsky expressions](../README.md) to regexes in the command line. ## Use pre-built binaries Binaries are available for Windows, Linux and macOS. Download them from the -[releases page](https://github.com/rulex-rs/rulex/releases). - -## Use the AUR package - -On Arch Linux, the [AUR package](https://aur.archlinux.org/packages/rulex-rs-bin) can be installed -with - -```sh -yay -S rulex-rs-bin -``` +[releases page](https://github.com/rulex-rs/pomsky/releases). ## Install from source @@ -24,38 +15,38 @@ found [here](https://www.rust-lang.org/tools/install). Install the CLI with ```sh -cargo install rulex-bin +cargo install pomsky-bin ``` ## Usage -Then you can compile rulex expressions to a regex flavor of your choice; the default is PCRE. +Then you can compile pomsky expressions to a regex flavor of your choice; the default is PCRE. ```sh -$ rulex --help -rulex 0.1.0 +$ pomsky --help +pomsky 0.1.0 Ludwig Stecher -Compile rulex expressions, a new regular expression language +Compile pomsky expressions, a new regular expression language USAGE: - rulex [OPTIONS] [INPUT] + pomsky [OPTIONS] [INPUT] ARGS: - Rulex expression to compile + Pomsky expression to compile OPTIONS: -d, --debug Show debug information -f, --flavor Regex flavor [possible values: pcre, python, java, javascript, dotnet, ruby, rust] -h, --help Print help information - -p, --path File containing the rulex expression to compile + -p, --path File containing the pomsky expression to compile -V, --version Print version information ``` It provides nice error messages: ```sh -$ rulex "'Hello world'* \X+" +$ pomsky "'Hello world'* \X+" Error: ร— Backslash escapes are not supported โ•ญโ”€โ”€โ”€โ”€ diff --git a/rulex-bin/src/main.rs b/pomsky-bin/src/main.rs similarity index 93% rename from rulex-bin/src/main.rs rename to pomsky-bin/src/main.rs index fa1ef6d..e3103de 100644 --- a/rulex-bin/src/main.rs +++ b/pomsky-bin/src/main.rs @@ -7,21 +7,21 @@ use std::{ use atty::Stream; use clap::{ArgEnum, Parser}; use miette::ReportHandler; -use rulex::{ +use pomsky::{ error::Diagnostic, options::{CompileOptions, ParseOptions, RegexFlavor}, warning::Warning, - Rulex, + Expr, }; -/// Compile a rulex expression to a regex +/// Compile a Pomsky expression to a regex #[derive(Parser, Debug)] -#[clap(name = "rulex")] +#[clap(name = "pomsky")] #[clap(author, version, about, long_about = None)] struct Args { - /// Rulex expression to compile + /// Pomsky expression to compile input: Option, - /// File containing the rulex expression to compile + /// File containing the pomsky expression to compile #[clap(short, long, parse(from_os_str), value_name = "FILE")] path: Option, @@ -38,7 +38,7 @@ struct Args { no_new_line: bool, } -/// Regex flavor +/// Pomsky flavor #[derive(Clone, Debug, ArgEnum)] #[clap(rename_all = "lower")] enum Flavor { @@ -111,7 +111,7 @@ fn compile( no_new_line: bool, ) -> miette::Result<()> { let parse_options = ParseOptions { max_range_size: 12, ..ParseOptions::default() }; - let (parsed, warnings) = Rulex::parse(input, parse_options) + let (parsed, warnings) = Expr::parse(input, parse_options) .map_err(|err| Diagnostic::from_parse_error(err, input))?; if debug { diff --git a/rulex-lib/Cargo.toml b/pomsky-lib/Cargo.toml similarity index 77% rename from rulex-lib/Cargo.toml rename to pomsky-lib/Cargo.toml index 1e8ab4a..136973e 100644 --- a/rulex-lib/Cargo.toml +++ b/pomsky-lib/Cargo.toml @@ -1,15 +1,15 @@ [package] -name = "rulex" +name = "pomsky" description = "A new regular expression language" -version = "0.4.3" +version = "0.5.0" edition = "2021" authors = ["Ludwig Stecher "] license = "MIT OR Apache-2.0" -homepage = "https://rulex-rs.github.io" -repository = "https://github.com/rulex-rs/rulex" -documentation = "https://docs.rs/rulex" +homepage = "https://pomsky-lang.org" +repository = "https://github.com/rulex-rs/pomsky" +documentation = "https://docs.rs/pomsky" readme = "../README.md" -keywords = ["regexp", "regex", "syntax", "parser", "rulex"] +keywords = ["regexp", "regex", "syntax", "parser", "pomsky"] categories = ["text-processing", "parser-implementations"] exclude = ["tests/**", "fuzz/**", "afl-fuzz/**"] diff --git a/rulex-lib/afl-fuzz/.gitignore b/pomsky-lib/afl-fuzz/.gitignore similarity index 100% rename from rulex-lib/afl-fuzz/.gitignore rename to pomsky-lib/afl-fuzz/.gitignore diff --git a/rulex-lib/afl-fuzz/Cargo.lock b/pomsky-lib/afl-fuzz/Cargo.lock similarity index 99% rename from rulex-lib/afl-fuzz/Cargo.lock rename to pomsky-lib/afl-fuzz/Cargo.lock index daa13cb..1b3ba9f 100644 --- a/rulex-lib/afl-fuzz/Cargo.lock +++ b/pomsky-lib/afl-fuzz/Cargo.lock @@ -20,7 +20,7 @@ version = "0.0.0" dependencies = [ "afl", "arbitrary", - "rulex", + "pomsky", ] [[package]] @@ -193,6 +193,15 @@ version = "6.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21326818e99cfe6ce1e524c2a805c189a99b5ae555a35d19f9a284b427d86afa" +[[package]] +name = "pomsky" +version = "0.5.0" +dependencies = [ + "arbitrary", + "nom", + "thiserror", +] + [[package]] name = "proc-macro2" version = "1.0.39" @@ -231,15 +240,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "rulex" -version = "0.4.3" -dependencies = [ - "arbitrary", - "nom", - "thiserror", -] - [[package]] name = "rustc_version" version = "0.4.0" diff --git a/rulex-lib/afl-fuzz/Cargo.toml b/pomsky-lib/afl-fuzz/Cargo.toml similarity index 94% rename from rulex-lib/afl-fuzz/Cargo.toml rename to pomsky-lib/afl-fuzz/Cargo.toml index bf8c3f4..14bd843 100644 --- a/rulex-lib/afl-fuzz/Cargo.toml +++ b/pomsky-lib/afl-fuzz/Cargo.toml @@ -11,7 +11,7 @@ edition = "2021" afl = "0.12.4" arbitrary = "1.1.2" -[dependencies.rulex] +[dependencies.pomsky] path = ".." features = ["arbitrary"] diff --git a/rulex-lib/afl-fuzz/in/1.txt b/pomsky-lib/afl-fuzz/in/1.txt similarity index 100% rename from rulex-lib/afl-fuzz/in/1.txt rename to pomsky-lib/afl-fuzz/in/1.txt diff --git a/rulex-lib/afl-fuzz/src/main.rs b/pomsky-lib/afl-fuzz/src/main.rs similarity index 70% rename from rulex-lib/afl-fuzz/src/main.rs rename to pomsky-lib/afl-fuzz/src/main.rs index 72a394a..9328ad7 100644 --- a/rulex-lib/afl-fuzz/src/main.rs +++ b/pomsky-lib/afl-fuzz/src/main.rs @@ -1,11 +1,11 @@ use arbitrary::{Arbitrary, Unstructured}; -use rulex::Rulex; +use pomsky::Expr; fn main() { afl::fuzz!(|data: &[u8]| { let mut u = Unstructured::new(data); if let Ok((input, parse_options, compile_options)) = Arbitrary::arbitrary(&mut u) { - let _ = Rulex::parse_and_compile(input, parse_options, compile_options); + let _ = Expr::parse_and_compile(input, parse_options, compile_options); } }); } diff --git a/rulex-lib/fuzz/.gitignore b/pomsky-lib/fuzz/.gitignore similarity index 100% rename from rulex-lib/fuzz/.gitignore rename to pomsky-lib/fuzz/.gitignore diff --git a/rulex-lib/fuzz/Cargo.lock b/pomsky-lib/fuzz/Cargo.lock similarity index 98% rename from rulex-lib/fuzz/Cargo.lock rename to pomsky-lib/fuzz/Cargo.lock index 2e0a18e..8e63266 100644 --- a/rulex-lib/fuzz/Cargo.lock +++ b/pomsky-lib/fuzz/Cargo.lock @@ -67,6 +67,23 @@ version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7709cef83f0c1f58f666e746a08b21e0085f7440fa6a29cc194d68aac97a4225" +[[package]] +name = "pomsky" +version = "0.5.0" +dependencies = [ + "arbitrary", + "nom", + "thiserror", +] + +[[package]] +name = "pomsky-fuzz" +version = "0.0.0" +dependencies = [ + "libfuzzer-sys", + "pomsky", +] + [[package]] name = "proc-macro2" version = "1.0.39" @@ -85,23 +102,6 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "rulex" -version = "0.4.3" -dependencies = [ - "arbitrary", - "nom", - "thiserror", -] - -[[package]] -name = "rulex-fuzz" -version = "0.0.0" -dependencies = [ - "libfuzzer-sys", - "rulex", -] - [[package]] name = "syn" version = "1.0.97" diff --git a/rulex-lib/fuzz/Cargo.toml b/pomsky-lib/fuzz/Cargo.toml similarity index 90% rename from rulex-lib/fuzz/Cargo.toml rename to pomsky-lib/fuzz/Cargo.toml index d7e90be..3d3e632 100644 --- a/rulex-lib/fuzz/Cargo.toml +++ b/pomsky-lib/fuzz/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "rulex-fuzz" +name = "pomsky-fuzz" version = "0.0.0" authors = ["Automatically generated"] publish = false @@ -11,7 +11,7 @@ cargo-fuzz = true [dependencies] libfuzzer-sys = "0.4" -[dependencies.rulex] +[dependencies.pomsky] path = ".." features = ["arbitrary"] diff --git a/rulex-lib/fuzz/fuzz_targets/parse_and_compile.rs b/pomsky-lib/fuzz/fuzz_targets/parse_and_compile.rs similarity index 67% rename from rulex-lib/fuzz/fuzz_targets/parse_and_compile.rs rename to pomsky-lib/fuzz/fuzz_targets/parse_and_compile.rs index 265975b..8c6cc2b 100644 --- a/rulex-lib/fuzz/fuzz_targets/parse_and_compile.rs +++ b/pomsky-lib/fuzz/fuzz_targets/parse_and_compile.rs @@ -1,12 +1,12 @@ #![no_main] use libfuzzer_sys::fuzz_target; -use rulex::{ +use pomsky::{ options::{CompileOptions, ParseOptions}, - Rulex, + Expr, }; fuzz_target!(|data: (&str, ParseOptions, CompileOptions)| { let (input, parse_options, compile_options) = data; - let _ = Rulex::parse_and_compile(input, parse_options, compile_options); + let _ = Expr::parse_and_compile(input, parse_options, compile_options); }); diff --git a/rulex-lib/src/alternation.rs b/pomsky-lib/src/alternation.rs similarity index 93% rename from rulex-lib/src/alternation.rs rename to pomsky-lib/src/alternation.rs index e5a91ca..ed85800 100644 --- a/rulex-lib/src/alternation.rs +++ b/pomsky-lib/src/alternation.rs @@ -14,10 +14,10 @@ use crate::{ }; /// An [alternation](https://www.regular-expressions.info/alternation.html). -/// This is a list of alternatives. Each alternative is a [`Rulex`]. +/// This is a list of alternatives. Each alternative is a [`Expr`]. /// /// If an alternative consists of multiple expressions (e.g. `'a' | 'b' 'c'`), -/// that alternative is a [`Rulex::Group`]. Note that a group's parentheses are +/// that alternative is a [`Expr::Group`]. Note that a group's parentheses are /// removed when compiling to a regex if they aren't required. In other words, /// `'a' | ('b' 'c')` compiles to `a|bc`. #[derive(Clone)] @@ -27,7 +27,7 @@ pub(crate) struct Alternation<'i> { } impl<'i> Alternation<'i> { - pub(crate) fn new_rulex(rules: Vec>) -> Rule<'i> { + pub(crate) fn new_expr(rules: Vec>) -> Rule<'i> { rules .into_iter() .reduce(|a, b| match (a, b) { diff --git a/rulex-lib/src/boundary.rs b/pomsky-lib/src/boundary.rs similarity index 96% rename from rulex-lib/src/boundary.rs rename to pomsky-lib/src/boundary.rs index ed05434..73fd215 100644 --- a/rulex-lib/src/boundary.rs +++ b/pomsky-lib/src/boundary.rs @@ -5,7 +5,7 @@ use crate::{ compile::CompileResult, error::{ParseError, ParseErrorKind}, - features::RulexFeatures, + features::PomskyFeatures, options::ParseOptions, regex::Regex, span::Span, @@ -50,7 +50,7 @@ impl Boundary { } pub(crate) fn validate(&self, options: &ParseOptions) -> Result<(), ParseError> { - options.allowed_features.require(RulexFeatures::BOUNDARIES, self.span) + options.allowed_features.require(PomskyFeatures::BOUNDARIES, self.span) } } diff --git a/rulex-lib/src/char_class/ascii.rs b/pomsky-lib/src/char_class/ascii.rs similarity index 100% rename from rulex-lib/src/char_class/ascii.rs rename to pomsky-lib/src/char_class/ascii.rs diff --git a/rulex-lib/src/char_class/char_group.rs b/pomsky-lib/src/char_class/char_group.rs similarity index 100% rename from rulex-lib/src/char_class/char_group.rs rename to pomsky-lib/src/char_class/char_group.rs diff --git a/rulex-lib/src/char_class/mod.rs b/pomsky-lib/src/char_class/mod.rs similarity index 99% rename from rulex-lib/src/char_class/mod.rs rename to pomsky-lib/src/char_class/mod.rs index b3e5b79..981b083 100644 --- a/rulex-lib/src/char_class/mod.rs +++ b/pomsky-lib/src/char_class/mod.rs @@ -7,7 +7,7 @@ //! [dot](https://www.regular-expressions.info/dot.html). //! //! All kinds of character classes mentioned above require `[` square brackets -//! `]` in rulex. A character class can be negated by putting the keyword `not` +//! `]` in Pomsky. A character class can be negated by putting the keyword `not` //! after the opening bracket. For example, `![.]` compiles to `\n`. //! //! ## Items @@ -36,7 +36,7 @@ //! e.g. `[ascii_alpha]` = `[a-zA-Z]`. //! //! - a [Unicode category, script or block](https://www.regular-expressions.info/unicode.html#category).\ -//! For example: `[Letter]` compiles to `\p{Letter}`. Rulex currently treats +//! For example: `[Letter]` compiles to `\p{Letter}`. Pomsky currently treats //! any uppercase identifier except `R` as Unicode class. //! //! ### "Special" items diff --git a/rulex-lib/src/char_class/unicode.rs b/pomsky-lib/src/char_class/unicode.rs similarity index 100% rename from rulex-lib/src/char_class/unicode.rs rename to pomsky-lib/src/char_class/unicode.rs diff --git a/rulex-lib/src/compile.rs b/pomsky-lib/src/compile.rs similarity index 100% rename from rulex-lib/src/compile.rs rename to pomsky-lib/src/compile.rs diff --git a/rulex-lib/src/error/compile_error.rs b/pomsky-lib/src/error/compile_error.rs similarity index 97% rename from rulex-lib/src/error/compile_error.rs rename to pomsky-lib/src/error/compile_error.rs index 5125803..4b034f8 100644 --- a/rulex-lib/src/error/compile_error.rs +++ b/pomsky-lib/src/error/compile_error.rs @@ -110,7 +110,7 @@ pub enum Feature { /// A numeric reference relative to the current position, e.g. `\k<-2>`. /// /// Note that this enum variant is currently unused, because relative - /// references are converted to absolute references by rulex. + /// references are converted to absolute references by Pomsky. // TODO: maybe remove in next major version RelativeReference, /// A relative reference with a relative index of 0 or higher, e.g. `\k<-0>` @@ -118,7 +118,7 @@ pub enum Feature { /// of. /// /// Note that this enum variant is currently unused, because relative - /// references are converted to absolute references by rulex. + /// references are converted to absolute references by Pomsky. // TODO: maybe remove in next major version NonNegativeRelativeReference, /// Negative `\w` shorthand, i.e. `[\W]`. This is not supported in diff --git a/rulex-lib/src/error/diagnostics.rs b/pomsky-lib/src/error/diagnostics.rs similarity index 98% rename from rulex-lib/src/error/diagnostics.rs rename to pomsky-lib/src/error/diagnostics.rs index b3a6f6c..88d85b8 100644 --- a/rulex-lib/src/error/diagnostics.rs +++ b/pomsky-lib/src/error/diagnostics.rs @@ -122,7 +122,7 @@ impl Diagnostic { { Some( "Try a `range` expression instead:\n\ - https://rulex-rs.github.io/docs/language-tour/ranges/" + https://pomsky-lang.org/docs/language-tour/ranges/" .into(), ) } @@ -141,7 +141,7 @@ impl Diagnostic { } ParseErrorKind::RecursionLimit => Some( "Try a less nested expression. It helps to refactor it using variables:\n\ - https://rulex-rs.github.io/docs/language-tour/variables/" + https://pomsky-lang.org/docs/language-tour/variables/" .into(), ), _ => None, diff --git a/rulex-lib/src/error/mod.rs b/pomsky-lib/src/error/mod.rs similarity index 85% rename from rulex-lib/src/error/mod.rs rename to pomsky-lib/src/error/mod.rs index aa8b8ca..4e7a511 100644 --- a/rulex-lib/src/error/mod.rs +++ b/pomsky-lib/src/error/mod.rs @@ -1,4 +1,4 @@ -//! Contains different kinds of errors emitted by rulex. +//! Contains different kinds of errors emitted by Pomsky. pub(crate) use compile_error::CompileErrorKind; pub(crate) use parse_error::ParseErrorKind; diff --git a/rulex-lib/src/error/parse_error.rs b/pomsky-lib/src/error/parse_error.rs similarity index 99% rename from rulex-lib/src/error/parse_error.rs rename to pomsky-lib/src/error/parse_error.rs index 86e765b..5c1730d 100644 --- a/rulex-lib/src/error/parse_error.rs +++ b/pomsky-lib/src/error/parse_error.rs @@ -236,7 +236,7 @@ impl From for NumberError { /// An error that indicates that an unsupported feature was used. /// -/// See [`crate::features::RulexFeatures`] for details. +/// See [`crate::features::PomskyFeatures`] for details. #[derive(Debug, Copy, Clone, PartialEq, Eq, thiserror::Error)] #[non_exhaustive] #[allow(missing_docs)] diff --git a/rulex-lib/src/features.rs b/pomsky-lib/src/features.rs similarity index 91% rename from rulex-lib/src/features.rs rename to pomsky-lib/src/features.rs index 1608239..957d482 100644 --- a/rulex-lib/src/features.rs +++ b/pomsky-lib/src/features.rs @@ -1,4 +1,4 @@ -//! Contains rulex features that can be individually enabled and disabled. +//! Contains pomsky features that can be individually enabled and disabled. use std::fmt; @@ -7,25 +7,25 @@ use crate::{ span::Span, }; -/// A set of enabled rulex features. By default, all features are enabled. +/// A set of enabled pomsky features. By default, all features are enabled. /// You can disabled specific features with /// /// ``` -/// use rulex::features::RulexFeatures; +/// use pomsky::features::PomskyFeatures; /// -/// let allowed_features = RulexFeatures::default() +/// let allowed_features = PomskyFeatures::default() /// .grapheme(false) /// .variables(false); /// ``` #[derive(Copy, Clone)] -pub struct RulexFeatures { +pub struct PomskyFeatures { bits: u16, } #[cfg(feature = "arbitrary")] -impl<'a> arbitrary::Arbitrary<'a> for RulexFeatures { +impl<'a> arbitrary::Arbitrary<'a> for PomskyFeatures { fn arbitrary(u: &mut arbitrary::Unstructured<'a>) -> arbitrary::Result { - let mut feat = RulexFeatures::default(); + let mut feat = PomskyFeatures::default(); feat.grapheme(bool::arbitrary(u)?); feat.numbered_groups(bool::arbitrary(u)?); feat.named_groups(bool::arbitrary(u)?); @@ -40,9 +40,9 @@ impl<'a> arbitrary::Arbitrary<'a> for RulexFeatures { } } -impl fmt::Debug for RulexFeatures { +impl fmt::Debug for PomskyFeatures { fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { - f.debug_struct("RulexFeatures") + f.debug_struct("PomskyFeatures") .field("grapheme", &self.supports(Self::GRAPHEME)) .field("numbered_groups", &self.supports(Self::NUMBERED_GROUPS)) .field("named_groups", &self.supports(Self::NAMED_GROUPS)) @@ -57,7 +57,7 @@ impl fmt::Debug for RulexFeatures { } } -impl Default for RulexFeatures { +impl Default for PomskyFeatures { fn default() -> Self { Self { bits: Self::GRAPHEME @@ -74,7 +74,7 @@ impl Default for RulexFeatures { } } -impl RulexFeatures { +impl PomskyFeatures { pub(crate) const GRAPHEME: u16 = 1 << 0; pub(crate) const NUMBERED_GROUPS: u16 = 1 << 1; pub(crate) const NAMED_GROUPS: u16 = 1 << 2; diff --git a/rulex-lib/src/grapheme.rs b/pomsky-lib/src/grapheme.rs similarity index 90% rename from rulex-lib/src/grapheme.rs rename to pomsky-lib/src/grapheme.rs index c7b0f77..3435e09 100644 --- a/rulex-lib/src/grapheme.rs +++ b/pomsky-lib/src/grapheme.rs @@ -4,7 +4,7 @@ use crate::{ compile::CompileResult, error::{CompileErrorKind, Feature, ParseError}, - features::RulexFeatures, + features::PomskyFeatures, options::{CompileOptions, ParseOptions, RegexFlavor}, regex::Regex, span::Span, @@ -26,7 +26,7 @@ impl Grapheme { } pub(crate) fn validate(&self, options: &ParseOptions) -> Result<(), ParseError> { - options.allowed_features.require(RulexFeatures::GRAPHEME, Span::empty())?; + options.allowed_features.require(PomskyFeatures::GRAPHEME, Span::empty())?; Ok(()) } } diff --git a/rulex-lib/src/group.rs b/pomsky-lib/src/group.rs similarity index 98% rename from rulex-lib/src/group.rs rename to pomsky-lib/src/group.rs index 6b47b91..f7fae73 100644 --- a/rulex-lib/src/group.rs +++ b/pomsky-lib/src/group.rs @@ -63,8 +63,8 @@ impl<'i> Group<'i> { } None => {} }; - for rulex in &self.parts { - rulex.get_capturing_groups(count, map, within_variable)?; + for rule in &self.parts { + rule.get_capturing_groups(count, map, within_variable)?; } Ok(()) } diff --git a/rulex-lib/src/lib.rs b/pomsky-lib/src/lib.rs similarity index 73% rename from rulex-lib/src/lib.rs rename to pomsky-lib/src/lib.rs index 5be7910..e9bb2dd 100644 --- a/rulex-lib/src/lib.rs +++ b/pomsky-lib/src/lib.rs @@ -1,22 +1,22 @@ -//! # rulex +//! # Pomsky //! -//! To learn about the _rulex language_, please read [the book](https://rulex-rs.github.io/rulex). +//! To learn about the _pomsky language_, please read [the book](https://pomsky-lang.org/docs/). //! -//! The _rulex macro_ can be [found here](https://docs.rs/rulex-macro/latest/rulex_macro/). +//! The _pomsky macro_ can be [found here](https://docs.rs/pomsky-macro/latest/pomsky_macro/). //! //! ## Usage //! -//! This library can parse a rulex expression and generate a regex string: +//! This library can parse a pomsky expression and generate a regex string: //! //! ``` -//! use rulex::Rulex; -//! use rulex::options::{CompileOptions, RegexFlavor}; +//! use pomsky::Expr; +//! use pomsky::options::{CompileOptions, RegexFlavor}; //! //! let options = CompileOptions { flavor: RegexFlavor::Java }; -//! let (regex, _warnings) = match Rulex::parse_and_compile("'test'", Default::default(), options) { +//! let (regex, _warnings) = match Expr::parse_and_compile("'test'", Default::default(), options) { //! Ok(regex) => regex, //! Err(_) => { -//! eprintln!("The input is not a valid rulex"); +//! eprintln!("The input is not a valid pomsky expression"); //! return; //! } //! }; @@ -26,13 +26,13 @@ //! by enabling the `diagnostics` feature: //! //! ``` -//! use rulex::Rulex; -//! use rulex::options::{CompileOptions, RegexFlavor}; -//! use rulex::error::Diagnostic; +//! use pomsky::Expr; +//! use pomsky::options::{CompileOptions, RegexFlavor}; +//! use pomsky::error::Diagnostic; //! //! pub fn compile(input: &str) -> miette::Result { //! let options = CompileOptions { flavor: RegexFlavor::Java }; -//! let (compiled, _warnings) = Rulex::parse_and_compile(input, Default::default(), options) +//! let (compiled, _warnings) = Expr::parse_and_compile(input, Default::default(), options) //! .map_err(|e| e.diagnostic(input))?; //! Ok(compiled) //! } @@ -76,14 +76,14 @@ mod span; mod stmt; mod var; -/// A parsed rulex expression, which might contain more sub-expressions. +/// A parsed pomsky expression, which might contain more sub-expressions. #[derive(Clone)] -pub struct Rulex<'i>(Rule<'i>); +pub struct Expr<'i>(Rule<'i>); -impl<'i> Rulex<'i> { - /// Parse a `Rulex` without generating code. +impl<'i> Expr<'i> { + /// Parse a `Expr` without generating code. /// - /// The parsed `Rulex` can be displayed with `Debug` if the `dbg` feature is + /// The parsed `Expr` can be displayed with `Debug` if the `dbg` feature is /// enabled. pub fn parse( input: &'i str, @@ -91,10 +91,10 @@ impl<'i> Rulex<'i> { ) -> Result<(Self, Vec), ParseError> { let (rule, warning) = parse::parse(input, 256)?; rule.validate(&options)?; - Ok((Rulex(rule), warning)) + Ok((Expr(rule), warning)) } - /// Compile a `Rulex` that has been parsed, to a regex + /// Compile a `Expr` that has been parsed, to a regex pub fn compile(&self, options: CompileOptions) -> Result { let mut used_names = HashMap::new(); let mut groups_count = 0; @@ -131,7 +131,7 @@ impl<'i> Rulex<'i> { Ok(buf) } - /// Parse a string to a `Rulex` and compile it to a regex. + /// Parse a string to a `Expr` and compile it to a regex. pub fn parse_and_compile( input: &'i str, parse_options: ParseOptions, @@ -144,7 +144,7 @@ impl<'i> Rulex<'i> { } #[cfg(feature = "dbg")] -impl core::fmt::Debug for Rulex<'_> { +impl core::fmt::Debug for Expr<'_> { fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { self.0.fmt(f) } diff --git a/rulex-lib/src/literal.rs b/pomsky-lib/src/literal.rs similarity index 100% rename from rulex-lib/src/literal.rs rename to pomsky-lib/src/literal.rs diff --git a/rulex-lib/src/lookaround.rs b/pomsky-lib/src/lookaround.rs similarity index 91% rename from rulex-lib/src/lookaround.rs rename to pomsky-lib/src/lookaround.rs index 2601137..44b12f6 100644 --- a/rulex-lib/src/lookaround.rs +++ b/pomsky-lib/src/lookaround.rs @@ -3,7 +3,7 @@ use std::collections::HashMap; use crate::{ compile::{CompileResult, CompileState}, error::{CompileError, CompileErrorKind, Feature, ParseError, ParseErrorKind}, - features::RulexFeatures, + features::PomskyFeatures, options::{CompileOptions, ParseOptions, RegexFlavor}, regex::Regex, rule::Rule, @@ -89,10 +89,10 @@ impl<'i> Lookaround<'i> { pub(crate) fn validate(&self, options: &ParseOptions) -> Result<(), ParseError> { let feature = match self.kind { - LookaroundKind::Ahead => RulexFeatures::LOOKAHEAD, - LookaroundKind::Behind => RulexFeatures::LOOKBEHIND, - LookaroundKind::AheadNegative => RulexFeatures::LOOKAHEAD, - LookaroundKind::BehindNegative => RulexFeatures::LOOKBEHIND, + LookaroundKind::Ahead => PomskyFeatures::LOOKAHEAD, + LookaroundKind::Behind => PomskyFeatures::LOOKBEHIND, + LookaroundKind::AheadNegative => PomskyFeatures::LOOKAHEAD, + LookaroundKind::BehindNegative => PomskyFeatures::LOOKBEHIND, }; options.allowed_features.require(feature, self.span) } diff --git a/rulex-lib/src/options.rs b/pomsky-lib/src/options.rs similarity index 74% rename from rulex-lib/src/options.rs rename to pomsky-lib/src/options.rs index a6795f7..c6a9012 100644 --- a/rulex-lib/src/options.rs +++ b/pomsky-lib/src/options.rs @@ -1,20 +1,20 @@ -//! Contains parser and compiler options passed to rulex. +//! Contains parser and compiler options passed to pomsky. -use crate::features::RulexFeatures; +use crate::features::PomskyFeatures; -/// Options passed to the rulex parser +/// Options passed to the pomsky parser #[derive(Debug, Clone, Copy)] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] pub struct ParseOptions { /// The maximum number of digits in a `range` expression. Defaults to 6. /// /// Note that if you increase this number, the time needed to compile a - /// rulex may increase exponentially. If you parse untrusted input, this - /// can be used for a DoS attack. + /// pomsky expression may increase exponentially. If you parse untrusted + /// input, this can be used for a DoS attack. pub max_range_size: u8, - /// Allowed rulex features. By default, all features are allowed. - pub allowed_features: RulexFeatures, + /// Allowed pomsky features. By default, all features are allowed. + pub allowed_features: PomskyFeatures, } impl Default for ParseOptions { @@ -23,11 +23,11 @@ impl Default for ParseOptions { } } -/// Options passed to the rulex compiler +/// Options passed to the pomsky compiler #[derive(Debug, Clone, Copy, Default)] #[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))] pub struct CompileOptions { - /// The targeted regex flavor. Rulex makes sure that the emitted regex is + /// The targeted regex flavor. Pomsky makes sure that the emitted regex is /// compatible with this flavor. pub flavor: RegexFlavor, } diff --git a/rulex-lib/src/parse/input.rs b/pomsky-lib/src/parse/input.rs similarity index 100% rename from rulex-lib/src/parse/input.rs rename to pomsky-lib/src/parse/input.rs diff --git a/rulex-lib/src/parse/mod.rs b/pomsky-lib/src/parse/mod.rs similarity index 100% rename from rulex-lib/src/parse/mod.rs rename to pomsky-lib/src/parse/mod.rs diff --git a/rulex-lib/src/parse/parsers.rs b/pomsky-lib/src/parse/parsers.rs similarity index 99% rename from rulex-lib/src/parse/parsers.rs rename to pomsky-lib/src/parse/parsers.rs index a4f40c5..548256b 100644 --- a/rulex-lib/src/parse/parsers.rs +++ b/pomsky-lib/src/parse/parsers.rs @@ -143,7 +143,7 @@ pub(super) fn parse_or<'i, 'b>(input: Input<'i, 'b>) -> PResult<'i, 'b, Rule<'i> if rules.len() == 1 { rules.pop().unwrap() } else { - Alternation::new_rulex(rules) + Alternation::new_expr(rules) } })(input) } diff --git a/rulex-lib/src/parse/token.rs b/pomsky-lib/src/parse/token.rs similarity index 100% rename from rulex-lib/src/parse/token.rs rename to pomsky-lib/src/parse/token.rs diff --git a/rulex-lib/src/parse/tokenize.rs b/pomsky-lib/src/parse/tokenize.rs similarity index 100% rename from rulex-lib/src/parse/tokenize.rs rename to pomsky-lib/src/parse/tokenize.rs diff --git a/rulex-lib/src/range.rs b/pomsky-lib/src/range.rs similarity index 99% rename from rulex-lib/src/range.rs rename to pomsky-lib/src/range.rs index b508a98..58659ee 100644 --- a/rulex-lib/src/range.rs +++ b/pomsky-lib/src/range.rs @@ -5,7 +5,7 @@ use crate::{ char_class::{RegexCharClass, RegexClassItem}, compile::CompileResult, error::{CompileErrorKind, ParseError, ParseErrorKind}, - features::RulexFeatures, + features::PomskyFeatures, group::{RegexCapture, RegexGroup}, options::ParseOptions, regex::Regex, @@ -40,7 +40,7 @@ impl Range { if self.end.len() > options.max_range_size as usize { return Err(ParseErrorKind::RangeIsTooBig(options.max_range_size).at(self.span)); } - options.allowed_features.require(RulexFeatures::RANGES, self.span) + options.allowed_features.require(PomskyFeatures::RANGES, self.span) } } diff --git a/rulex-lib/src/reference.rs b/pomsky-lib/src/reference.rs similarity index 97% rename from rulex-lib/src/reference.rs rename to pomsky-lib/src/reference.rs index d36e73a..5b2aca1 100644 --- a/rulex-lib/src/reference.rs +++ b/pomsky-lib/src/reference.rs @@ -1,7 +1,7 @@ use crate::{ compile::{CompileResult, CompileState}, error::{CompileErrorKind, Feature, ParseError}, - features::RulexFeatures, + features::PomskyFeatures, options::{CompileOptions, ParseOptions, RegexFlavor}, regex::Regex, span::Span, @@ -108,7 +108,7 @@ impl<'i> Reference<'i> { } pub(crate) fn validate(&self, options: &ParseOptions) -> Result<(), ParseError> { - options.allowed_features.require(RulexFeatures::REFERENCES, self.span) + options.allowed_features.require(PomskyFeatures::REFERENCES, self.span) } } diff --git a/rulex-lib/src/regex/mod.rs b/pomsky-lib/src/regex/mod.rs similarity index 100% rename from rulex-lib/src/regex/mod.rs rename to pomsky-lib/src/regex/mod.rs diff --git a/rulex-lib/src/repetition.rs b/pomsky-lib/src/repetition.rs similarity index 100% rename from rulex-lib/src/repetition.rs rename to pomsky-lib/src/repetition.rs diff --git a/rulex-lib/src/rule.rs b/pomsky-lib/src/rule.rs similarity index 98% rename from rulex-lib/src/rule.rs rename to pomsky-lib/src/rule.rs index a39ea6f..9b29f19 100644 --- a/rulex-lib/src/rule.rs +++ b/pomsky-lib/src/rule.rs @@ -19,7 +19,7 @@ use crate::{ var::Variable, }; -/// A parsed rulex expression, which might contain more sub-expressions. +/// A parsed pomsky expression, which might contain more sub-expressions. #[derive(Clone)] #[non_exhaustive] pub(crate) enum Rule<'i> { diff --git a/rulex-lib/src/span.rs b/pomsky-lib/src/span.rs similarity index 100% rename from rulex-lib/src/span.rs rename to pomsky-lib/src/span.rs diff --git a/rulex-lib/src/stmt.rs b/pomsky-lib/src/stmt.rs similarity index 94% rename from rulex-lib/src/stmt.rs rename to pomsky-lib/src/stmt.rs index d55b9d8..b0bfead 100644 --- a/rulex-lib/src/stmt.rs +++ b/pomsky-lib/src/stmt.rs @@ -3,7 +3,7 @@ use std::collections::HashMap; use crate::{ compile::{CompileResult, CompileState}, error::{CompileError, ParseError}, - features::RulexFeatures, + features::PomskyFeatures, options::{CompileOptions, ParseOptions}, repetition::RegexQuantifier, rule::Rule, @@ -95,11 +95,11 @@ impl<'i> StmtExpr<'i> { pub(crate) fn validate(&self, options: &ParseOptions) -> Result<(), ParseError> { match &self.stmt { Stmt::Enable(BooleanSetting::Lazy) => { - options.allowed_features.require(RulexFeatures::LAZY_MODE, self.span)?; + options.allowed_features.require(PomskyFeatures::LAZY_MODE, self.span)?; } Stmt::Disable(_) => {} Stmt::Let(l) => { - options.allowed_features.require(RulexFeatures::VARIABLES, l.name_span)?; + options.allowed_features.require(PomskyFeatures::VARIABLES, l.name_span)?; l.rule.validate(options)?; } } diff --git a/rulex-lib/src/var.rs b/pomsky-lib/src/var.rs similarity index 100% rename from rulex-lib/src/var.rs rename to pomsky-lib/src/var.rs diff --git a/rulex-lib/src/warning.rs b/pomsky-lib/src/warning.rs similarity index 100% rename from rulex-lib/src/warning.rs rename to pomsky-lib/src/warning.rs diff --git a/rulex-lib/tests/it/args.rs b/pomsky-lib/tests/it/args.rs similarity index 100% rename from rulex-lib/tests/it/args.rs rename to pomsky-lib/tests/it/args.rs diff --git a/rulex-lib/tests/it/color.rs b/pomsky-lib/tests/it/color.rs similarity index 100% rename from rulex-lib/tests/it/color.rs rename to pomsky-lib/tests/it/color.rs diff --git a/rulex-lib/tests/it/files.rs b/pomsky-lib/tests/it/files.rs similarity index 99% rename from rulex-lib/tests/it/files.rs rename to pomsky-lib/tests/it/files.rs index dca4343..4721cde 100644 --- a/rulex-lib/tests/it/files.rs +++ b/pomsky-lib/tests/it/files.rs @@ -4,7 +4,7 @@ use std::{ path::Path, }; -use rulex::{ +use pomsky::{ error::CompileError, options::{CompileOptions, ParseOptions, RegexFlavor}, }; @@ -112,7 +112,7 @@ pub(crate) fn test_file(content: &str, path: &Path, args: &Args, bless: bool) -> } catch_panics(|| { - let parsed = rulex::Rulex::parse_and_compile( + let parsed = pomsky::Expr::parse_and_compile( input, ParseOptions::default(), CompileOptions { flavor: options.flavor }, diff --git a/rulex-lib/tests/it/fuzzer.rs b/pomsky-lib/tests/it/fuzzer.rs similarity index 98% rename from rulex-lib/tests/it/fuzzer.rs rename to pomsky-lib/tests/it/fuzzer.rs index eada918..818a8c2 100644 --- a/rulex-lib/tests/it/fuzzer.rs +++ b/pomsky-lib/tests/it/fuzzer.rs @@ -1,8 +1,8 @@ use std::{fmt, time::Instant}; use crate::color::Color::*; +use pomsky::Expr; use regex::Regex; -use rulex::Rulex; #[derive(Debug)] pub(crate) enum FuzzError { @@ -41,7 +41,7 @@ pub(crate) fn fuzz_ranges( let mut start = Instant::now(); loop { - let (regex, _warnings) = Rulex::parse_and_compile( + let (regex, _warnings) = Expr::parse_and_compile( &format!("range '{lo}'-'{hi}'"), Default::default(), Default::default(), diff --git a/rulex-lib/tests/it/main.rs b/pomsky-lib/tests/it/main.rs similarity index 100% rename from rulex-lib/tests/it/main.rs rename to pomsky-lib/tests/it/main.rs diff --git a/rulex-lib/tests/it/timeout.rs b/pomsky-lib/tests/it/timeout.rs similarity index 100% rename from rulex-lib/tests/it/timeout.rs rename to pomsky-lib/tests/it/timeout.rs diff --git a/rulex-lib/tests/testcases/basics/0.txt b/pomsky-lib/tests/testcases/basics/0.txt similarity index 100% rename from rulex-lib/tests/testcases/basics/0.txt rename to pomsky-lib/tests/testcases/basics/0.txt diff --git a/rulex-lib/tests/testcases/basics/1.txt b/pomsky-lib/tests/testcases/basics/1.txt similarity index 100% rename from rulex-lib/tests/testcases/basics/1.txt rename to pomsky-lib/tests/testcases/basics/1.txt diff --git a/rulex-lib/tests/testcases/basics/2.txt b/pomsky-lib/tests/testcases/basics/2.txt similarity index 100% rename from rulex-lib/tests/testcases/basics/2.txt rename to pomsky-lib/tests/testcases/basics/2.txt diff --git a/rulex-lib/tests/testcases/basics/3.txt b/pomsky-lib/tests/testcases/basics/3.txt similarity index 100% rename from rulex-lib/tests/testcases/basics/3.txt rename to pomsky-lib/tests/testcases/basics/3.txt diff --git a/rulex-lib/tests/testcases/basics/4.txt b/pomsky-lib/tests/testcases/basics/4.txt similarity index 100% rename from rulex-lib/tests/testcases/basics/4.txt rename to pomsky-lib/tests/testcases/basics/4.txt diff --git a/rulex-lib/tests/testcases/basics/5.txt b/pomsky-lib/tests/testcases/basics/5.txt similarity index 100% rename from rulex-lib/tests/testcases/basics/5.txt rename to pomsky-lib/tests/testcases/basics/5.txt diff --git a/rulex-lib/tests/testcases/basics/6.txt b/pomsky-lib/tests/testcases/basics/6.txt similarity index 100% rename from rulex-lib/tests/testcases/basics/6.txt rename to pomsky-lib/tests/testcases/basics/6.txt diff --git a/rulex-lib/tests/testcases/basics/7.txt b/pomsky-lib/tests/testcases/basics/7.txt similarity index 100% rename from rulex-lib/tests/testcases/basics/7.txt rename to pomsky-lib/tests/testcases/basics/7.txt diff --git a/rulex-lib/tests/testcases/classes/0.txt b/pomsky-lib/tests/testcases/classes/0.txt similarity index 100% rename from rulex-lib/tests/testcases/classes/0.txt rename to pomsky-lib/tests/testcases/classes/0.txt diff --git a/rulex-lib/tests/testcases/classes/1.txt b/pomsky-lib/tests/testcases/classes/1.txt similarity index 100% rename from rulex-lib/tests/testcases/classes/1.txt rename to pomsky-lib/tests/testcases/classes/1.txt diff --git a/rulex-lib/tests/testcases/classes/10.txt b/pomsky-lib/tests/testcases/classes/10.txt similarity index 100% rename from rulex-lib/tests/testcases/classes/10.txt rename to pomsky-lib/tests/testcases/classes/10.txt diff --git a/rulex-lib/tests/testcases/classes/11.txt b/pomsky-lib/tests/testcases/classes/11.txt similarity index 100% rename from rulex-lib/tests/testcases/classes/11.txt rename to pomsky-lib/tests/testcases/classes/11.txt diff --git a/rulex-lib/tests/testcases/classes/12.txt b/pomsky-lib/tests/testcases/classes/12.txt similarity index 100% rename from rulex-lib/tests/testcases/classes/12.txt rename to pomsky-lib/tests/testcases/classes/12.txt diff --git a/rulex-lib/tests/testcases/classes/13.txt b/pomsky-lib/tests/testcases/classes/13.txt similarity index 100% rename from rulex-lib/tests/testcases/classes/13.txt rename to pomsky-lib/tests/testcases/classes/13.txt diff --git a/rulex-lib/tests/testcases/classes/14.txt b/pomsky-lib/tests/testcases/classes/14.txt similarity index 100% rename from rulex-lib/tests/testcases/classes/14.txt rename to pomsky-lib/tests/testcases/classes/14.txt diff --git a/rulex-lib/tests/testcases/classes/15.txt b/pomsky-lib/tests/testcases/classes/15.txt similarity index 100% rename from rulex-lib/tests/testcases/classes/15.txt rename to pomsky-lib/tests/testcases/classes/15.txt diff --git a/rulex-lib/tests/testcases/classes/16.txt b/pomsky-lib/tests/testcases/classes/16.txt similarity index 100% rename from rulex-lib/tests/testcases/classes/16.txt rename to pomsky-lib/tests/testcases/classes/16.txt diff --git a/rulex-lib/tests/testcases/classes/17.txt b/pomsky-lib/tests/testcases/classes/17.txt similarity index 100% rename from rulex-lib/tests/testcases/classes/17.txt rename to pomsky-lib/tests/testcases/classes/17.txt diff --git a/rulex-lib/tests/testcases/classes/18.txt b/pomsky-lib/tests/testcases/classes/18.txt similarity index 100% rename from rulex-lib/tests/testcases/classes/18.txt rename to pomsky-lib/tests/testcases/classes/18.txt diff --git a/rulex-lib/tests/testcases/classes/19.txt b/pomsky-lib/tests/testcases/classes/19.txt similarity index 100% rename from rulex-lib/tests/testcases/classes/19.txt rename to pomsky-lib/tests/testcases/classes/19.txt diff --git a/rulex-lib/tests/testcases/classes/2.txt b/pomsky-lib/tests/testcases/classes/2.txt similarity index 100% rename from rulex-lib/tests/testcases/classes/2.txt rename to pomsky-lib/tests/testcases/classes/2.txt diff --git a/rulex-lib/tests/testcases/classes/3.txt b/pomsky-lib/tests/testcases/classes/3.txt similarity index 100% rename from rulex-lib/tests/testcases/classes/3.txt rename to pomsky-lib/tests/testcases/classes/3.txt diff --git a/rulex-lib/tests/testcases/classes/4.txt b/pomsky-lib/tests/testcases/classes/4.txt similarity index 100% rename from rulex-lib/tests/testcases/classes/4.txt rename to pomsky-lib/tests/testcases/classes/4.txt diff --git a/rulex-lib/tests/testcases/classes/5.txt b/pomsky-lib/tests/testcases/classes/5.txt similarity index 100% rename from rulex-lib/tests/testcases/classes/5.txt rename to pomsky-lib/tests/testcases/classes/5.txt diff --git a/rulex-lib/tests/testcases/classes/6.txt b/pomsky-lib/tests/testcases/classes/6.txt similarity index 100% rename from rulex-lib/tests/testcases/classes/6.txt rename to pomsky-lib/tests/testcases/classes/6.txt diff --git a/rulex-lib/tests/testcases/classes/7.txt b/pomsky-lib/tests/testcases/classes/7.txt similarity index 100% rename from rulex-lib/tests/testcases/classes/7.txt rename to pomsky-lib/tests/testcases/classes/7.txt diff --git a/rulex-lib/tests/testcases/classes/8.txt b/pomsky-lib/tests/testcases/classes/8.txt similarity index 100% rename from rulex-lib/tests/testcases/classes/8.txt rename to pomsky-lib/tests/testcases/classes/8.txt diff --git a/rulex-lib/tests/testcases/classes/9.txt b/pomsky-lib/tests/testcases/classes/9.txt similarity index 100% rename from rulex-lib/tests/testcases/classes/9.txt rename to pomsky-lib/tests/testcases/classes/9.txt diff --git a/rulex-lib/tests/testcases/errors/0.txt b/pomsky-lib/tests/testcases/errors/0.txt similarity index 100% rename from rulex-lib/tests/testcases/errors/0.txt rename to pomsky-lib/tests/testcases/errors/0.txt diff --git a/rulex-lib/tests/testcases/errors/1.txt b/pomsky-lib/tests/testcases/errors/1.txt similarity index 100% rename from rulex-lib/tests/testcases/errors/1.txt rename to pomsky-lib/tests/testcases/errors/1.txt diff --git a/rulex-lib/tests/testcases/errors/10.txt b/pomsky-lib/tests/testcases/errors/10.txt similarity index 100% rename from rulex-lib/tests/testcases/errors/10.txt rename to pomsky-lib/tests/testcases/errors/10.txt diff --git a/rulex-lib/tests/testcases/errors/11.txt b/pomsky-lib/tests/testcases/errors/11.txt similarity index 100% rename from rulex-lib/tests/testcases/errors/11.txt rename to pomsky-lib/tests/testcases/errors/11.txt diff --git a/rulex-lib/tests/testcases/errors/12.txt b/pomsky-lib/tests/testcases/errors/12.txt similarity index 100% rename from rulex-lib/tests/testcases/errors/12.txt rename to pomsky-lib/tests/testcases/errors/12.txt diff --git a/rulex-lib/tests/testcases/errors/13.txt b/pomsky-lib/tests/testcases/errors/13.txt similarity index 100% rename from rulex-lib/tests/testcases/errors/13.txt rename to pomsky-lib/tests/testcases/errors/13.txt diff --git a/rulex-lib/tests/testcases/errors/14.txt b/pomsky-lib/tests/testcases/errors/14.txt similarity index 100% rename from rulex-lib/tests/testcases/errors/14.txt rename to pomsky-lib/tests/testcases/errors/14.txt diff --git a/rulex-lib/tests/testcases/errors/15.txt b/pomsky-lib/tests/testcases/errors/15.txt similarity index 100% rename from rulex-lib/tests/testcases/errors/15.txt rename to pomsky-lib/tests/testcases/errors/15.txt diff --git a/rulex-lib/tests/testcases/errors/16.txt b/pomsky-lib/tests/testcases/errors/16.txt similarity index 100% rename from rulex-lib/tests/testcases/errors/16.txt rename to pomsky-lib/tests/testcases/errors/16.txt diff --git a/rulex-lib/tests/testcases/errors/17.txt b/pomsky-lib/tests/testcases/errors/17.txt similarity index 100% rename from rulex-lib/tests/testcases/errors/17.txt rename to pomsky-lib/tests/testcases/errors/17.txt diff --git a/rulex-lib/tests/testcases/errors/18.txt b/pomsky-lib/tests/testcases/errors/18.txt similarity index 100% rename from rulex-lib/tests/testcases/errors/18.txt rename to pomsky-lib/tests/testcases/errors/18.txt diff --git a/rulex-lib/tests/testcases/errors/19.txt b/pomsky-lib/tests/testcases/errors/19.txt similarity index 100% rename from rulex-lib/tests/testcases/errors/19.txt rename to pomsky-lib/tests/testcases/errors/19.txt diff --git a/rulex-lib/tests/testcases/errors/2.txt b/pomsky-lib/tests/testcases/errors/2.txt similarity index 100% rename from rulex-lib/tests/testcases/errors/2.txt rename to pomsky-lib/tests/testcases/errors/2.txt diff --git a/rulex-lib/tests/testcases/errors/20.txt b/pomsky-lib/tests/testcases/errors/20.txt similarity index 100% rename from rulex-lib/tests/testcases/errors/20.txt rename to pomsky-lib/tests/testcases/errors/20.txt diff --git a/rulex-lib/tests/testcases/errors/21.txt b/pomsky-lib/tests/testcases/errors/21.txt similarity index 100% rename from rulex-lib/tests/testcases/errors/21.txt rename to pomsky-lib/tests/testcases/errors/21.txt diff --git a/rulex-lib/tests/testcases/errors/22.txt b/pomsky-lib/tests/testcases/errors/22.txt similarity index 100% rename from rulex-lib/tests/testcases/errors/22.txt rename to pomsky-lib/tests/testcases/errors/22.txt diff --git a/rulex-lib/tests/testcases/errors/23.txt b/pomsky-lib/tests/testcases/errors/23.txt similarity index 84% rename from rulex-lib/tests/testcases/errors/23.txt rename to pomsky-lib/tests/testcases/errors/23.txt index 64dc362..61fea2a 100644 --- a/rulex-lib/tests/testcases/errors/23.txt +++ b/pomsky-lib/tests/testcases/errors/23.txt @@ -5,5 +5,5 @@ ----- ERROR: Recursion limit reached HELP: Try a less nested expression. It helps to refactor it using variables: -https://rulex-rs.github.io/docs/language-tour/variables/ +https://pomsky-lang.org/docs/language-tour/variables/ SPAN: 130..131 \ No newline at end of file diff --git a/rulex-lib/tests/testcases/errors/24.txt b/pomsky-lib/tests/testcases/errors/24.txt similarity index 72% rename from rulex-lib/tests/testcases/errors/24.txt rename to pomsky-lib/tests/testcases/errors/24.txt index cfc188e..511e84b 100644 --- a/rulex-lib/tests/testcases/errors/24.txt +++ b/pomsky-lib/tests/testcases/errors/24.txt @@ -3,5 +3,5 @@ ----- ERROR: Strings used in ranges can only contain 1 code point HELP: Try a `range` expression instead: -https://rulex-rs.github.io/docs/language-tour/ranges/ +https://pomsky-lang.org/docs/language-tour/ranges/ SPAN: 1..6 \ No newline at end of file diff --git a/rulex-lib/tests/testcases/errors/25.txt b/pomsky-lib/tests/testcases/errors/25.txt similarity index 100% rename from rulex-lib/tests/testcases/errors/25.txt rename to pomsky-lib/tests/testcases/errors/25.txt diff --git a/rulex-lib/tests/testcases/errors/3.txt b/pomsky-lib/tests/testcases/errors/3.txt similarity index 100% rename from rulex-lib/tests/testcases/errors/3.txt rename to pomsky-lib/tests/testcases/errors/3.txt diff --git a/rulex-lib/tests/testcases/errors/4.txt b/pomsky-lib/tests/testcases/errors/4.txt similarity index 100% rename from rulex-lib/tests/testcases/errors/4.txt rename to pomsky-lib/tests/testcases/errors/4.txt diff --git a/rulex-lib/tests/testcases/errors/5.txt b/pomsky-lib/tests/testcases/errors/5.txt similarity index 100% rename from rulex-lib/tests/testcases/errors/5.txt rename to pomsky-lib/tests/testcases/errors/5.txt diff --git a/rulex-lib/tests/testcases/errors/6.txt b/pomsky-lib/tests/testcases/errors/6.txt similarity index 100% rename from rulex-lib/tests/testcases/errors/6.txt rename to pomsky-lib/tests/testcases/errors/6.txt diff --git a/rulex-lib/tests/testcases/errors/7.txt b/pomsky-lib/tests/testcases/errors/7.txt similarity index 100% rename from rulex-lib/tests/testcases/errors/7.txt rename to pomsky-lib/tests/testcases/errors/7.txt diff --git a/rulex-lib/tests/testcases/errors/9.txt b/pomsky-lib/tests/testcases/errors/9.txt similarity index 100% rename from rulex-lib/tests/testcases/errors/9.txt rename to pomsky-lib/tests/testcases/errors/9.txt diff --git a/rulex-lib/tests/testcases/negation/1.txt b/pomsky-lib/tests/testcases/negation/1.txt similarity index 100% rename from rulex-lib/tests/testcases/negation/1.txt rename to pomsky-lib/tests/testcases/negation/1.txt diff --git a/rulex-lib/tests/testcases/negation/10.txt b/pomsky-lib/tests/testcases/negation/10.txt similarity index 100% rename from rulex-lib/tests/testcases/negation/10.txt rename to pomsky-lib/tests/testcases/negation/10.txt diff --git a/rulex-lib/tests/testcases/negation/11.txt b/pomsky-lib/tests/testcases/negation/11.txt similarity index 100% rename from rulex-lib/tests/testcases/negation/11.txt rename to pomsky-lib/tests/testcases/negation/11.txt diff --git a/rulex-lib/tests/testcases/negation/12.txt b/pomsky-lib/tests/testcases/negation/12.txt similarity index 100% rename from rulex-lib/tests/testcases/negation/12.txt rename to pomsky-lib/tests/testcases/negation/12.txt diff --git a/rulex-lib/tests/testcases/negation/13.txt b/pomsky-lib/tests/testcases/negation/13.txt similarity index 100% rename from rulex-lib/tests/testcases/negation/13.txt rename to pomsky-lib/tests/testcases/negation/13.txt diff --git a/rulex-lib/tests/testcases/negation/14.txt b/pomsky-lib/tests/testcases/negation/14.txt similarity index 100% rename from rulex-lib/tests/testcases/negation/14.txt rename to pomsky-lib/tests/testcases/negation/14.txt diff --git a/rulex-lib/tests/testcases/negation/15.txt b/pomsky-lib/tests/testcases/negation/15.txt similarity index 100% rename from rulex-lib/tests/testcases/negation/15.txt rename to pomsky-lib/tests/testcases/negation/15.txt diff --git a/rulex-lib/tests/testcases/negation/16.txt b/pomsky-lib/tests/testcases/negation/16.txt similarity index 100% rename from rulex-lib/tests/testcases/negation/16.txt rename to pomsky-lib/tests/testcases/negation/16.txt diff --git a/rulex-lib/tests/testcases/negation/17.txt b/pomsky-lib/tests/testcases/negation/17.txt similarity index 100% rename from rulex-lib/tests/testcases/negation/17.txt rename to pomsky-lib/tests/testcases/negation/17.txt diff --git a/rulex-lib/tests/testcases/negation/18.txt b/pomsky-lib/tests/testcases/negation/18.txt similarity index 100% rename from rulex-lib/tests/testcases/negation/18.txt rename to pomsky-lib/tests/testcases/negation/18.txt diff --git a/rulex-lib/tests/testcases/negation/2.txt b/pomsky-lib/tests/testcases/negation/2.txt similarity index 100% rename from rulex-lib/tests/testcases/negation/2.txt rename to pomsky-lib/tests/testcases/negation/2.txt diff --git a/rulex-lib/tests/testcases/negation/3.txt b/pomsky-lib/tests/testcases/negation/3.txt similarity index 100% rename from rulex-lib/tests/testcases/negation/3.txt rename to pomsky-lib/tests/testcases/negation/3.txt diff --git a/rulex-lib/tests/testcases/negation/4.txt b/pomsky-lib/tests/testcases/negation/4.txt similarity index 100% rename from rulex-lib/tests/testcases/negation/4.txt rename to pomsky-lib/tests/testcases/negation/4.txt diff --git a/rulex-lib/tests/testcases/negation/5.txt b/pomsky-lib/tests/testcases/negation/5.txt similarity index 100% rename from rulex-lib/tests/testcases/negation/5.txt rename to pomsky-lib/tests/testcases/negation/5.txt diff --git a/rulex-lib/tests/testcases/negation/6.txt b/pomsky-lib/tests/testcases/negation/6.txt similarity index 100% rename from rulex-lib/tests/testcases/negation/6.txt rename to pomsky-lib/tests/testcases/negation/6.txt diff --git a/rulex-lib/tests/testcases/negation/7.txt b/pomsky-lib/tests/testcases/negation/7.txt similarity index 100% rename from rulex-lib/tests/testcases/negation/7.txt rename to pomsky-lib/tests/testcases/negation/7.txt diff --git a/rulex-lib/tests/testcases/negation/8.txt b/pomsky-lib/tests/testcases/negation/8.txt similarity index 100% rename from rulex-lib/tests/testcases/negation/8.txt rename to pomsky-lib/tests/testcases/negation/8.txt diff --git a/rulex-lib/tests/testcases/negation/9.txt b/pomsky-lib/tests/testcases/negation/9.txt similarity index 100% rename from rulex-lib/tests/testcases/negation/9.txt rename to pomsky-lib/tests/testcases/negation/9.txt diff --git a/rulex-lib/tests/testcases/ranges/1.txt b/pomsky-lib/tests/testcases/ranges/1.txt similarity index 100% rename from rulex-lib/tests/testcases/ranges/1.txt rename to pomsky-lib/tests/testcases/ranges/1.txt diff --git a/rulex-lib/tests/testcases/ranges/10.txt b/pomsky-lib/tests/testcases/ranges/10.txt similarity index 100% rename from rulex-lib/tests/testcases/ranges/10.txt rename to pomsky-lib/tests/testcases/ranges/10.txt diff --git a/rulex-lib/tests/testcases/ranges/11.txt b/pomsky-lib/tests/testcases/ranges/11.txt similarity index 100% rename from rulex-lib/tests/testcases/ranges/11.txt rename to pomsky-lib/tests/testcases/ranges/11.txt diff --git a/rulex-lib/tests/testcases/ranges/12.txt b/pomsky-lib/tests/testcases/ranges/12.txt similarity index 100% rename from rulex-lib/tests/testcases/ranges/12.txt rename to pomsky-lib/tests/testcases/ranges/12.txt diff --git a/rulex-lib/tests/testcases/ranges/13.txt b/pomsky-lib/tests/testcases/ranges/13.txt similarity index 100% rename from rulex-lib/tests/testcases/ranges/13.txt rename to pomsky-lib/tests/testcases/ranges/13.txt diff --git a/rulex-lib/tests/testcases/ranges/14.txt b/pomsky-lib/tests/testcases/ranges/14.txt similarity index 100% rename from rulex-lib/tests/testcases/ranges/14.txt rename to pomsky-lib/tests/testcases/ranges/14.txt diff --git a/rulex-lib/tests/testcases/ranges/15.txt b/pomsky-lib/tests/testcases/ranges/15.txt similarity index 100% rename from rulex-lib/tests/testcases/ranges/15.txt rename to pomsky-lib/tests/testcases/ranges/15.txt diff --git a/rulex-lib/tests/testcases/ranges/2.txt b/pomsky-lib/tests/testcases/ranges/2.txt similarity index 100% rename from rulex-lib/tests/testcases/ranges/2.txt rename to pomsky-lib/tests/testcases/ranges/2.txt diff --git a/rulex-lib/tests/testcases/ranges/3.txt b/pomsky-lib/tests/testcases/ranges/3.txt similarity index 100% rename from rulex-lib/tests/testcases/ranges/3.txt rename to pomsky-lib/tests/testcases/ranges/3.txt diff --git a/rulex-lib/tests/testcases/ranges/4.txt b/pomsky-lib/tests/testcases/ranges/4.txt similarity index 100% rename from rulex-lib/tests/testcases/ranges/4.txt rename to pomsky-lib/tests/testcases/ranges/4.txt diff --git a/rulex-lib/tests/testcases/ranges/5.txt b/pomsky-lib/tests/testcases/ranges/5.txt similarity index 100% rename from rulex-lib/tests/testcases/ranges/5.txt rename to pomsky-lib/tests/testcases/ranges/5.txt diff --git a/rulex-lib/tests/testcases/ranges/6.txt b/pomsky-lib/tests/testcases/ranges/6.txt similarity index 100% rename from rulex-lib/tests/testcases/ranges/6.txt rename to pomsky-lib/tests/testcases/ranges/6.txt diff --git a/rulex-lib/tests/testcases/ranges/7.txt b/pomsky-lib/tests/testcases/ranges/7.txt similarity index 100% rename from rulex-lib/tests/testcases/ranges/7.txt rename to pomsky-lib/tests/testcases/ranges/7.txt diff --git a/rulex-lib/tests/testcases/ranges/8.txt b/pomsky-lib/tests/testcases/ranges/8.txt similarity index 100% rename from rulex-lib/tests/testcases/ranges/8.txt rename to pomsky-lib/tests/testcases/ranges/8.txt diff --git a/rulex-lib/tests/testcases/ranges/9.txt b/pomsky-lib/tests/testcases/ranges/9.txt similarity index 100% rename from rulex-lib/tests/testcases/ranges/9.txt rename to pomsky-lib/tests/testcases/ranges/9.txt diff --git a/rulex-lib/tests/testcases/regex-diagnostics/1.txt b/pomsky-lib/tests/testcases/regex-diagnostics/1.txt similarity index 100% rename from rulex-lib/tests/testcases/regex-diagnostics/1.txt rename to pomsky-lib/tests/testcases/regex-diagnostics/1.txt diff --git a/rulex-lib/tests/testcases/regex-diagnostics/10.txt b/pomsky-lib/tests/testcases/regex-diagnostics/10.txt similarity index 100% rename from rulex-lib/tests/testcases/regex-diagnostics/10.txt rename to pomsky-lib/tests/testcases/regex-diagnostics/10.txt diff --git a/rulex-lib/tests/testcases/regex-diagnostics/11.txt b/pomsky-lib/tests/testcases/regex-diagnostics/11.txt similarity index 100% rename from rulex-lib/tests/testcases/regex-diagnostics/11.txt rename to pomsky-lib/tests/testcases/regex-diagnostics/11.txt diff --git a/rulex-lib/tests/testcases/regex-diagnostics/12.txt b/pomsky-lib/tests/testcases/regex-diagnostics/12.txt similarity index 100% rename from rulex-lib/tests/testcases/regex-diagnostics/12.txt rename to pomsky-lib/tests/testcases/regex-diagnostics/12.txt diff --git a/rulex-lib/tests/testcases/regex-diagnostics/13.txt b/pomsky-lib/tests/testcases/regex-diagnostics/13.txt similarity index 100% rename from rulex-lib/tests/testcases/regex-diagnostics/13.txt rename to pomsky-lib/tests/testcases/regex-diagnostics/13.txt diff --git a/rulex-lib/tests/testcases/regex-diagnostics/14.txt b/pomsky-lib/tests/testcases/regex-diagnostics/14.txt similarity index 100% rename from rulex-lib/tests/testcases/regex-diagnostics/14.txt rename to pomsky-lib/tests/testcases/regex-diagnostics/14.txt diff --git a/rulex-lib/tests/testcases/regex-diagnostics/15.txt b/pomsky-lib/tests/testcases/regex-diagnostics/15.txt similarity index 100% rename from rulex-lib/tests/testcases/regex-diagnostics/15.txt rename to pomsky-lib/tests/testcases/regex-diagnostics/15.txt diff --git a/rulex-lib/tests/testcases/regex-diagnostics/16.txt b/pomsky-lib/tests/testcases/regex-diagnostics/16.txt similarity index 100% rename from rulex-lib/tests/testcases/regex-diagnostics/16.txt rename to pomsky-lib/tests/testcases/regex-diagnostics/16.txt diff --git a/rulex-lib/tests/testcases/regex-diagnostics/17.txt b/pomsky-lib/tests/testcases/regex-diagnostics/17.txt similarity index 100% rename from rulex-lib/tests/testcases/regex-diagnostics/17.txt rename to pomsky-lib/tests/testcases/regex-diagnostics/17.txt diff --git a/rulex-lib/tests/testcases/regex-diagnostics/18.txt b/pomsky-lib/tests/testcases/regex-diagnostics/18.txt similarity index 100% rename from rulex-lib/tests/testcases/regex-diagnostics/18.txt rename to pomsky-lib/tests/testcases/regex-diagnostics/18.txt diff --git a/rulex-lib/tests/testcases/regex-diagnostics/2.txt b/pomsky-lib/tests/testcases/regex-diagnostics/2.txt similarity index 100% rename from rulex-lib/tests/testcases/regex-diagnostics/2.txt rename to pomsky-lib/tests/testcases/regex-diagnostics/2.txt diff --git a/rulex-lib/tests/testcases/regex-diagnostics/3.txt b/pomsky-lib/tests/testcases/regex-diagnostics/3.txt similarity index 100% rename from rulex-lib/tests/testcases/regex-diagnostics/3.txt rename to pomsky-lib/tests/testcases/regex-diagnostics/3.txt diff --git a/rulex-lib/tests/testcases/regex-diagnostics/4.txt b/pomsky-lib/tests/testcases/regex-diagnostics/4.txt similarity index 100% rename from rulex-lib/tests/testcases/regex-diagnostics/4.txt rename to pomsky-lib/tests/testcases/regex-diagnostics/4.txt diff --git a/rulex-lib/tests/testcases/regex-diagnostics/5.txt b/pomsky-lib/tests/testcases/regex-diagnostics/5.txt similarity index 100% rename from rulex-lib/tests/testcases/regex-diagnostics/5.txt rename to pomsky-lib/tests/testcases/regex-diagnostics/5.txt diff --git a/rulex-lib/tests/testcases/regex-diagnostics/6.txt b/pomsky-lib/tests/testcases/regex-diagnostics/6.txt similarity index 100% rename from rulex-lib/tests/testcases/regex-diagnostics/6.txt rename to pomsky-lib/tests/testcases/regex-diagnostics/6.txt diff --git a/rulex-lib/tests/testcases/regex-diagnostics/7.txt b/pomsky-lib/tests/testcases/regex-diagnostics/7.txt similarity index 100% rename from rulex-lib/tests/testcases/regex-diagnostics/7.txt rename to pomsky-lib/tests/testcases/regex-diagnostics/7.txt diff --git a/rulex-lib/tests/testcases/regex-diagnostics/8.txt b/pomsky-lib/tests/testcases/regex-diagnostics/8.txt similarity index 100% rename from rulex-lib/tests/testcases/regex-diagnostics/8.txt rename to pomsky-lib/tests/testcases/regex-diagnostics/8.txt diff --git a/rulex-lib/tests/testcases/regex-diagnostics/9.txt b/pomsky-lib/tests/testcases/regex-diagnostics/9.txt similarity index 100% rename from rulex-lib/tests/testcases/regex-diagnostics/9.txt rename to pomsky-lib/tests/testcases/regex-diagnostics/9.txt diff --git a/rulex-lib/tests/testcases/repetitions/0.txt b/pomsky-lib/tests/testcases/repetitions/0.txt similarity index 100% rename from rulex-lib/tests/testcases/repetitions/0.txt rename to pomsky-lib/tests/testcases/repetitions/0.txt diff --git a/rulex-lib/tests/testcases/repetitions/1.txt b/pomsky-lib/tests/testcases/repetitions/1.txt similarity index 100% rename from rulex-lib/tests/testcases/repetitions/1.txt rename to pomsky-lib/tests/testcases/repetitions/1.txt diff --git a/rulex-lib/tests/testcases/repetitions/10.txt b/pomsky-lib/tests/testcases/repetitions/10.txt similarity index 100% rename from rulex-lib/tests/testcases/repetitions/10.txt rename to pomsky-lib/tests/testcases/repetitions/10.txt diff --git a/rulex-lib/tests/testcases/repetitions/11.txt b/pomsky-lib/tests/testcases/repetitions/11.txt similarity index 100% rename from rulex-lib/tests/testcases/repetitions/11.txt rename to pomsky-lib/tests/testcases/repetitions/11.txt diff --git a/rulex-lib/tests/testcases/repetitions/12.txt b/pomsky-lib/tests/testcases/repetitions/12.txt similarity index 100% rename from rulex-lib/tests/testcases/repetitions/12.txt rename to pomsky-lib/tests/testcases/repetitions/12.txt diff --git a/rulex-lib/tests/testcases/repetitions/13.txt b/pomsky-lib/tests/testcases/repetitions/13.txt similarity index 100% rename from rulex-lib/tests/testcases/repetitions/13.txt rename to pomsky-lib/tests/testcases/repetitions/13.txt diff --git a/rulex-lib/tests/testcases/repetitions/2.txt b/pomsky-lib/tests/testcases/repetitions/2.txt similarity index 100% rename from rulex-lib/tests/testcases/repetitions/2.txt rename to pomsky-lib/tests/testcases/repetitions/2.txt diff --git a/rulex-lib/tests/testcases/repetitions/3.txt b/pomsky-lib/tests/testcases/repetitions/3.txt similarity index 100% rename from rulex-lib/tests/testcases/repetitions/3.txt rename to pomsky-lib/tests/testcases/repetitions/3.txt diff --git a/rulex-lib/tests/testcases/repetitions/4.txt b/pomsky-lib/tests/testcases/repetitions/4.txt similarity index 100% rename from rulex-lib/tests/testcases/repetitions/4.txt rename to pomsky-lib/tests/testcases/repetitions/4.txt diff --git a/rulex-lib/tests/testcases/repetitions/5.txt b/pomsky-lib/tests/testcases/repetitions/5.txt similarity index 100% rename from rulex-lib/tests/testcases/repetitions/5.txt rename to pomsky-lib/tests/testcases/repetitions/5.txt diff --git a/rulex-lib/tests/testcases/repetitions/6.txt b/pomsky-lib/tests/testcases/repetitions/6.txt similarity index 100% rename from rulex-lib/tests/testcases/repetitions/6.txt rename to pomsky-lib/tests/testcases/repetitions/6.txt diff --git a/rulex-lib/tests/testcases/repetitions/7.txt b/pomsky-lib/tests/testcases/repetitions/7.txt similarity index 100% rename from rulex-lib/tests/testcases/repetitions/7.txt rename to pomsky-lib/tests/testcases/repetitions/7.txt diff --git a/rulex-lib/tests/testcases/repetitions/8.txt b/pomsky-lib/tests/testcases/repetitions/8.txt similarity index 100% rename from rulex-lib/tests/testcases/repetitions/8.txt rename to pomsky-lib/tests/testcases/repetitions/8.txt diff --git a/rulex-lib/tests/testcases/repetitions/9.txt b/pomsky-lib/tests/testcases/repetitions/9.txt similarity index 100% rename from rulex-lib/tests/testcases/repetitions/9.txt rename to pomsky-lib/tests/testcases/repetitions/9.txt diff --git a/rulex-lib/tests/testcases/strings/0.txt b/pomsky-lib/tests/testcases/strings/0.txt similarity index 100% rename from rulex-lib/tests/testcases/strings/0.txt rename to pomsky-lib/tests/testcases/strings/0.txt diff --git a/rulex-lib/tests/testcases/strings/1.txt b/pomsky-lib/tests/testcases/strings/1.txt similarity index 100% rename from rulex-lib/tests/testcases/strings/1.txt rename to pomsky-lib/tests/testcases/strings/1.txt diff --git a/rulex-lib/tests/testcases/strings/100.txt b/pomsky-lib/tests/testcases/strings/100.txt similarity index 100% rename from rulex-lib/tests/testcases/strings/100.txt rename to pomsky-lib/tests/testcases/strings/100.txt diff --git a/rulex-lib/tests/testcases/strings/101.txt b/pomsky-lib/tests/testcases/strings/101.txt similarity index 100% rename from rulex-lib/tests/testcases/strings/101.txt rename to pomsky-lib/tests/testcases/strings/101.txt diff --git a/rulex-lib/tests/testcases/strings/2.txt b/pomsky-lib/tests/testcases/strings/2.txt similarity index 100% rename from rulex-lib/tests/testcases/strings/2.txt rename to pomsky-lib/tests/testcases/strings/2.txt diff --git a/rulex-lib/tests/testcases/strings/3.txt b/pomsky-lib/tests/testcases/strings/3.txt similarity index 100% rename from rulex-lib/tests/testcases/strings/3.txt rename to pomsky-lib/tests/testcases/strings/3.txt diff --git a/rulex-lib/tests/testcases/variables/0.txt b/pomsky-lib/tests/testcases/variables/0.txt similarity index 100% rename from rulex-lib/tests/testcases/variables/0.txt rename to pomsky-lib/tests/testcases/variables/0.txt diff --git a/rulex-lib/tests/testcases/variables/1.txt b/pomsky-lib/tests/testcases/variables/1.txt similarity index 100% rename from rulex-lib/tests/testcases/variables/1.txt rename to pomsky-lib/tests/testcases/variables/1.txt diff --git a/rulex-lib/tests/testcases/variables/10.txt b/pomsky-lib/tests/testcases/variables/10.txt similarity index 100% rename from rulex-lib/tests/testcases/variables/10.txt rename to pomsky-lib/tests/testcases/variables/10.txt diff --git a/rulex-lib/tests/testcases/variables/100.txt b/pomsky-lib/tests/testcases/variables/100.txt similarity index 100% rename from rulex-lib/tests/testcases/variables/100.txt rename to pomsky-lib/tests/testcases/variables/100.txt diff --git a/rulex-lib/tests/testcases/variables/101.txt b/pomsky-lib/tests/testcases/variables/101.txt similarity index 100% rename from rulex-lib/tests/testcases/variables/101.txt rename to pomsky-lib/tests/testcases/variables/101.txt diff --git a/rulex-lib/tests/testcases/variables/102.txt b/pomsky-lib/tests/testcases/variables/102.txt similarity index 100% rename from rulex-lib/tests/testcases/variables/102.txt rename to pomsky-lib/tests/testcases/variables/102.txt diff --git a/rulex-lib/tests/testcases/variables/103.txt b/pomsky-lib/tests/testcases/variables/103.txt similarity index 100% rename from rulex-lib/tests/testcases/variables/103.txt rename to pomsky-lib/tests/testcases/variables/103.txt diff --git a/rulex-lib/tests/testcases/variables/104.txt b/pomsky-lib/tests/testcases/variables/104.txt similarity index 100% rename from rulex-lib/tests/testcases/variables/104.txt rename to pomsky-lib/tests/testcases/variables/104.txt diff --git a/rulex-lib/tests/testcases/variables/105.txt b/pomsky-lib/tests/testcases/variables/105.txt similarity index 100% rename from rulex-lib/tests/testcases/variables/105.txt rename to pomsky-lib/tests/testcases/variables/105.txt diff --git a/rulex-lib/tests/testcases/variables/106.txt b/pomsky-lib/tests/testcases/variables/106.txt similarity index 100% rename from rulex-lib/tests/testcases/variables/106.txt rename to pomsky-lib/tests/testcases/variables/106.txt diff --git a/rulex-lib/tests/testcases/variables/107.txt b/pomsky-lib/tests/testcases/variables/107.txt similarity index 100% rename from rulex-lib/tests/testcases/variables/107.txt rename to pomsky-lib/tests/testcases/variables/107.txt diff --git a/rulex-lib/tests/testcases/variables/108.txt b/pomsky-lib/tests/testcases/variables/108.txt similarity index 100% rename from rulex-lib/tests/testcases/variables/108.txt rename to pomsky-lib/tests/testcases/variables/108.txt diff --git a/rulex-lib/tests/testcases/variables/109.txt b/pomsky-lib/tests/testcases/variables/109.txt similarity index 100% rename from rulex-lib/tests/testcases/variables/109.txt rename to pomsky-lib/tests/testcases/variables/109.txt diff --git a/rulex-lib/tests/testcases/variables/2.txt b/pomsky-lib/tests/testcases/variables/2.txt similarity index 100% rename from rulex-lib/tests/testcases/variables/2.txt rename to pomsky-lib/tests/testcases/variables/2.txt diff --git a/rulex-lib/tests/testcases/variables/3.txt b/pomsky-lib/tests/testcases/variables/3.txt similarity index 100% rename from rulex-lib/tests/testcases/variables/3.txt rename to pomsky-lib/tests/testcases/variables/3.txt diff --git a/rulex-lib/tests/testcases/variables/4.txt b/pomsky-lib/tests/testcases/variables/4.txt similarity index 100% rename from rulex-lib/tests/testcases/variables/4.txt rename to pomsky-lib/tests/testcases/variables/4.txt diff --git a/rulex-lib/tests/testcases/variables/5.txt b/pomsky-lib/tests/testcases/variables/5.txt similarity index 100% rename from rulex-lib/tests/testcases/variables/5.txt rename to pomsky-lib/tests/testcases/variables/5.txt diff --git a/rulex-lib/tests/testcases/variables/6.txt b/pomsky-lib/tests/testcases/variables/6.txt similarity index 100% rename from rulex-lib/tests/testcases/variables/6.txt rename to pomsky-lib/tests/testcases/variables/6.txt diff --git a/rulex-lib/tests/testcases/variables/7.txt b/pomsky-lib/tests/testcases/variables/7.txt similarity index 100% rename from rulex-lib/tests/testcases/variables/7.txt rename to pomsky-lib/tests/testcases/variables/7.txt diff --git a/rulex-lib/tests/testcases/variables/8.txt b/pomsky-lib/tests/testcases/variables/8.txt similarity index 100% rename from rulex-lib/tests/testcases/variables/8.txt rename to pomsky-lib/tests/testcases/variables/8.txt diff --git a/rulex-lib/tests/testcases/variables/9.txt b/pomsky-lib/tests/testcases/variables/9.txt similarity index 100% rename from rulex-lib/tests/testcases/variables/9.txt rename to pomsky-lib/tests/testcases/variables/9.txt diff --git a/rulex-lib/tests/testcases/warnings/1.txt b/pomsky-lib/tests/testcases/warnings/1.txt similarity index 100% rename from rulex-lib/tests/testcases/warnings/1.txt rename to pomsky-lib/tests/testcases/warnings/1.txt diff --git a/pomsky-macro/Cargo.toml b/pomsky-macro/Cargo.toml new file mode 100644 index 0000000..5580968 --- /dev/null +++ b/pomsky-macro/Cargo.toml @@ -0,0 +1,22 @@ +[package] +name = "pomsky-macro" +description = "Macro for converting pomsky expressions to regexes" +version = "0.5.0" +edition = "2021" +authors = ["Ludwig Stecher "] +license = "MIT OR Apache-2.0" +homepage = "https://github.com/rulex-rs/pomsky/blob/main/pomsky-macro" +repository = "https://github.com/rulex-rs/pomsky" +documentation = "https://docs.rs/pomsky-macro" +keywords = ["macro", "regexp", "regex", "pomsky"] +categories = ["text-processing"] + +[lib] +proc-macro = true + +[features] +default = [] +diagnostics = [] + +[dependencies] +pomsky = { version = "0.5.0", path = "../pomsky-lib" } diff --git a/rulex-macro/README.md b/pomsky-macro/README.md similarity index 64% rename from rulex-macro/README.md rename to pomsky-macro/README.md index 8440ec7..dfefa88 100644 --- a/rulex-macro/README.md +++ b/pomsky-macro/README.md @@ -1,12 +1,12 @@ -# rulex-macro +# pomsky-macro -This Rust procedural macro allows converting a [rulex expression](../README.md) to a regex +This Rust procedural macro allows converting a [pomsky expression](../README.md) to a regex string literal at compile time: ```rust -use rulex_macro::rulex; +use pomsky_macro::pomsky; -const REGEX: &str = rulex!("foo" | "bar"+ greedy); +const REGEX: &str = pomsky!("foo" | "bar"+ greedy); ``` This string can then used with the `regex` crate: @@ -17,7 +17,7 @@ let my_regex = regex::Regex::new(REGEX).unwrap(); ## Diagnostics -Errors from rulex are shown at compile time and are highlighted in your IDE. You can improve the +Errors from pomsky are shown at compile time and are highlighted in your IDE. You can improve the diagnostics by enabling the `diagnostics` feature, which requires Rust Nightly. ## Regex flavor @@ -25,7 +25,7 @@ diagnostics by enabling the `diagnostics` feature, which requires Rust Nightly. If you want to use a regex flavor _other than Rust_, you can specify it after a hashtag: ```rust -const REGEX: &str = rulex!( +const REGEX: &str = pomsky!( #flavor = Pcre >> "test" % ); diff --git a/rulex-macro/src/diagnostic.rs b/pomsky-macro/src/diagnostic.rs similarity index 98% rename from rulex-macro/src/diagnostic.rs rename to pomsky-macro/src/diagnostic.rs index 169f92c..ee28300 100644 --- a/rulex-macro/src/diagnostic.rs +++ b/pomsky-macro/src/diagnostic.rs @@ -1,7 +1,7 @@ use std::{fmt::Write, ops::Range}; +use pomsky::error::Diagnostic; use proc_macro::{Delimiter, Group, Ident, Literal, Punct, Spacing, Span, TokenStream, TokenTree}; -use rulex::error::Diagnostic; pub(crate) fn fmt(diagnostic: Diagnostic, _: Group) -> String { let mut buf = String::new(); diff --git a/rulex-macro/src/lib.rs b/pomsky-macro/src/lib.rs similarity index 92% rename from rulex-macro/src/lib.rs rename to pomsky-macro/src/lib.rs index 2f6533e..75f2458 100644 --- a/rulex-macro/src/lib.rs +++ b/pomsky-macro/src/lib.rs @@ -6,20 +6,20 @@ use std::iter::Peekable; use proc_macro::{Delimiter, Group, Literal, Span, TokenStream, TokenTree}; -use rulex::{ +use pomsky::{ error::Diagnostic, options::{CompileOptions, RegexFlavor}, - Rulex, + Expr, }; mod diagnostic; #[proc_macro] -pub fn rulex(items: TokenStream) -> TokenStream { +pub fn pomsky(items: TokenStream) -> TokenStream { let group = Group::new(Delimiter::None, items); let global_span = group.span(); - match rulex_impl(group.stream().into_iter()) { + match pomsky_impl(group.stream().into_iter()) { Ok(lit) => TokenTree::Literal(lit).into(), Err(Error { msg, span }) => { let span = span.unwrap_or(global_span); @@ -74,7 +74,7 @@ fn expect( } } -fn rulex_impl(items: impl Iterator) -> Result { +fn pomsky_impl(items: impl Iterator) -> Result { let mut iter = items.peekable(); let found_hashtag = @@ -116,7 +116,7 @@ fn rulex_impl(items: impl Iterator) -> Result let input = input.trim_start_matches("/*ยซ*/").trim_end_matches("/*ยป*/"); - match Rulex::parse_and_compile(input, Default::default(), CompileOptions { flavor }) { + match Expr::parse_and_compile(input, Default::default(), CompileOptions { flavor }) { Ok((compiled, _warnings)) => Ok(Literal::string(&compiled)), Err(e) => bail!(diagnostic::fmt(Diagnostic::from_compile_error(e, input), group), span), diff --git a/rulex-macro/tests/test_macro.rs b/pomsky-macro/tests/test_macro.rs similarity index 76% rename from rulex-macro/tests/test_macro.rs rename to pomsky-macro/tests/test_macro.rs index 1adb907..3d36dd5 100644 --- a/rulex-macro/tests/test_macro.rs +++ b/pomsky-macro/tests/test_macro.rs @@ -1,8 +1,8 @@ -use rulex_macro::rulex; +use pomsky_macro::pomsky; #[test] fn rust() { - const REGEX: &str = rulex! { + const REGEX: &str = pomsky! { // variables let number = '-'? [d]+; let op = ["+-*/"]; @@ -14,7 +14,7 @@ fn rust() { #[test] fn pcre() { - const REGEX: &str = rulex!( + const REGEX: &str = pomsky!( #flavor = Pcre "foo" (!>> "bar") ); @@ -24,7 +24,7 @@ fn pcre() { #[test] fn composite_tokens() { - const REGEX: &str = rulex!( + const REGEX: &str = pomsky!( Start "Test" End ); diff --git a/rulex-macro/Cargo.toml b/rulex-macro/Cargo.toml deleted file mode 100644 index 302e9a6..0000000 --- a/rulex-macro/Cargo.toml +++ /dev/null @@ -1,22 +0,0 @@ -[package] -name = "rulex-macro" -description = "Macro for converting rulex expressions to regexes" -version = "0.4.3" -edition = "2021" -authors = ["Ludwig Stecher "] -license = "MIT OR Apache-2.0" -homepage = "https://github.com/rulex-rs/rulex/blob/main/rulex-macro" -repository = "https://github.com/rulex-rs/rulex" -documentation = "https://docs.rs/rulex-macro" -keywords = ["macro", "regexp", "regex", "rulex"] -categories = ["text-processing"] - -[lib] -proc-macro = true - -[features] -default = [] -diagnostics = [] - -[dependencies] -rulex = { version = "0.4.3", path = "../rulex-lib" }