Closed stevelandeyasana closed 2 years ago
Updated to include internal validation of each entry.
I've done a bunch of work since this to redo how errors are logged and to fix bugs. I'll apply any feedback to the followup PR which finishes the work.
1. Parsing and grammar
Parses strings like
Hello %#@bob@
into lists of enums like[.constant("Hello "), .variable("bob")]
stored onLexedStringsdictString
objects. (Open to suggestions for the name.)It then uses a basic recursive function to walk the grammar formed by the stringsdict entry's format key and rules to generate all possible permutations.
Example input:
Example output:
2. Canonical argument list
Parses all permutations to find arguments, then makes sure each argument at each position has a specifier matching the other permutations.