################### From calmjs.parse ################### .. package-meta:: calmjs.parse calmjs/calmjs.parse `calmjs.parse `_ is a full JavaScript front end in pure Python. It lexes and parses ES5 to a concrete AST (``es5(source)``), walks and rewrites that tree through its ``walkers`` and ``asttypes`` modules, and prints it back with either ``pretty_print`` (readable, re-indented) or ``minify_print`` — whose ``obfuscate=True`` renames local identifiers the way a real minifier does. It can also emit source maps for the printed output. Built for the calmjs Node.js integration toolchain, it is the most capable of the PyPI minifiers, but it parses only ES5: modern syntax (arrow functions, ``let``/``const``, classes, template literals) raises a syntax error, and the pure-Python parse is slow. turbohtml covers the minification slice of that surface. :func:`~turbohtml.clean.minify_js` is the same parse-and-rename approach implemented in C, matching or beating calmjs.parse's output size while running roughly fifty to a hundred times faster and accepting a much larger slice of the language. It does not expose an AST, a pretty-printer, or source maps — it is a minifier, not a general JavaScript toolkit. *************************** turbohtml vs calmjs.parse *************************** .. list-table:: :header-rows: 1 :widths: 20 40 40 - - Dimension - turbohtml - calmjs.parse - - Scope - JavaScript minifier only (plus inline ``