Today I began rethinking the structure of #GraphexScala. My first iteration, during school, was very Java-minded. For this rewrite, I wanted to make the project a lot cleaner, and incorporate a handful of Scala-specific niceties.
At work today I began rewriting some of the helper functions. One of these was consolidating all multi-asterisks into a single asterisk, since for our purposes a-star-star will match the same strings as a-star (dammit markdown!). The other involved reading the “alphabet” out of the file to be checked, a set of all characters except newline. I was able to turn both of those functions into concise one-liners that use recursion and collection transformations out the wazoo.
I also put some work into remembering how my productions worked for the regex-parsing and NFA-building. I am going to keep it mostly the same as it was in the Java version, but hopefully it will be easier to debug this time.