lindenmayer icon indicating copy to clipboard operation
lindenmayer copied to clipboard

help wanted: audit/improve CS-matching function

Open nylki opened this issue 6 years ago • 0 comments

Although the library performs properly in all cases I tested previously, I am not 100% sure wether the matching algorithm for context sensitive productions @ https://github.com/nylki/lindenmayer/blob/master/lindenmayer.js#L314 works as expected and as defined in "The Algorithmic Beauty of Plants".

If you have experience with (context-sensitive) pattern matching, and branching syntax, I'd very much appreciate if you could take a look at the match() function and see if it performs as expected or even improve performance. I positive that the algorithm could be improved upon.

I am especially unsure whether the algorithm performs properly in complex branching situation. Simple regex does not work here unfortunately, because of branching situations.

There are several tests that can be run via npm test that should pass, but new, more comprehensive tests would probably be a good idea too. It is also not excluded that some tests might be flawed, taking a look there might be a good idea too.

nylki avatar Jun 28 '18 09:06 nylki