As discussed with @jcmcdonald in the Ratscript chat:
ardunster
8:59 AM
Hmm, maybe I need to think more about how the negative is supposed to work. I'm guessing the tests aren't very good for it, either. If you can think of a few model/input examples for pass/fail situations it might help?
Also realized the single character literal match test doesn't test for a few things it probably should, going to update that test a bit (much easier to put multiple possible models in a test now that I have a static match function ;D )
jcmcdonald
11:02 AM
Model: ^d!+/ and ^d+/
Matches...ABC and 123 ... and 5 One and 2 A and 42The model ^d+!/ and ^d+/ should be functionally identical.
....eep, that is , ^d!+/ means the same thing as ^d+!/. I just realized that and up there reads weird. Sorry.
ardunster
11:59 AM
Hmm, I'll think about it. The way multiples are set up, if I wrote the negative multiple the same, ^d+!/ would match ABC and , ... and , One and , A and , then the match would probably fail because it would already consume everything not a digit before the digit unit.
I'm not quite sure how to resolve the problem of multiples over-matching when they overlap with the next piece of the model without doing any kind of look-ahead, to be honest
jcmcdonald
12:07 PM
Ahh, yes, it's the "greedy" problem.
What you *could* do to resolve that is check if the character being inspected is the next LITERAL.
That is, if you encounter a space, it might still be in the unit, or it might be in the literal. Let that remain ambiguous somehow until it can be resolved, ergo hitting 1, which fails both the first unit and the literal.