Limitations & Troubleshooting

Teeny is intentionally small and these are the known limitations of this teaching compiler.

Single-statement control flow (no blocks)

In this version, the parser does not implement block parsing for { ... }.

// Example that may fail: blocks are not implemented yet
if(x > 5) { return 5; }
  • Use the single-statement form instead (e.g. `if(x > 5) return 5;`).
  • For now, avoid { ... } blocks after conditions.

Supported subset

  • Supported (core)

    The compiler can tokenise/parse and generate JS for common constructs.

    • let declarations
    • arithmetic expressions
    • arrays and indexing
    • if / while / for (single-statement form)
    • return and print
  • Not supported yet

    These are either missing or incomplete in the current implementation.

    • function definitions (func keyword)
    • brace blocks { ... } as statement bodies

Errors: read line and column numbers

  • Compilation errors include source location (line/column numbers).
  • Use that to quickly find the problematic token in the editor.