Re: [dev] Preprocessor

From: Peter Nagy <petern_AT_riseup.net>
Date: Tue, 23 Apr 2019 20:06:14 +0000

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.gates_AT_gmail.com> wrote:
>On Tue, Apr 23, 2019 at 12:42 PM Hadrien Lacour
><hadrien.lacour_AT_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.
Received on Tue Apr 23 2019 - 22:06:14 CEST

This archive was generated by hypermail 2.3.0 : Tue Apr 23 2019 - 22:12:08 CEST