The cl-uglify-js Reference Manual

This is the cl-uglify-js Reference Manual, generated automatically by Declt version 4.0 beta 2 "William Riker" on Mon Feb 26 15:49:10 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

The main system appears first, followed by any subsystem dependency.


2.1 cl-uglify-js

JavaScript compressor/beautifier on top of PARSE-JS

Author

Mihai Bazon <>

Dependencies
  • parse-js (system).
  • cl-ppcre (system).
  • cl-ppcre-unicode (system).
  • parse-number (system).
  • iterate (system).
Source

cl-uglify-js.asd.

Child Component

src (module).


3 Modules

Modules are listed depth-first from the system components tree.


3.1 cl-uglify-js/src

Source

cl-uglify-js.asd.

Parent Component

cl-uglify-js (system).

Child Components

4 Files

Files are sorted by type and then listed depth-first from the systems components trees.


4.1 Lisp


4.1.1 cl-uglify-js/cl-uglify-js.asd

Source

cl-uglify-js.asd.

Parent Component

cl-uglify-js (system).

ASDF Systems

cl-uglify-js.


4.1.2 cl-uglify-js/src/package.lisp

Source

cl-uglify-js.asd.

Parent Component

src (module).

Packages

cl-uglify-js.


4.1.3 cl-uglify-js/src/constants.lisp

Dependency

package.lisp (file).

Source

cl-uglify-js.asd.

Parent Component

src (module).

Internals

4.1.4 cl-uglify-js/src/walker.lisp

Dependency

constants.lisp (file).

Source

cl-uglify-js.asd.

Parent Component

src (module).

Public Interface
Internals

varlist (function).


4.1.5 cl-uglify-js/src/mangle.lisp

Dependency

walker.lisp (file).

Source

cl-uglify-js.asd.

Parent Component

src (module).

Public Interface

ast-mangle (function).

Internals

4.1.6 cl-uglify-js/src/squeeze.lisp

Dependency

mangle.lisp (file).

Source

cl-uglify-js.asd.

Parent Component

src (module).

Public Interface

ast-squeeze (function).

Internals

4.1.7 cl-uglify-js/src/codegen.lisp

Dependency

squeeze.lisp (file).

Source

cl-uglify-js.asd.

Parent Component

src (module).

Public Interface

ast-gen-code (function).

Internals

4.1.8 cl-uglify-js/src/split.lisp

Dependency

codegen.lisp (file).

Source

cl-uglify-js.asd.

Parent Component

src (module).

Public Interface

split-code (function).


5 Packages

Packages are listed by definition order.


5.1 cl-uglify-js

Source

package.lisp.

Nickname

uglify-js

Use List
  • common-lisp.
  • iterate.
  • parse-js.
Public Interface
Internals

6 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


6.1 Public Interface


6.1.1 Macros

Macro: ast-case (expr &body body)
Package

cl-uglify-js.

Source

walker.lisp.

Macro: ast-walk ((ast &optional expr walk stack) &body body)
Package

cl-uglify-js.

Source

walker.lisp.


6.1.2 Ordinary functions

Function: ast-gen-code (ast &key beautify indent-level indent-start quote-keys)
Package

cl-uglify-js.

Source

codegen.lisp.

Function: ast-mangle (ast &key toplevel)
Package

cl-uglify-js.

Source

mangle.lisp.

Function: ast-squeeze (ast &key sequences dead-code)
Package

cl-uglify-js.

Source

squeeze.lisp.

Function: split-code (code &optional maxlen)

Inserts newlines into the given ‘code’ (must be a string) as soon as lines are bigger than ‘maxlen’ (default 32K). Note that the lines in the output will generally be bigger than ‘maxlen’. This function splits code only *before* a :KEYWORD, :ATOM, :NAME or :PUNC, and it never splits *after* a :KEYWORD (in order not to break the JS semantics, which say that no newline is allowed between return or throw and their arguments).

Package

cl-uglify-js.

Source

split.lisp.


6.2 Internals


6.2.1 Special variables

