Commit Graph

13 Commits

Author SHA1 Message Date
Mihai Bazon
924aa58060 more optimizations that v1 does and some cleanups
- a = a + x ==> a+=x
- joining consecutive var statements (hoisting is not always desirable)
- x == false ==> x == 0, x != true ==> x != 1
- x, x ==> x; x = exp(), x ==> x = exp()
- discarding useless break-s
2012-09-14 15:36:38 +03:00
Mihai Bazon
93b973c99d added -m and -c options 2012-09-13 19:45:16 +03:00
Mihai Bazon
9a629abe00 minor 2012-09-11 18:37:08 +03:00
Mihai Bazon
8e82d8d94c fixed some mess with symbols/scope
- all symbols now have a `thedef` property which is a SymbolDef object,
  instead of the `uniq` that we had before (pointing to the first occurrence
  of the name as declaration).

- for undeclared symbols we still create a SymbolDef object in the toplevel
  scope but mark it "undeclared"

- we can now call figure_out_scope after squeezing, which is useful in order
  not to mangle names that were dropped by the squeezer
2012-09-11 15:42:28 +03:00
Mihai Bazon
da407d46c6 checkpoint
- discard statements with no side effects (unsafe? could be)
- safer hoist_vars (needs some revamping of scope/mangling)
2012-09-11 13:15:55 +03:00
Mihai Bazon
1579c0fb97 hoist_vars is pretty bad, it seems. cancelled it for now. 2012-09-10 22:40:18 +03:00
Mihai Bazon
6b9aeb5325 adaptive base54 digits depending on char frequency (WIP) 2012-09-10 22:29:18 +03:00
Mihai Bazon
16b12c6287 fix "file" in the source map 2012-09-10 15:52:53 +03:00
Mihai Bazon
0afafe64fc declared --stats as boolean 2012-09-05 18:19:24 +03:00
Mihai Bazon
e5f1cec6aa minor 2012-09-03 23:25:30 +03:00
Mihai Bazon
d6efa8b28d declare boolean options 2012-09-03 12:03:45 +03:00
Mihai Bazon
596af60587 add -b 2012-09-03 10:14:15 +03:00
Mihai Bazon
f2f370cee3 add source mappings for more node types; started CLI utility 2012-09-02 14:32:00 +03:00