udem-dlteam / pnut

🥜 A Self-Compiling C Transpiler Targeting Human-Readable POSIX Shell
https://pnut.sh
BSD 2-Clause "Simplified" License
425 stars 14 forks source link

A few small changes #105

Closed laurenthuberdeau closed 1 month ago

laurenthuberdeau commented 1 month ago

Context

I wanted to see which part of the compilation process took the longest and made a few useful changes:

  1. Use do_while in get_tok: this saves 1 temporary and should make it faster and the cost shorter
  2. Remove duplicated print_string_char function only used by the debug.c module (otherwise dead code)
  3. Add a script to make it easy to invoke the reader/tokenizer/parser.
  4. Indent the tokenizer output to make it easier to read.