Special Variable: *codegen-beautify*
Package

cl-uglify-js.

Source

constants.lisp.

Special Variable: *codegen-indent-level*
Package

cl-uglify-js.

Source

constants.lisp.

Special Variable: *codegen-indent-start*
Package

cl-uglify-js.

Source

constants.lisp.

Special Variable: *codegen-newline*
Package

cl-uglify-js.

Source

constants.lisp.

Special Variable: *codegen-quote-keys*
Package

cl-uglify-js.

Source

constants.lisp.

Special Variable: *codegen-tl-newline*
Package

cl-uglify-js.

Source

constants.lisp.

Special Variable: *current-scope*
Package

cl-uglify-js.

Source

mangle.lisp.

Special Variable: *precedence*
Package

cl-uglify-js.

Source

constants.lisp.

Special Variable: +json-lisp-escaped-chars+

Mapping between JSON String escape sequences and Lisp chars.

Package

cl-uglify-js.

Source

constants.lisp.


6.2.2 Macros

Macro: awhen++ ((var cond) &body body)
Package

cl-uglify-js.

Source

squeeze.lisp.

Macro: foreach-scope-parent ((scope var) &body body)
Package

cl-uglify-js.

Source

mangle.lisp.


6.2.3 Ordinary functions

Function: aborts (node)
Package

cl-uglify-js.

Source

squeeze.lisp.

Function: base54 (num)
Package

cl-uglify-js.

Source

mangle.lisp.

Function: best-of (ast1 ast2)
Package

cl-uglify-js.

Source

squeeze.lisp.

Function: boolean-expr (expr)
Package

cl-uglify-js.

Source

squeeze.lisp.

Function: conditional (cond then &optional else)
Package

cl-uglify-js.

Source

squeeze.lisp.

Function: copy-scope (instance)
Package

cl-uglify-js.

Source

mangle.lisp.

Function: copy-topval (instance)
Package

cl-uglify-js.

Source

constants.lisp.

Function: curry (func &rest a1)
Package

cl-uglify-js.

Source

constants.lisp.

Function: empty (b)
Package

cl-uglify-js.

Source

squeeze.lisp.

Function: is-identifier (name)
Package

cl-uglify-js.

Source

constants.lisp.

Function: make-scope (&key names mangled rev-mangled cname refs uses-eval uses-with level parent children)
Package

cl-uglify-js.

Source

mangle.lisp.

Function: make-topval (&key v)
Package

cl-uglify-js.

Source

constants.lisp.

Function: mymap (func list)
Package

cl-uglify-js.

Source

constants.lisp.

Function: negate (c)
Package

cl-uglify-js.

Source

squeeze.lisp.

Function: new-scope (&optional parent)
Package

cl-uglify-js.

Source

mangle.lisp.

Function: quote-string (str)
Package

cl-uglify-js.

Source

codegen.lisp.

Function: rmblock (block)
Package

cl-uglify-js.

Source

squeeze.lisp.

Reader: scope-children (instance)
Writer: (setf scope-children) (instance)
Package

cl-uglify-js.

Source

mangle.lisp.

Target Slot

children.

Reader: scope-cname (instance)
Writer: (setf scope-cname) (instance)
Package

cl-uglify-js.

Source

mangle.lisp.

Target Slot

cname.

Function: scope-define (scope name)
Package

cl-uglify-js.

Source

mangle.lisp.

Function: scope-get-mangled (scope name &optional make)
Package

cl-uglify-js.

Source

mangle.lisp.

Function: scope-has (scope name)
Package

cl-uglify-js.

Source

mangle.lisp.

Function: scope-has-mangled (scope mname)
Package

cl-uglify-js.

Source

mangle.lisp.

Reader: scope-level (instance)
Writer: (setf scope-level) (instance)
Package

cl-uglify-js.

Source

mangle.lisp.

Target Slot

level.

Reader: scope-mangled (instance)
Writer: (setf scope-mangled) (instance)
Package

cl-uglify-js.

Source

mangle.lisp.

