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

Don't print newline for null glo decls #33

Closed laurenthuberdeau closed 5 months ago

laurenthuberdeau commented 5 months ago

Context

Functions that end up not needing to call save_vars/unsave_vars had newlines in their place. This looks bad, especially for small functions because the whitespace takes as much space as the rest of the code:


_begin_string() {

  _string_start=$_string_pool_alloc
  _hash=0

}

This PR skips those empty lines so we no longer see the space reserved for save_vars/unsave_vars.