Handle children[3] IndexError and show why, and potentially avoid the error since the scad file is valid.
The library Getriebe Bibliothek für OpenSCAD / Gears Library for OpenSCAD is a good candidate for issue #4 and causes an exception in sca2d.
Example program: Run langdump.py at github.com/poikilos/gearlib.git
actual result:
. . .
File "/home/owner/.local/lib/python3.9/site-packages/sca2d/scope.py", line 754, in _parse_scope
scope = ElseExprScope(self._tree.children[3], self)
IndexError: list index out of range
Full traceback: pastebin.com/1BM6kDKf
Package versions:
python3 -m pip install --user sca2d
Requirement already satisfied: sca2d in /home/owner/.local/lib/python3.9/site-packages (0.2.0)
Requirement already satisfied: lark-parser in /home/owner/.local/lib/python3.9/site-packages (from sca2d) (0.6.7)
Requirement already satisfied: colorama in /usr/lib/python3/dist-packages (from sca2d) (0.4.4)
Edited by Jacob Gustafson