This was a question about the preprocessor, please take your sh (off-)topic to 
a different thread.

That main, mostly the switch part, is huge! Having more than 3 levels of 
nesting of loops+conditionals (if, for, while, switch) is a code smell; it is 
hard to read, hard to reason about and easy to get wrong.

Bonus points for not using lex/yacc etc, writing a parser by hand needn't be 
hard. Still, some refactoring to create smaller, readable and maintainable 
functions would go a long way. Maybe trying out to write out the states the 
parser can be in as a table would help to see if the parser can be simplified 
or the token choices changed. Toying with an FSM implementation might be fun 
too :)


Why are you building this tool? Fun, education, prototype? What is the end 
goal? Who is the audience? 

Good luck with your project!
--
Peter Nagy

 - To reach a goal one has to enjoy the journey

On April 23, 2019 7:44:57 PM UTC, Evan Gates <evan.ga...@gmail.com> wrote:
>On Tue, Apr 23, 2019 at 12:42 PM Hadrien Lacour
><hadrien.lac...@posteo.net> wrote:
>> That was just shitposting. I use `find` to avoid most of the UNIX
>braindamage
>> in this case.
>
>Which is good as long as you use -exec correctly. Or if you're going
>to use xargs make sure to use nul separated lists. Xargs without the
>nul option is broken by design.

Reply via email to