code-reviews

lispyclouds 2018-07-18T07:54:50.000004Z

Hello all! I am writing a function to tokenize a shell command as a string and tokenize it into the commad and its args. For example: Input: "sh -c \"while sleep 1; do echo \\\"${RANDOM}\\\"; done\"" Output: ["sh", "-c", "while sleep 1; do echo \"${RANDOM}\"; done"] This is what I've come up with. Its a direct conversion of https://sourceforge.net/p/drjava/git_repo/ci/master/tree/drjava/src/edu/rice/cs/util/ArgumentTokenizer.java#l70

lispyclouds 2018-07-18T07:56:25.000054Z

Need help in the follwing areas: - How to collect the recurs into a single recur - Making it more idiomatic - General feedback and improvements All help is much appreciated! 😄

2018-07-18T16:19:25.000179Z

finite state transducer + reduce

2018-07-18T16:20:51.000386Z

which may or may not help, maybe look at automat

2018-07-18T16:21:35.000435Z

or maybe replace it with a regex