Target Slot

mangled.

Reader: scope-names (instance)
Writer: (setf scope-names) (instance)
Package

cl-uglify-js.

Source

mangle.lisp.

Target Slot

names.

Function: scope-next-mangled (scope)
Package

cl-uglify-js.

Source

mangle.lisp.

Function: scope-p (object)
Package

cl-uglify-js.

Source

mangle.lisp.

Reader: scope-parent (instance)
Writer: (setf scope-parent) (instance)
Package

cl-uglify-js.

Source

mangle.lisp.

Target Slot

parent.

Reader: scope-refs (instance)
Writer: (setf scope-refs) (instance)
Package

cl-uglify-js.

Source

mangle.lisp.

Target Slot

refs.

Reader: scope-rev-mangled (instance)
Writer: (setf scope-rev-mangled) (instance)
Package

cl-uglify-js.

Source

mangle.lisp.

Target Slot

rev-mangled.

Reader: scope-uses-eval (instance)
Writer: (setf scope-uses-eval) (instance)
Package

cl-uglify-js.

Source

mangle.lisp.

Target Slot

uses-eval.

Reader: scope-uses-with (instance)
Writer: (setf scope-uses-with) (instance)
Package

cl-uglify-js.

Source

mangle.lisp.

Target Slot

uses-with.

Function: stick (&rest elements)
Package

cl-uglify-js.

Source

codegen.lisp.

Function: topval-p (object)
Package

cl-uglify-js.

Source

constants.lisp.

Reader: topval-v (instance)
Writer: (setf topval-v) (instance)
Package

cl-uglify-js.

Source

constants.lisp.

Target Slot

v.

Function: varlist (names)
Package

cl-uglify-js.

Source

walker.lisp.

Function: write-json-chars (quote s stream)

Write JSON representations (chars or escape sequences) of characters in string S to STREAM.

Package

cl-uglify-js.

Source

codegen.lisp.

Function: write-regexp (s stream)
Package

cl-uglify-js.

Source

codegen.lisp.


6.2.4 Generic functions

Generic Function: binary-op (op left right)
Package

cl-uglify-js.

Source

squeeze.lisp.

Methods
Method: binary-op ((op (eql :+)) (left number) (right number))
Method: binary-op ((op (eql :-)) (left number) (right number))
Method: binary-op ((op (eql :*)) (left number) (right number))
Method: binary-op ((op (eql :/)) (left number) (right number))
Method: binary-op ((op (eql :<<)) (left number) (right number))
Method: binary-op ((op (eql :>>)) (left number) (right number))
Method: binary-op ((op (eql :>>>)) (left number) (right number))
Method: binary-op ((op (eql :+)) left right)
Method: binary-op (op (left number) (right string))
Method: binary-op (op (left string) (right number))
Method: binary-op (op (left string) (right string))
Method: binary-op (op left right)

6.2.5 Structures

Structure: scope
Package

cl-uglify-js.

Source

mangle.lisp.

Direct superclasses

structure-object.

Direct slots
Slot: names
Initform

(make-hash-table :test (function equal))

Readers

scope-names.

Writers

(setf scope-names).

Slot: mangled
Initform

(make-hash-table :test (function equal))

Readers

scope-mangled.

Writers

(setf scope-mangled).

Slot: rev-mangled
Initform

(make-hash-table :test (function equal))

Readers

scope-rev-mangled.

Writers

(setf scope-rev-mangled).

Slot: cname
Initform

-1

Readers

scope-cname.

Writers

(setf scope-cname).

Slot: refs
Initform

(make-hash-table :test (function equal))

Readers

scope-refs.

Writers

(setf scope-refs).

Slot: uses-eval
Type

boolean

Readers

scope-uses-eval.

Writers

(setf scope-uses-eval).

Slot: uses-with
Type

boolean

Readers

scope-uses-with.

Writers

(setf scope-uses-with).

Slot: level
Type

integer

Initform

0

Readers

scope-level.

Writers

(setf scope-level).

Slot: parent
Type

