From c6897211cb5da8c5bbbaf267db8ad020eb63a114 Mon Sep 17 00:00:00 2001 From: bculkin2442 Date: Mon, 9 Sep 2019 19:56:53 -0400 Subject: Implement pattern guards Pattern guards allow you to say that a particular pair should only be replaced when the input matches a particular regular expression. It is tied to the 'G' or 'Guard' control on the pair header, and is one of the 3 or so major features I want to implement before a 1.0 release As an aside, the other two features I want to add are: Multibody Support ================= This will allow a pair to replace to a few different things, based on various conditions (the two main ones I want are some sort of cyclic behavior, and some sort of guards for these) Sub-application ================ Allow the application of a stage to the result of applying a pair/parts of applying a pair. This will likely entail several sub-features such as: Named Stages ------------ A named stage is a collection of pairs that isn't applied by default, but is instead used for convenient grouping of related pages together. Custom Replacement ------------------ Instead of using replaceAll, I'll probably go for something using appendReplacement etc. on Matcher and roll some sort of custom thing, so as to provide for a convenient syntax for anything special I want to do while running the replacement. I'll also want to add some documentation, in addition to maybe doing some restructuring to make how things are laid out more obvious. --- data/test/test10.rp | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 data/test/test10.rp (limited to 'data') diff --git a/data/test/test10.rp b/data/test/test10.rp new file mode 100644 index 0000000..a647a3a --- /dev/null +++ b/data/test/test10.rp @@ -0,0 +1,3 @@ +# Test pair guards +//G/aaa//a +b -- cgit v1.2.3