(or null cl-uglify-js::scope)

Readers

scope-parent.

Writers

(setf scope-parent).

Slot: children
Type

list

Readers

scope-children.

Writers

(setf scope-children).

Structure: topval
Package

cl-uglify-js.

Source

constants.lisp.

Direct superclasses

structure-object.

Direct slots
Slot: v
Readers

topval-v.

Writers

(setf topval-v).


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   (  
A   B   C   E   F   G   I   M   N   Q   R   S   T   V   W  
Index Entry  Section

(
(setf scope-children): Private ordinary functions
(setf scope-cname): Private ordinary functions
(setf scope-level): Private ordinary functions
(setf scope-mangled): Private ordinary functions
(setf scope-names): Private ordinary functions
(setf scope-parent): Private ordinary functions
(setf scope-refs): Private ordinary functions
(setf scope-rev-mangled): Private ordinary functions
(setf scope-uses-eval): Private ordinary functions
(setf scope-uses-with): Private ordinary functions
(setf topval-v): Private ordinary functions

A
aborts: Private ordinary functions
ast-case: Public macros
ast-gen-code: Public ordinary functions
ast-mangle: Public ordinary functions
ast-squeeze: Public ordinary functions
ast-walk: Public macros
awhen++: Private macros

B
base54: Private ordinary functions
best-of: Private ordinary functions
binary-op: Private generic functions
binary-op: Private generic functions
binary-op: Private generic functions
binary-op: Private generic functions
binary-op: Private generic functions
binary-op: Private generic functions
binary-op: Private generic functions
binary-op: Private generic functions
binary-op: Private generic functions
binary-op: Private generic functions
binary-op: Private generic functions
binary-op: Private generic functions
binary-op: Private generic functions
boolean-expr: Private ordinary functions

C
conditional: Private ordinary functions
copy-scope: Private ordinary functions
copy-topval: Private ordinary functions
curry: Private ordinary functions

E
empty: Private ordinary functions

F
foreach-scope-parent: Private macros
Function, (setf scope-children): Private ordinary functions
Function, (setf scope-cname): Private ordinary functions
Function, (setf scope-level): Private ordinary functions
Function, (setf scope-mangled): Private ordinary functions
Function, (setf scope-names): Private ordinary functions
Function, (setf scope-parent): Private ordinary functions
Function, (setf scope-refs): Private ordinary functions
Function, (setf scope-rev-mangled): Private ordinary functions
Function, (setf scope-uses-eval): Private ordinary functions
Function, (setf scope-uses-with): Private ordinary functions
Function, (setf topval-v): Private ordinary functions
Function, aborts: Private ordinary functions
Function, ast-gen-code: Public ordinary functions
Function, ast-mangle: Public ordinary functions
Function, ast-squeeze: Public ordinary functions
Function, base54: Private ordinary functions
Function, best-of: Private ordinary functions
Function, boolean-expr: Private ordinary functions
Function, conditional: Private ordinary functions
Function, copy-scope: Private ordinary functions
Function, copy-topval: Private ordinary functions
Function, curry: Private ordinary functions
Function, empty: Private ordinary functions
Function, is-identifier: Private ordinary functions
Function, make-scope: Private ordinary functions
Function, make-topval: Private ordinary functions
Function, mymap: Private ordinary functions
Function, negate: Private ordinary functions
Function, new-scope: Private ordinary functions
Function, quote-string: Private ordinary functions
Function, rmblock: Private ordinary functions
Function, scope-children: Private ordinary functions
Function, scope-cname: Private ordinary functions
Function, scope-define: Private ordinary functions
Function, scope-get-mangled: Private ordinary functions
Function, scope-has: Private ordinary functions
Function, scope-has-mangled: Private ordinary functions
Function, scope-level: Private ordinary functions
Function, scope-mangled: Private ordinary functions
Function, scope-names: Private ordinary functions
Function, scope-next-mangled: Private ordinary functions
Function, scope-p: Private ordinary functions
Function, scope-parent: Private ordinary functions
Function, scope-refs: Private ordinary functions
Function, scope-rev-mangled: Private ordinary functions
Function, scope-uses-eval: Private ordinary functions
Function, scope-uses-with: Private ordinary functions
Function, split-code: Public ordinary functions
Function, stick: Private ordinary functions
Function, topval-p: Private ordinary functions
Function, topval-v: Private ordinary functions
Function, varlist: Private ordinary functions
Function, write-json-chars: Private ordinary functions
Function, write-regexp: Private ordinary functions

G
Generic Function, binary-op: Private generic functions

I
is-identifier: Private ordinary functions

M
Macro, ast-case: Public macros
Macro, ast-walk: Public macros
Macro, awhen++: Private macros
Macro, foreach-scope-parent: Private macros
make-scope: Private ordinary functions
make-topval: Private ordinary functions
Method, binary-op: Private generic functions
Method, binary-op: Private generic functions
Method, binary-op: Private generic functions
Method, binary-op: Private generic functions
Method, binary-op: Private generic functions
Method, binary-op: Private generic functions
Method, binary-op: Private generic functions
Method, binary-op: Private generic functions
Method, binary-op: Private generic functions
Method, binary-op: Private generic functions
Method, binary-op: Private generic functions
Method, binary-op: Private generic functions
mymap: Private ordinary functions

N
negate: Private ordinary functions
new-scope: Private ordinary functions

Q
quote-string: Private ordinary functions

R
rmblock: Private ordinary functions

S
scope-children: Private ordinary functions
scope-cname: Private ordinary functions
scope-define: Private ordinary functions
scope-get-mangled: Private ordinary functions
scope-has: Private ordinary functions
scope-has-mangled: Private ordinary functions
scope-level: Private ordinary functions
scope-mangled: Private ordinary functions
scope-names: Private ordinary functions
scope-next-mangled: Private ordinary functions
scope-p: Private ordinary functions
scope-parent: Private ordinary functions
scope-refs: Private ordinary functions
scope-rev-mangled: Private ordinary functions
scope-uses-eval: Private ordinary functions
scope-uses-with: Private ordinary functions
split-code: Public ordinary functions
stick: Private ordinary functions

T
topval-p: Private ordinary functions
topval-v: Private ordinary functions

V
varlist: Private ordinary functions

W
write-json-chars: Private ordinary functions
write-regexp: Private ordinary functions


A.3 Variables

Jump to:   *   +  
C   L   M   N   P   R   S   U   V  
Index Entry  Section

*
*codegen-beautify*: Private special variables
*codegen-indent-level*: Private special variables
*codegen-indent-start*: Private special variables
*codegen-newline*: Private special variables
*codegen-quote-keys*: Private special variables
*codegen-tl-newline*: Private special variables
*current-scope*: Private special variables
*precedence*: Private special variables

+
+json-lisp-escaped-chars+: Private special variables

C
children: Private structures
cname: Private structures

L
level: Private structures

M
mangled: Private structures

N
names: Private structures

P
parent: Private structures

R
refs: Private structures
rev-mangled: Private structures

S
Slot, children: Private structures
Slot, cname: Private structures
Slot, level: Private structures
Slot, mangled: Private structures
Slot, names: Private structures
Slot, parent: Private structures
Slot, refs: Private structures
Slot, rev-mangled: Private structures
Slot, uses-eval: Private structures
Slot, uses-with: Private structures
Slot, v: Private structures
Special Variable, *codegen-beautify*: Private special variables
Special Variable, *codegen-indent-level*: Private special variables
Special Variable, *codegen-indent-start*: Private special variables
Special Variable, *codegen-newline*: Private special variables
Special Variable, *codegen-quote-keys*: Private special variables
Special Variable, *codegen-tl-newline*: Private special variables
Special Variable, *current-scope*: Private special variables
Special Variable, *precedence*: Private special variables
Special Variable, +json-lisp-escaped-chars+: Private special variables

U
uses-eval: Private structures
uses-with: Private structures

V
v: Private structures


A.4 Data types