Repository: mathiasbynens/luamin Branch: master Commit: 0ce5e2877cf5 Files: 23 Total size: 203.3 KB Directory structure: gitextract_kgsy9o9d/ ├── .editorconfig ├── .gitattributes ├── .gitignore ├── .npmignore ├── .travis.yml ├── Gruntfile.js ├── LICENSE-MIT.txt ├── README.md ├── bin/ │ └── luamin ├── bower.json ├── component.json ├── coverage/ │ ├── base.css │ ├── index.html │ ├── luamin/ │ │ ├── index.html │ │ └── luamin.js.html │ ├── prettify.css │ ├── prettify.js │ └── sorter.js ├── luamin.js ├── man/ │ └── luamin.1 ├── package.json └── tests/ ├── index.html └── tests.js ================================================ FILE CONTENTS ================================================ ================================================ FILE: .editorconfig ================================================ root = true [*] charset = utf-8 indent_style = tab end_of_line = lf insert_final_newline = true trim_trailing_whitespace = true ================================================ FILE: .gitattributes ================================================ # Automatically normalize line endings for all text-based files * text=auto ================================================ FILE: .gitignore ================================================ # JSON version of coverage report coverage/coverage.json # Installed npm modules node_modules # Folder view configuration files .DS_Store Desktop.ini # Thumbnail cache files ._* Thumbs.db # Files that might appear on external disks .Spotlight-V100 .Trashes ================================================ FILE: .npmignore ================================================ .* *.md coverage tests bower.json component.json Gruntfile.js ================================================ FILE: .travis.yml ================================================ language: node_js node_js: - "0.10" - "0.12" - "4" - "5" - "6" before_script: - "npm install -g grunt-cli" # Narwhal uses a hardcoded path to openjdk v6, so use that version - "sudo apt-get update -qq" - "sudo apt-get install -qq openjdk-6-jre" - "PACKAGE=rhino1.7.6; wget https://github.com/mozilla/rhino/releases/download/Rhino1_7_6_RELEASE/$PACKAGE.zip && sudo unzip $PACKAGE -d /opt/ && rm $PACKAGE.zip" - "PACKAGE=rhino1.7.6; echo -e '#!/bin/sh\\njava -jar /opt/'$PACKAGE'/js.jar $@' | sudo tee /usr/local/bin/rhino && sudo chmod +x /usr/local/bin/rhino" - "PACKAGE=ringojs-0.11; wget https://github.com/ringo/ringojs/releases/download/v0.11.0/$PACKAGE.zip && sudo unzip $PACKAGE -d /opt/ && rm $PACKAGE.zip" - "PACKAGE=ringojs-0.11; sudo ln -s /opt/$PACKAGE/bin/ringo /usr/local/bin/ringo && sudo chmod +x /usr/local/bin/ringo" - "PACKAGE=v0.3.2; wget https://github.com/280north/narwhal/archive/$PACKAGE.zip && sudo unzip $PACKAGE -d /opt/ && rm $PACKAGE.zip" - "PACKAGE=narwhal-0.3.2; sudo ln -s /opt/$PACKAGE/bin/narwhal /usr/local/bin/narwhal && sudo chmod +x /usr/local/bin/narwhal" # If the enviroment stores rt.jar in a different directory, find it and symlink the directory - "PREFIX=/usr/lib/jvm; if [ ! -d $PREFIX/java-6-openjdk ]; then for d in $PREFIX/java-6-openjdk-*; do if [ -e $d/jre/lib/rt.jar ]; then sudo ln -s $d $PREFIX/java-6-openjdk; break; fi; done; fi" script: - "grunt ci" ================================================ FILE: Gruntfile.js ================================================ module.exports = function(grunt) { grunt.initConfig({ 'shell': { 'options': { 'stdout': true, 'stderr': true, 'failOnError': true }, 'cover': { 'command': 'istanbul cover --report "html" --verbose --dir "coverage" "tests/tests.js"' }, 'test-narwhal': { 'command': 'echo "Testing in Narwhal..."; export NARWHAL_OPTIMIZATION=-1; narwhal "tests/tests.js"' }, 'test-phantomjs': { 'command': 'echo "Testing in PhantomJS..."; phantomjs "tests/tests.js"' }, 'test-rhino': { 'command': 'echo "Testing in Rhino..."; rhino -opt -1 "tests.js"', 'options': { 'execOptions': { 'cwd': 'tests' } } }, 'test-ringo': { 'command': 'echo "Testing in Ringo..."; ringo -o -1 "tests/tests.js"' }, 'test-node': { 'command': 'echo "Testing in Node..."; node "tests/tests.js"' }, 'test-browser': { 'command': 'echo "Testing in a browser..."; open "tests/index.html"' } } }); grunt.loadNpmTasks('grunt-shell'); grunt.registerTask('cover', 'shell:cover'); grunt.registerTask('ci', [ 'shell:test-narwhal', 'shell:test-phantomjs', 'shell:test-rhino', 'shell:test-ringo', 'shell:test-node', ]); grunt.registerTask('test', [ 'ci', 'shell:test-browser' ]); grunt.registerTask('default', [ 'test', 'cover' ]); }; ================================================ FILE: LICENSE-MIT.txt ================================================ Copyright Mathias Bynens Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ================================================ FILE: README.md ================================================ # luamin, a Lua minifier written in JavaScript [![Build status](https://travis-ci.org/mathiasbynens/luamin.svg?branch=master)](https://travis-ci.org/mathiasbynens/luamin) luamin uses the excellent [luaparse](https://oxyc.github.io/luaparse/) library to parse Lua code into an Abstract Syntax Tree. Based on that AST, luamin then generates a (hopefully) more compact yet semantically equivalent Lua program. [Here’s an online demo.](https://mothereff.in/lua-minifier) luamin was inspired by the [LuaMinify](https://github.com/stravant/LuaMinify) and [Esmangle](https://github.com/Constellation/esmangle) projects. Feel free to fork if you see possible improvements! ## Installation and usage Via [npm](https://www.npmjs.com/): ```bash npm install luamin ``` Via [Bower](http://bower.io/): ```bash bower install luamin ``` Via [Component](https://github.com/component/component): ```bash component install mathiasbynens/luamin ``` In a browser: ```html ``` In [Narwhal](http://narwhaljs.org/), [Node.js](https://nodejs.org/), and [RingoJS](http://ringojs.org/): ```js var luamin = require('luamin'); ``` In [Rhino](http://www.mozilla.org/rhino/): ```js load('luamin.js'); ``` Using an AMD loader like [RequireJS](http://requirejs.org/): ```js require( { 'paths': { 'luamin': 'path/to/luamin' } }, ['luamin'], function(luamin) { console.log(luamin); } ); ``` Usage example: ```js var luaCode = 'a = ((1 + 2) - 3) * (4 / (5 ^ 6)) -- foo'; luamin.minify(luaCode); // 'a=(1+2-3)*4/5^6' // `minify` also accepts luaparse-compatible ASTs as its argument: var ast = luaparse.parse(luaCode, { 'scope': true }); luamin.minify(ast); // 'a=(1+2-3)*4/5^6' ``` ### Using the `luamin` binary To use the `luamin` binary in your shell, simply install luamin globally using npm: ```bash npm install -g luamin ``` After that you will be able to minify Lua scripts from the command line: ```bash $ luamin -c 'a = ((1 + 2) - 3) * (4 / (5 ^ 6))' a=(1+2-3)*4/5^6 $ luamin -f foo.lua a=(1+2-3)*4/5^6 ``` See `luamin --help` for the full list of options. ## Support luamin has been tested in at least Chrome 25-48, Firefox 3-44, Safari 4-9, Opera 10-35, IE 6-11, Edge, Node.js v0.10.0–v5, Narwhal 0.3.2, RingoJS 0.8-0.11, PhantomJS 1.9.0, and Rhino 1.7.6. ## Unit tests & code coverage After cloning this repository, run `npm install` to install the dependencies needed for luamin development and testing. You may want to install Istanbul _globally_ using `npm install istanbul -g`. Once that’s done, you can run the unit tests in Node using `npm test` or `node tests/tests.js`. To run the tests in Rhino, Ringo, Narwhal, and web browsers as well, use `grunt test`. To generate [the code coverage report](http://rawgithub.com/mathiasbynens/luamin/master/coverage/luamin/luamin.js.html), use `grunt cover`. ## Author | [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias "Follow @mathias on Twitter") | |---| | [Mathias Bynens](https://mathiasbynens.be/) | ## License luamin is available under the [MIT](https://mths.be/mit) license. ================================================ FILE: bin/luamin ================================================ #!/usr/bin/env node (function() { var fs = require('fs'); var luamin = require('../luamin.js'); var minify = luamin.minify; var snippets = process.argv.splice(2); var option = snippets.shift(); var isFile = false; var isAST = false; var stdin = process.stdin; var data; var log = console.log; var main = function() { if (/^(?:-h|--help|undefined)$/.test(option)) { log('luamin v%s - https://mths.be/luamin', luamin.version); log([ '\nUsage:\n', '\tluamin [-c | --code] [snippet ...]', '\tluamin [-f | --file] [file ...]', '\tluamin [-a | --ast] [AST ...]', '\tluamin [-v | --version]', '\tluamin [-h | --help]', '\nExamples:\n', '\tluamin -c \'a = ((1 + 2) - 3) * (4 / (5 ^ 6))\'', '\tluamin -f foo.lua', '\techo \'a = "foo" .. "bar"\' | luamin -c', '\tluaparse --scope \'a = 42\' | luamin -a' ].join('\n')); return process.exit(1); } if (/^(?:-v|--version)$/.test(option)) { log('v%s', luamin.version); return process.exit(1); } if (/^(?:-f|--file)$/.test(option)) { isFile = true; } else if (/^(?:-a|--ast)$/.test(option)) { isAST = true; } else if (!/^(?:-c|--code)$/.test(option)) { log('Unrecognized option `%s`.', option); log('Try `luamin --help` for more information.'); return process.exit(1); } if (!snippets.length) { log('Error: option `%s` requires an argument.', option); log('Try `luamin --help` for more information.'); return process.exit(1); } snippets.forEach(function(snippet) { var result; if (isFile) { try { snippet = fs.readFileSync(snippet, 'utf8'); } catch(error) { log('Error: no such file. (`%s`)', snippet); return process.exit(1); } } try { if (isAST) { snippet = JSON.parse(snippet); } result = minify(snippet); log(result); } catch(error) { log(error.message + '\n'); if (isAST) { log('Error: failed to minify. Make sure the AST contains a ' + '`globals` property and is'); log('fully compatible with luaparse.'); } else { // it’s a snippet or an AST log('Error: failed to minify. Make sure the Lua code is valid.'); } log('If you think this is a bug in luamin, please report it:'); log('https://github.com/mathiasbynens/luamin/issues/new'); log( '\nStack trace using luamin@%s and luaparse@%s:\n', luamin.version, require('luaparse').version ); log(error.stack); return process.exit(1); } }); // Return with exit status 0 outside of the `forEach` loop, in case // multiple snippets or files were passed in. return process.exit(0); }; if (stdin.isTTY) { // handle shell arguments main(); } else { // handle pipe data = ''; stdin.on('data', function(chunk) { data += chunk; }); stdin.on('end', function() { if (data.trim().length != 0) { snippets.unshift(data.trim()); } main(); }); stdin.resume(); } }()); ================================================ FILE: bower.json ================================================ { "name": "luamin", "version": "1.0.4", "main": "luamin.js", "dependencies": { "luaparse": "~0.2.1" }, "ignore": [ "bin", "coverage", "man", "tests", ".*", "component.json", "Gruntfile.js", "node_modules", "package.json" ] } ================================================ FILE: component.json ================================================ { "name": "luamin", "version": "1.0.4", "description": "A Lua minifier written in JavaScript", "repo": "mathiasbynens/luamin", "license": "MIT/GPL", "scripts": [ "luamin.js" ], "dependencies": { "oxyc/luaparse": "0.2.1" }, "keywords": [ "lua", "minify", "minifier" ] } ================================================ FILE: coverage/base.css ================================================ body, html { margin:0; padding: 0; height: 100%; } body { font-family: Helvetica Neue, Helvetica, Arial; font-size: 14px; color:#333; } .small { font-size: 12px;; } *, *:after, *:before { -webkit-box-sizing:border-box; -moz-box-sizing:border-box; box-sizing:border-box; } h1 { font-size: 20px; margin: 0;} h2 { font-size: 14px; } pre { font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace; margin: 0; padding: 0; -moz-tab-size: 2; -o-tab-size: 2; tab-size: 2; } a { color:#0074D9; text-decoration:none; } a:hover { text-decoration:underline; } .strong { font-weight: bold; } .space-top1 { padding: 10px 0 0 0; } .pad2y { padding: 20px 0; } .pad1y { padding: 10px 0; } .pad2x { padding: 0 20px; } .pad2 { padding: 20px; } .pad1 { padding: 10px; } .space-left2 { padding-left:55px; } .space-right2 { padding-right:20px; } .center { text-align:center; } .clearfix { display:block; } .clearfix:after { content:''; display:block; height:0; clear:both; visibility:hidden; } .fl { float: left; } @media only screen and (max-width:640px) { .col3 { width:100%; max-width:100%; } .hide-mobile { display:none!important; } } .quiet { color: #7f7f7f; color: rgba(0,0,0,0.5); } .quiet a { opacity: 0.7; } .fraction { font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace; font-size: 10px; color: #555; background: #E8E8E8; padding: 4px 5px; border-radius: 3px; vertical-align: middle; } div.path a:link, div.path a:visited { color: #333; } table.coverage { border-collapse: collapse; margin: 10px 0 0 0; padding: 0; } table.coverage td { margin: 0; padding: 0; vertical-align: top; } table.coverage td.line-count { text-align: right; padding: 0 5px 0 20px; } table.coverage td.line-coverage { text-align: right; padding-right: 10px; min-width:20px; } table.coverage td span.cline-any { display: inline-block; padding: 0 5px; width: 100%; } .missing-if-branch { display: inline-block; margin-right: 5px; border-radius: 3px; position: relative; padding: 0 4px; background: #333; color: yellow; } .skip-if-branch { display: none; margin-right: 10px; position: relative; padding: 0 4px; background: #ccc; color: white; } .missing-if-branch .typ, .skip-if-branch .typ { color: inherit !important; } .coverage-summary { border-collapse: collapse; width: 100%; } .coverage-summary tr { border-bottom: 1px solid #bbb; } .keyline-all { border: 1px solid #ddd; } .coverage-summary td, .coverage-summary th { padding: 10px; } .coverage-summary tbody { border: 1px solid #bbb; } .coverage-summary td { border-right: 1px solid #bbb; } .coverage-summary td:last-child { border-right: none; } .coverage-summary th { text-align: left; font-weight: normal; white-space: nowrap; } .coverage-summary th.file { border-right: none !important; } .coverage-summary th.pct { } .coverage-summary th.pic, .coverage-summary th.abs, .coverage-summary td.pct, .coverage-summary td.abs { text-align: right; } .coverage-summary td.file { white-space: nowrap; } .coverage-summary td.pic { min-width: 120px !important; } .coverage-summary tfoot td { } .coverage-summary .sorter { height: 10px; width: 7px; display: inline-block; margin-left: 0.5em; background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent; } .coverage-summary .sorted .sorter { background-position: 0 -20px; } .coverage-summary .sorted-desc .sorter { background-position: 0 -10px; } .status-line { height: 10px; } /* dark red */ .red.solid, .status-line.low, .low .cover-fill { background:#C21F39 } .low .chart { border:1px solid #C21F39 } /* medium red */ .cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE } /* light red */ .low, .cline-no { background:#FCE1E5 } /* light green */ .high, .cline-yes { background:rgb(230,245,208) } /* medium green */ .cstat-yes { background:rgb(161,215,106) } /* dark green */ .status-line.high, .high .cover-fill { background:rgb(77,146,33) } .high .chart { border:1px solid rgb(77,146,33) } .medium .chart { border:1px solid #666; } .medium .cover-fill { background: #666; } .cbranch-no { background: yellow !important; color: #111; } .cstat-skip { background: #ddd; color: #111; } .fstat-skip { background: #ddd; color: #111 !important; } .cbranch-skip { background: #ddd !important; color: #111; } span.cline-neutral { background: #eaeaea; } .medium { background: #eaeaea; } .cover-fill, .cover-empty { display:inline-block; height: 12px; } .chart { line-height: 0; } .cover-empty { background: white; } .cover-full { border-right: none !important; } pre.prettyprint { border: none !important; padding: 0 !important; margin: 0 !important; } .com { color: #999 !important; } .ignore-none { color: #999; font-weight: normal; } .wrapper { min-height: 100%; height: auto !important; height: 100%; margin: 0 auto -48px; } .footer, .push { height: 48px; } ================================================ FILE: coverage/index.html ================================================ Code coverage report for All files

/

97.35% Statements 294/302
89.61% Branches 207/231
96.43% Functions 27/28
97.35% Lines 294/302
File Statements Branches Functions Lines
luamin/
97.35% 294/302 89.61% 207/231 96.43% 27/28 97.35% 294/302
================================================ FILE: coverage/luamin/index.html ================================================ Code coverage report for luamin/

all files luamin/

97.35% Statements 294/302
89.61% Branches 207/231
96.43% Functions 27/28
97.35% Lines 294/302
File Statements Branches Functions Lines
luamin.js
97.35% 294/302 89.61% 207/231 96.43% 27/28 97.35% 294/302
================================================ FILE: coverage/luamin/luamin.js.html ================================================ Code coverage report for luamin/luamin.js

all files / luamin/ luamin.js

97.35% Statements 294/302
89.61% Branches 207/231
96.43% Functions 27/28
97.35% Lines 294/302
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664                                                                1646× 1646× 1646× 1646× 4926×       7127× 7127× 7127× 125949× 3606×         1528× 1528× 511× 1671× 1255×       1528×     3539× 3539× 3539× 3485×   54× 53×               3537×   3338×                         197×       3559×     3558× 19×   3539× 3539× 3539× 3539× 3539× 3592× 3592× 3592× 3537×   3537×       17×   3520× 3520×   55×             1332×   1332× 1332×   1332× 530×   802× 361×     334×       27×     441× 180×             111×       69×     261×     257×     125× 125× 125×   125× 125×   125×       1528×         1528× 1528× 1528× 1528×   1528×   1528×   533×       995×               451×   544×               186× 186× 186×   186×         186× 186×           186× 37×     186×                                       15×     358×   44× 44×   44×             44×                             314×   74× 74× 11× 11×     74×   240×   18×     222×   21×     201×   42×     159×   83×         76×   15× 15×   11×     11×       15× 15× 15×   61×   60×   60× 44×   40× 28×   12×         44× 19×       60×             1527×     539× 539× 500×   537×     500× 500×   500×     212× 218× 217×         211× 211× 215× 215×       288×   63×     63×   3458× 3458× 3395×         63× 13× 13× 18× 18×         225×   63×   162×   17×       17× 17×       17×       17×   145×   11× 11× 11× 11×   134×   30× 30×   104×   18×   18× 12× 12×       86×   15×   71×   10× 10× 10×   61×   31× 31× 31×   31× 16×   28×     28× 12×         31× 31× 31×   30×     13×   13×   17× 17×       13×   13× 15× 15×       13× 13× 13×   17×     12× 12×     12×     12× 12× 12×                         498×         393×         393× 393×   393×     393× 392× 371× 371× 371×         392×                                                    
/*! https://mths.be/luamin v1.0.0 by @mathias */
;(function(root) {
 
	// Detect free variables `exports`
	var freeExports = typeof exports == 'object' && exports;
 
	// Detect free variable `module`
	var freeModule = typeof module == 'object' && module &&
		module.exports == freeExports && module;
 
	// Detect free variable `global`, from Node.js or Browserified code,
	// and use it as `root`
	var freeGlobal = typeof global == 'object' && global;
	Eif (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) {
		root = freeGlobal;
	}
 
	/*--------------------------------------------------------------------------*/
 
	var luaparse = root.luaparse || require('luaparse');
	luaparse.defaultOptions.comments = false;
	luaparse.defaultOptions.scope = true;
	var parse = luaparse.parse;
 
	var regexAlphaUnderscore = /[a-zA-Z_]/;
	var regexAlphaNumUnderscore = /[a-zA-Z0-9_]/;
	var regexDigits = /[0-9]/;
 
	// http://www.lua.org/manual/5.2/manual.html#3.4.7
	// http://www.lua.org/source/5.2/lparser.c.html#priority
	var PRECEDENCE = {
		'or': 1,
		'and': 2,
		'<': 3, '>': 3, '<=': 3, '>=': 3, '~=': 3, '==': 3,
		'..': 5,
		'+': 6, '-': 6, // binary -
		'*': 7, '/': 7, '%': 7,
		'unarynot': 8, 'unary#': 8, 'unary-': 8, // unary -
		'^': 10
	};
 
	var IDENTIFIER_PARTS = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a',
		'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p',
		'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E',
		'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T',
		'U', 'V', 'W', 'X', 'Y', 'Z', '_'];
	var IDENTIFIER_PARTS_MAX = IDENTIFIER_PARTS.length - 1;
 
	var each = function(array, fn) {
		var index = -1;
		var length = array.length;
		var max = length - 1;
		while (++index < length) {
			fn(array[index], index < max);
		}
	};
 
	var indexOf = function(array, value) {
		var index = -1;
		var length = array.length;
		while (++index < length) {
			if (array[index] == value) {
				return index;
			}
		}
	};
 
	var hasOwnProperty = {}.hasOwnProperty;
	var extend = function(destination, source) {
		var key;
		if (source) {
			for (key in source) {
				if (hasOwnProperty.call(source, key)) {
					destination[key] = source[key];
				}
			}
		}
		return destination;
	};
 
	var generateZeroes = function(length) {
		var zero = '0';
		var result = '';
		if (length < 1) {
			return result;
		}
		if (length == 1) {
			return zero;
		}
		while (length) {
			if (length & 1) {
				result += zero;
			}
			if (length >>= 1) {
				zero += zero;
			}
		}
		return result;
	};
 
	// http://www.lua.org/manual/5.2/manual.html#3.1
	function isKeyword(id) {
		switch (id.length) {
			case 2:
				return 'do' == id || 'if' == id || 'in' == id || 'or' == id;
			case 3:
				return 'and' == id || 'end' == id || 'for' == id || 'nil' == id ||
					'not' == id;
			case 4:
				return 'else' == id || 'goto' == id || 'then' == id || 'true' == id;
			case 5:
				return 'break' == id || 'false' == id || 'local' == id ||
					'until' == id || 'while' == id;
			case 6:
				return 'elseif' == id || 'repeat' == id || 'return' == id;
			case 8:
				return 'function' == id;
		}
		return false;
	}
 
	var currentIdentifier;
	var identifierMap;
	var identifiersInUse;
	var generateIdentifier = function(originalName) {
		// Preserve `self` in methods
		if (originalName == 'self') {
			return originalName;
		}
 
		if (hasOwnProperty.call(identifierMap, originalName)) {
			return identifierMap[originalName];
		}
		var length = currentIdentifier.length;
		var position = length - 1;
		var character;
		var index;
		while (position >= 0) {
			character = currentIdentifier.charAt(position);
			index = indexOf(IDENTIFIER_PARTS, character);
			if (index != IDENTIFIER_PARTS_MAX) {
				currentIdentifier = currentIdentifier.substring(0, position) +
					IDENTIFIER_PARTS[index + 1] + generateZeroes(length - (position + 1));
				if (
					isKeyword(currentIdentifier) ||
					indexOf(identifiersInUse, currentIdentifier) > -1
				) {
					return generateIdentifier(originalName);
				}
				identifierMap[originalName] = currentIdentifier;
				return currentIdentifier;
			}
			--position;
		}
		currentIdentifier = 'a' + generateZeroes(length);
		if (indexOf(identifiersInUse, currentIdentifier) > -1) {
			return generateIdentifier(originalName);
		}
		identifierMap[originalName] = currentIdentifier;
		return currentIdentifier;
	};
 
	/*--------------------------------------------------------------------------*/
 
	var joinStatements = function(a, b, separator) {
		separator || (separator = ' ');
 
		var lastCharA = a.slice(-1);
		var firstCharB = b.charAt(0);
 
		if (lastCharA == '' || firstCharB == '') {
			return a + b;
		}
		if (regexAlphaUnderscore.test(lastCharA)) {
			if (regexAlphaNumUnderscore.test(firstCharB)) {
				// e.g. `while` + `1`
				// e.g. `local a` + `local b`
				return a + separator + b;
			} else {
				// e.g. `not` + `(2>3 or 3<2)`
				// e.g. `x` + `^`
				return a + b;
			}
		}
		if (regexDigits.test(lastCharA)) {
			if (
				firstCharB == '(' ||
				!(firstCharB == '.' ||
				regexAlphaUnderscore.test(firstCharB))
			) {
				// e.g. `1` + `+`
				// e.g. `1` + `==`
				return a + b;
			} else {
				// e.g. `1` + `..`
				// e.g. `1` + `and`
				return a + separator + b;
			}
		}
		if (lastCharA == firstCharB && lastCharA == '-') {
			// e.g. `1-` + `-2`
			return a + separator + b;
		}
		return a + b;
	};
 
	var formatBase = function(base) {
		var result = '';
		var needsParens = base.type == 'TableConstructorExpression';
		if (needsParens) {
			result += '(';
		}
		result += formatExpression(base);
		if (needsParens) {
			result += ')';
		}
		return result;
	};
 
	var formatExpression = function(expression, options) {
 
		options = extend({
			'precedence': 0,
			'preserveIdentifiers': false
		}, options);
 
		var result = '';
		var currentPrecedence;
		var associativity;
		var operator;
 
		var expressionType = expression.type;
 
		if (expressionType == 'Identifier') {
 
			result = expression.isLocal && !options.preserveIdentifiers
				? generateIdentifier(expression.name)
				: expression.name;
 
		} else if (
			expressionType == 'StringLiteral' ||
			expressionType == 'NumericLiteral' ||
			expressionType == 'BooleanLiteral' ||
			expressionType == 'NilLiteral' ||
			expressionType == 'VarargLiteral'
		) {
 
			result = expression.raw;
 
		} else if (
			expressionType == 'LogicalExpression' ||
			expressionType == 'BinaryExpression'
		) {
 
			// If an expression with precedence x
			// contains an expression with precedence < x,
			// the inner expression must be wrapped in parens.
			operator = expression.operator;
			currentPrecedence = PRECEDENCE[operator];
			associativity = 'left';
 
			result = formatExpression(expression.left, {
				'precedence': currentPrecedence,
				'direction': 'left',
				'parent': operator
			});
			result = joinStatements(result, operator);
			result = joinStatements(result, formatExpression(expression.right, {
				'precedence': currentPrecedence,
				'direction': 'right',
				'parent': operator
			}));
 
			if (operator == '^' || operator == '..') {
				associativity = "right";
			}
 
			if (
				currentPrecedence < options.precedence ||
				(
					currentPrecedence == options.precedence &&
					associativity != options.direction &&
					options.parent != '+' &&
					!(options.parent == '*' && (operator == '/' || operator == '*'))
				)
			) {
				// The most simple case here is that of
				// protecting the parentheses on the RHS of
				// `1 - (2 - 3)` but deleting them from `(1 - 2) - 3`.
				// This is generally the right thing to do. The
				// semantics of `+` are special however: `1 + (2 - 3)`
				// == `1 + 2 - 3`. `-` and `+` are the only two operators
				// who share their precedence level. `*` also can
				// commute in such a way with `/`, but not with `%`
				// (all three share a precedence). So we test for
				// all of these conditions and avoid emitting
				// parentheses in the cases where we don’t have to.
				result = '(' + result + ')';
			}
 
		} else if (expressionType == 'UnaryExpression') {
 
			operator = expression.operator;
			currentPrecedence = PRECEDENCE['unary' + operator];
 
			result = joinStatements(
				operator,
				formatExpression(expression.argument, {
					'precedence': currentPrecedence
				})
			);
 
			if (
				currentPrecedence < options.precedence &&
				// In principle, we should parenthesize the RHS of an
				// expression like `3^-2`, because `^` has higher precedence
				// than unary `-` according to the manual. But that is
				// misleading on the RHS of `^`, since the parser will
				// always try to find a unary operator regardless of
				// precedence.
				!(
					(options.parent == '^') &&
					options.direction == 'right'
				)
			) {
				result = '(' + result + ')';
			}
 
		} else if (expressionType == 'CallExpression') {
 
			result = formatExpression(expression.base) + '(';
			each(expression.arguments, function(argument, needsComma) {
				result += formatExpression(argument);
				if (needsComma) {
					result += ',';
				}
			});
			result += ')';
 
		} else if (expressionType == 'TableCallExpression') {
 
			result = formatExpression(expression.base) +
				formatExpression(expression.arguments);
 
		} else if (expressionType == 'StringCallExpression') {
 
			result = formatExpression(expression.base) +
				formatExpression(expression.argument);
 
		} else if (expressionType == 'IndexExpression') {
 
			result = formatBase(expression.base) + '[' +
				formatExpression(expression.index) + ']';
 
		} else if (expressionType == 'MemberExpression') {
 
			result = formatBase(expression.base) + expression.indexer +
				formatExpression(expression.identifier, {
					'preserveIdentifiers': true
				});
 
		} else if (expressionType == 'FunctionDeclaration') {
 
			result = 'function(';
			if (expression.parameters.length) {
				each(expression.parameters, function(parameter, needsComma) {
					// `Identifier`s have a `name`, `VarargLiteral`s have a `value`
					result += parameter.name
						? generateIdentifier(parameter.name)
						: parameter.value;
					if (needsComma) {
						result += ',';
					}
				});
			}
			result += ')';
			result = joinStatements(result, formatStatementList(expression.body));
			result = joinStatements(result, 'end');
 
		} else if (expressionType == 'TableConstructorExpression') {
 
			result = '{';
 
			each(expression.fields, function(field, needsComma) {
				if (field.type == 'TableKey') {
					result += '[' + formatExpression(field.key) + ']=' +
						formatExpression(field.value);
				} else if (field.type == 'TableValue') {
					result += formatExpression(field.value);
				} else { // at this point, `field.type == 'TableKeyString'`
					result += formatExpression(field.key, {
						// TODO: keep track of nested scopes (#18)
						'preserveIdentifiers': true
					}) + '=' + formatExpression(field.value);
				}
				if (needsComma) {
					result += ',';
				}
			});
 
			result += '}';
 
		} else {
 
			throw TypeError('Unknown expression type: `' + expressionType + '`');
 
		}
 
		return result;
	};
 
	var formatStatementList = function(body) {
		var result = '';
		each(body, function(statement) {
			result = joinStatements(result, formatStatement(statement), ';');
		});
		return result;
	};
 
	var formatStatement = function(statement) {
		var result = '';
		var statementType = statement.type;
 
		if (statementType == 'AssignmentStatement') {
 
			// left-hand side
			each(statement.variables, function(variable, needsComma) {
				result += formatExpression(variable);
				if (needsComma) {
					result += ',';
				}
			});
 
			// right-hand side
			result += '=';
			each(statement.init, function(init, needsComma) {
				result += formatExpression(init);
				if (needsComma) {
					result += ',';
				}
			});
 
		} else if (statementType == 'LocalStatement') {
 
			result = 'local ';
 
			// left-hand side
			each(statement.variables, function(variable, needsComma) {
				// Variables in a `LocalStatement` are always local, duh
				result += generateIdentifier(variable.name);
				if (needsComma) {
					result += ',';
				}
			});
 
			// right-hand side
			if (statement.init.length) {
				result += '=';
				each(statement.init, function(init, needsComma) {
					result += formatExpression(init);
					if (needsComma) {
						result += ',';
					}
				});
			}
 
		} else if (statementType == 'CallStatement') {
 
			result = formatExpression(statement.expression);
 
		} else if (statementType == 'IfStatement') {
 
			result = joinStatements(
				'if',
				formatExpression(statement.clauses[0].condition)
			);
			result = joinStatements(result, 'then');
			result = joinStatements(
				result,
				formatStatementList(statement.clauses[0].body)
			);
			each(statement.clauses.slice(1), function(clause) {
				if (clause.condition) {
					result = joinStatements(result, 'elseif');
					result = joinStatements(result, formatExpression(clause.condition));
					result = joinStatements(result, 'then');
				} else {
					result = joinStatements(result, 'else');
				}
				result = joinStatements(result, formatStatementList(clause.body));
			});
			result = joinStatements(result, 'end');
 
		} else if (statementType == 'WhileStatement') {
 
			result = joinStatements('while', formatExpression(statement.condition));
			result = joinStatements(result, 'do');
			result = joinStatements(result, formatStatementList(statement.body));
			result = joinStatements(result, 'end');
 
		} else if (statementType == 'DoStatement') {
 
			result = joinStatements('do', formatStatementList(statement.body));
			result = joinStatements(result, 'end');
 
		} else if (statementType == 'ReturnStatement') {
 
			result = 'return';
 
			each(statement.arguments, function(argument, needsComma) {
				result = joinStatements(result, formatExpression(argument));
				if (needsComma) {
					result += ',';
				}
			});
 
		} else if (statementType == 'BreakStatement') {
 
			result = 'break';
 
		} else if (statementType == 'RepeatStatement') {
 
			result = joinStatements('repeat', formatStatementList(statement.body));
			result = joinStatements(result, 'until');
			result = joinStatements(result, formatExpression(statement.condition))
 
		} else if (statementType == 'FunctionDeclaration') {
 
			result = (statement.isLocal ? 'local ' : '') + 'function ';
			result += formatExpression(statement.identifier);
			result += '(';
 
			if (statement.parameters.length) {
				each(statement.parameters, function(parameter, needsComma) {
					// `Identifier`s have a `name`, `VarargLiteral`s have a `value`
					result += parameter.name
						? generateIdentifier(parameter.name)
						: parameter.value;
					if (needsComma) {
						result += ',';
					}
				});
			}
 
			result += ')';
			result = joinStatements(result, formatStatementList(statement.body));
			result = joinStatements(result, 'end');
 
		} else if (statementType == 'ForGenericStatement') {
			// see also `ForNumericStatement`
 
			result = 'for ';
 
			each(statement.variables, function(variable, needsComma) {
				// The variables in a `ForGenericStatement` are always local
				result += generateIdentifier(variable.name);
				if (needsComma) {
					result += ',';
				}
			});
 
			result += ' in';
 
			each(statement.iterators, function(iterator, needsComma) {
				result = joinStatements(result, formatExpression(iterator));
				if (needsComma) {
					result += ',';
				}
			});
 
			result = joinStatements(result, 'do');
			result = joinStatements(result, formatStatementList(statement.body));
			result = joinStatements(result, 'end');
 
		} else if (statementType == 'ForNumericStatement') {
 
			// The variables in a `ForNumericStatement` are always local
			result = 'for ' + generateIdentifier(statement.variable.name) + '=';
			result += formatExpression(statement.start) + ',' +
				formatExpression(statement.end);
 
			if (statement.step) {
				result += ',' + formatExpression(statement.step);
			}
 
			result = joinStatements(result, 'do');
			result = joinStatements(result, formatStatementList(statement.body));
			result = joinStatements(result, 'end');
 
		} else if (statementType == 'LabelStatement') {
 
			// The identifier names in a `LabelStatement` can safely be renamed
			result = '::' + generateIdentifier(statement.label.name) + '::';
 
		} else if (statementType == 'GotoStatement') {
 
			// The identifier names in a `GotoStatement` can safely be renamed
			result = 'goto ' + generateIdentifier(statement.label.name);
 
		} else {
 
			throw TypeError('Unknown statement type: `' + statementType + '`');
 
		}
 
		return result;
	};
 
	var minify = function(argument) {
		// `argument` can be a Lua code snippet (string)
		// or a luaparse-compatible AST (object)
		var ast = typeof argument == 'string'
			? parse(argument)
			: argument;
 
		// (Re)set temporary identifier values
		identifierMap = {};
		identifiersInUse = [];
		// This is a shortcut to help generate the first identifier (`a`) faster
		currentIdentifier = '9';
 
		// Make sure global variable names aren't renamed
		if (ast.globals) {
			each(ast.globals, function(object) {
				var name = object.name;
				identifierMap[name] = name;
				identifiersInUse.push(name);
			});
		} else {
			throw Error('Missing required AST property: `globals`');
		}
 
		return formatStatementList(ast.body);
	};
 
	/*--------------------------------------------------------------------------*/
 
	var luamin = {
		'version': '1.0.0',
		'minify': minify
	};
 
	// Some AMD build optimizers, like r.js, check for specific condition patterns
	// like the following:
	Iif (
		typeof define == 'function' &&
		typeof define.amd == 'object' &&
		define.amd
	) {
		define(function() {
			return luamin;
		});
	}	else Eif (freeExports && !freeExports.nodeType) {
		Eif (freeModule) { // in Node.js or RingoJS v0.8.0+
			freeModule.exports = luamin;
		} else { // in Narwhal or RingoJS v0.7.0-
			extend(freeExports, luamin);
		}
	} else { // in Rhino or a web browser
		root.luamin = luamin;
	}
 
}(this));
 
================================================ FILE: coverage/prettify.css ================================================ .pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} ================================================ FILE: coverage/prettify.js ================================================ window.PR_SHOULD_USE_CONTINUATION=true;(function(){var h=["break,continue,do,else,for,if,return,while"];var u=[h,"auto,case,char,const,default,double,enum,extern,float,goto,int,long,register,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"];var p=[u,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"];var l=[p,"alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,dynamic_cast,explicit,export,friend,inline,late_check,mutable,namespace,nullptr,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"];var x=[p,"abstract,boolean,byte,extends,final,finally,implements,import,instanceof,null,native,package,strictfp,super,synchronized,throws,transient"];var R=[x,"as,base,by,checked,decimal,delegate,descending,dynamic,event,fixed,foreach,from,group,implicit,in,interface,internal,into,is,lock,object,out,override,orderby,params,partial,readonly,ref,sbyte,sealed,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,var"];var r="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,true,try,unless,until,when,while,yes";var w=[p,"debugger,eval,export,function,get,null,set,undefined,var,with,Infinity,NaN"];var s="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END";var I=[h,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"];var f=[h,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"];var H=[h,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"];var A=[l,R,w,s+I,f,H];var e=/^(DIR|FILE|vector|(de|priority_)?queue|list|stack|(const_)?iterator|(multi)?(set|map)|bitset|u?(int|float)\d*)/;var C="str";var z="kwd";var j="com";var O="typ";var G="lit";var L="pun";var F="pln";var m="tag";var E="dec";var J="src";var P="atn";var n="atv";var N="nocode";var M="(?:^^\\.?|[+-]|\\!|\\!=|\\!==|\\#|\\%|\\%=|&|&&|&&=|&=|\\(|\\*|\\*=|\\+=|\\,|\\-=|\\->|\\/|\\/=|:|::|\\;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\@|\\[|\\^|\\^=|\\^\\^|\\^\\^=|\\{|\\||\\|=|\\|\\||\\|\\|=|\\~|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function k(Z){var ad=0;var S=false;var ac=false;for(var V=0,U=Z.length;V122)){if(!(al<65||ag>90)){af.push([Math.max(65,ag)|32,Math.min(al,90)|32])}if(!(al<97||ag>122)){af.push([Math.max(97,ag)&~32,Math.min(al,122)&~32])}}}}af.sort(function(av,au){return(av[0]-au[0])||(au[1]-av[1])});var ai=[];var ap=[NaN,NaN];for(var ar=0;arat[0]){if(at[1]+1>at[0]){an.push("-")}an.push(T(at[1]))}}an.push("]");return an.join("")}function W(al){var aj=al.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g"));var ah=aj.length;var an=[];for(var ak=0,am=0;ak=2&&ai==="["){aj[ak]=X(ag)}else{if(ai!=="\\"){aj[ak]=ag.replace(/[a-zA-Z]/g,function(ao){var ap=ao.charCodeAt(0);return"["+String.fromCharCode(ap&~32,ap|32)+"]"})}}}}return aj.join("")}var aa=[];for(var V=0,U=Z.length;V=0;){S[ac.charAt(ae)]=Y}}var af=Y[1];var aa=""+af;if(!ag.hasOwnProperty(aa)){ah.push(af);ag[aa]=null}}ah.push(/[\0-\uffff]/);V=k(ah)})();var X=T.length;var W=function(ah){var Z=ah.sourceCode,Y=ah.basePos;var ad=[Y,F];var af=0;var an=Z.match(V)||[];var aj={};for(var ae=0,aq=an.length;ae=5&&"lang-"===ap.substring(0,5);if(am&&!(ai&&typeof ai[1]==="string")){am=false;ap=J}if(!am){aj[ag]=ap}}var ab=af;af+=ag.length;if(!am){ad.push(Y+ab,ap)}else{var al=ai[1];var ak=ag.indexOf(al);var ac=ak+al.length;if(ai[2]){ac=ag.length-ai[2].length;ak=ac-al.length}var ar=ap.substring(5);B(Y+ab,ag.substring(0,ak),W,ad);B(Y+ab+ak,al,q(ar,al),ad);B(Y+ab+ac,ag.substring(ac),W,ad)}}ah.decorations=ad};return W}function i(T){var W=[],S=[];if(T.tripleQuotedStrings){W.push([C,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,"'\""])}else{if(T.multiLineStrings){W.push([C,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"])}else{W.push([C,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,"\"'"])}}if(T.verbatimStrings){S.push([C,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null])}var Y=T.hashComments;if(Y){if(T.cStyleComments){if(Y>1){W.push([j,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"])}else{W.push([j,/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"])}S.push([C,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null])}else{W.push([j,/^#[^\r\n]*/,null,"#"])}}if(T.cStyleComments){S.push([j,/^\/\/[^\r\n]*/,null]);S.push([j,/^\/\*[\s\S]*?(?:\*\/|$)/,null])}if(T.regexLiterals){var X=("/(?=[^/*])(?:[^/\\x5B\\x5C]|\\x5C[\\s\\S]|\\x5B(?:[^\\x5C\\x5D]|\\x5C[\\s\\S])*(?:\\x5D|$))+/");S.push(["lang-regex",new RegExp("^"+M+"("+X+")")])}var V=T.types;if(V){S.push([O,V])}var U=(""+T.keywords).replace(/^ | $/g,"");if(U.length){S.push([z,new RegExp("^(?:"+U.replace(/[\s,]+/g,"|")+")\\b"),null])}W.push([F,/^\s+/,null," \r\n\t\xA0"]);S.push([G,/^@[a-z_$][a-z_$@0-9]*/i,null],[O,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[F,/^[a-z_$][a-z_$@0-9]*/i,null],[G,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[F,/^\\[\s\S]?/,null],[L,/^.[^\s\w\.$@\'\"\`\/\#\\]*/,null]);return g(W,S)}var K=i({keywords:A,hashComments:true,cStyleComments:true,multiLineStrings:true,regexLiterals:true});function Q(V,ag){var U=/(?:^|\s)nocode(?:\s|$)/;var ab=/\r\n?|\n/;var ac=V.ownerDocument;var S;if(V.currentStyle){S=V.currentStyle.whiteSpace}else{if(window.getComputedStyle){S=ac.defaultView.getComputedStyle(V,null).getPropertyValue("white-space")}}var Z=S&&"pre"===S.substring(0,3);var af=ac.createElement("LI");while(V.firstChild){af.appendChild(V.firstChild)}var W=[af];function ae(al){switch(al.nodeType){case 1:if(U.test(al.className)){break}if("BR"===al.nodeName){ad(al);if(al.parentNode){al.parentNode.removeChild(al)}}else{for(var an=al.firstChild;an;an=an.nextSibling){ae(an)}}break;case 3:case 4:if(Z){var am=al.nodeValue;var aj=am.match(ab);if(aj){var ai=am.substring(0,aj.index);al.nodeValue=ai;var ah=am.substring(aj.index+aj[0].length);if(ah){var ak=al.parentNode;ak.insertBefore(ac.createTextNode(ah),al.nextSibling)}ad(al);if(!ai){al.parentNode.removeChild(al)}}}break}}function ad(ak){while(!ak.nextSibling){ak=ak.parentNode;if(!ak){return}}function ai(al,ar){var aq=ar?al.cloneNode(false):al;var ao=al.parentNode;if(ao){var ap=ai(ao,1);var an=al.nextSibling;ap.appendChild(aq);for(var am=an;am;am=an){an=am.nextSibling;ap.appendChild(am)}}return aq}var ah=ai(ak.nextSibling,0);for(var aj;(aj=ah.parentNode)&&aj.nodeType===1;){ah=aj}W.push(ah)}for(var Y=0;Y=S){ah+=2}if(V>=ap){Z+=2}}}var t={};function c(U,V){for(var S=V.length;--S>=0;){var T=V[S];if(!t.hasOwnProperty(T)){t[T]=U}else{if(window.console){console.warn("cannot override language handler %s",T)}}}}function q(T,S){if(!(T&&t.hasOwnProperty(T))){T=/^\s*]*(?:>|$)/],[j,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[L,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]);c(g([[F,/^[\s]+/,null," \t\r\n"],[n,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,"\"'"]],[[m,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[P,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[L,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]);c(g([],[[n,/^[\s\S]+/]]),["uq.val"]);c(i({keywords:l,hashComments:true,cStyleComments:true,types:e}),["c","cc","cpp","cxx","cyc","m"]);c(i({keywords:"null,true,false"}),["json"]);c(i({keywords:R,hashComments:true,cStyleComments:true,verbatimStrings:true,types:e}),["cs"]);c(i({keywords:x,cStyleComments:true}),["java"]);c(i({keywords:H,hashComments:true,multiLineStrings:true}),["bsh","csh","sh"]);c(i({keywords:I,hashComments:true,multiLineStrings:true,tripleQuotedStrings:true}),["cv","py"]);c(i({keywords:s,hashComments:true,multiLineStrings:true,regexLiterals:true}),["perl","pl","pm"]);c(i({keywords:f,hashComments:true,multiLineStrings:true,regexLiterals:true}),["rb"]);c(i({keywords:w,cStyleComments:true,regexLiterals:true}),["js"]);c(i({keywords:r,hashComments:3,cStyleComments:true,multilineStrings:true,tripleQuotedStrings:true,regexLiterals:true}),["coffee"]);c(g([],[[C,/^[\s\S]+/]]),["regex"]);function d(V){var U=V.langExtension;try{var S=a(V.sourceNode);var T=S.sourceCode;V.sourceCode=T;V.spans=S.spans;V.basePos=0;q(U,T)(V);D(V)}catch(W){if("console" in window){console.log(W&&W.stack?W.stack:W)}}}function y(W,V,U){var S=document.createElement("PRE");S.innerHTML=W;if(U){Q(S,U)}var T={langExtension:V,numberLines:U,sourceNode:S};d(T);return S.innerHTML}function b(ad){function Y(af){return document.getElementsByTagName(af)}var ac=[Y("pre"),Y("code"),Y("xmp")];var T=[];for(var aa=0;aa=0){var ah=ai.match(ab);var am;if(!ah&&(am=o(aj))&&"CODE"===am.tagName){ah=am.className.match(ab)}if(ah){ah=ah[1]}var al=false;for(var ak=aj.parentNode;ak;ak=ak.parentNode){if((ak.tagName==="pre"||ak.tagName==="code"||ak.tagName==="xmp")&&ak.className&&ak.className.indexOf("prettyprint")>=0){al=true;break}}if(!al){var af=aj.className.match(/\blinenums\b(?::(\d+))?/);af=af?af[1]&&af[1].length?+af[1]:true:false;if(af){Q(aj,af)}S={langExtension:ah,sourceNode:aj,numberLines:af};d(S)}}}if(X]*(?:>|$)/],[PR.PR_COMMENT,/^<\!--[\s\S]*?(?:-\->|$)/],[PR.PR_PUNCTUATION,/^(?:<[%?]|[%?]>)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-handlebars",/^]*type\s*=\s*['"]?text\/x-handlebars-template['"]?\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-js",/^]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i],[PR.PR_DECLARATION,/^{{[#^>/]?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{&?\s*[\w.][^}]*}}/],[PR.PR_DECLARATION,/^{{{>?\s*[\w.][^}]*}}}/],[PR.PR_COMMENT,/^{{![^}]*}}/]]),["handlebars","hbs"]);PR.registerLangHandler(PR.createSimpleLexer([[PR.PR_PLAIN,/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[[PR.PR_STRING,/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],[PR.PR_STRING,/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']*)\)/i],[PR.PR_KEYWORD,/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],[PR.PR_COMMENT,/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],[PR.PR_COMMENT,/^(?:)/],[PR.PR_LITERAL,/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],[PR.PR_LITERAL,/^#(?:[0-9a-f]{3}){1,2}/i],[PR.PR_PLAIN,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],[PR.PR_PUNCTUATION,/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_KEYWORD,/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[[PR.PR_STRING,/^[^\)\"\']+/]]),["css-str"]); ================================================ FILE: coverage/sorter.js ================================================ var addSorting = (function () { "use strict"; var cols, currentSort = { index: 0, desc: false }; // returns the summary table element function getTable() { return document.querySelector('.coverage-summary'); } // returns the thead element of the summary table function getTableHeader() { return getTable().querySelector('thead tr'); } // returns the tbody element of the summary table function getTableBody() { return getTable().querySelector('tbody'); } // returns the th element for nth column function getNthColumn(n) { return getTableHeader().querySelectorAll('th')[n]; } // loads all columns function loadColumns() { var colNodes = getTableHeader().querySelectorAll('th'), colNode, cols = [], col, i; for (i = 0; i < colNodes.length; i += 1) { colNode = colNodes[i]; col = { key: colNode.getAttribute('data-col'), sortable: !colNode.getAttribute('data-nosort'), type: colNode.getAttribute('data-type') || 'string' }; cols.push(col); if (col.sortable) { col.defaultDescSort = col.type === 'number'; colNode.innerHTML = colNode.innerHTML + ''; } } return cols; } // attaches a data attribute to every tr element with an object // of data values keyed by column name function loadRowData(tableRow) { var tableCols = tableRow.querySelectorAll('td'), colNode, col, data = {}, i, val; for (i = 0; i < tableCols.length; i += 1) { colNode = tableCols[i]; col = cols[i]; val = colNode.getAttribute('data-value'); if (col.type === 'number') { val = Number(val); } data[col.key] = val; } return data; } // loads all row data function loadData() { var rows = getTableBody().querySelectorAll('tr'), i; for (i = 0; i < rows.length; i += 1) { rows[i].data = loadRowData(rows[i]); } } // sorts the table using the data for the ith column function sortByIndex(index, desc) { var key = cols[index].key, sorter = function (a, b) { a = a.data[key]; b = b.data[key]; return a < b ? -1 : a > b ? 1 : 0; }, finalSorter = sorter, tableBody = document.querySelector('.coverage-summary tbody'), rowNodes = tableBody.querySelectorAll('tr'), rows = [], i; if (desc) { finalSorter = function (a, b) { return -1 * sorter(a, b); }; } for (i = 0; i < rowNodes.length; i += 1) { rows.push(rowNodes[i]); tableBody.removeChild(rowNodes[i]); } rows.sort(finalSorter); for (i = 0; i < rows.length; i += 1) { tableBody.appendChild(rows[i]); } } // removes sort indicators for current column being sorted function removeSortIndicators() { var col = getNthColumn(currentSort.index), cls = col.className; cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, ''); col.className = cls; } // adds sort indicators for current column being sorted function addSortIndicators() { getNthColumn(currentSort.index).className += currentSort.desc ? ' sorted-desc' : ' sorted'; } // adds event listeners for all sorter widgets function enableUI() { var i, el, ithSorter = function ithSorter(i) { var col = cols[i]; return function () { var desc = col.defaultDescSort; if (currentSort.index === i) { desc = !currentSort.desc; } sortByIndex(i, desc); removeSortIndicators(); currentSort.index = i; currentSort.desc = desc; addSortIndicators(); }; }; for (i =0 ; i < cols.length; i += 1) { if (cols[i].sortable) { // add the click event handler on the th so users // dont have to click on those tiny arrows el = getNthColumn(i).querySelector('.sorter').parentElement; if (el.addEventListener) { el.addEventListener('click', ithSorter(i)); } else { el.attachEvent('onclick', ithSorter(i)); } } } } // adds sorting functionality to the UI return function () { if (!getTable()) { return; } cols = loadColumns(); loadData(cols); addSortIndicators(); enableUI(); }; })(); window.addEventListener('load', addSorting); ================================================ FILE: luamin.js ================================================ /*! https://mths.be/luamin v1.0.4 by @mathias */ ;(function(root) { // Detect free variables `exports` var freeExports = typeof exports == 'object' && exports; // Detect free variable `module` var freeModule = typeof module == 'object' && module && module.exports == freeExports && module; // Detect free variable `global`, from Node.js or Browserified code, // and use it as `root` var freeGlobal = typeof global == 'object' && global; if (freeGlobal.global === freeGlobal || freeGlobal.window === freeGlobal) { root = freeGlobal; } /*--------------------------------------------------------------------------*/ var luaparse = root.luaparse || require('luaparse'); luaparse.defaultOptions.comments = false; luaparse.defaultOptions.scope = true; var parse = luaparse.parse; var regexAlphaUnderscore = /[a-zA-Z_]/; var regexAlphaNumUnderscore = /[a-zA-Z0-9_]/; var regexDigits = /[0-9]/; // http://www.lua.org/manual/5.2/manual.html#3.4.7 // http://www.lua.org/source/5.2/lparser.c.html#priority var PRECEDENCE = { 'or': 1, 'and': 2, '<': 3, '>': 3, '<=': 3, '>=': 3, '~=': 3, '==': 3, '..': 5, '+': 6, '-': 6, // binary - '*': 7, '/': 7, '%': 7, 'unarynot': 8, 'unary#': 8, 'unary-': 8, // unary - '^': 10 }; var IDENTIFIER_PARTS = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', '_']; var IDENTIFIER_PARTS_MAX = IDENTIFIER_PARTS.length - 1; var each = function(array, fn) { var index = -1; var length = array.length; var max = length - 1; while (++index < length) { fn(array[index], index < max); } }; var indexOf = function(array, value) { var index = -1; var length = array.length; while (++index < length) { if (array[index] == value) { return index; } } }; var hasOwnProperty = {}.hasOwnProperty; var extend = function(destination, source) { var key; if (source) { for (key in source) { if (hasOwnProperty.call(source, key)) { destination[key] = source[key]; } } } return destination; }; var generateZeroes = function(length) { var zero = '0'; var result = ''; if (length < 1) { return result; } if (length == 1) { return zero; } while (length) { if (length & 1) { result += zero; } if (length >>= 1) { zero += zero; } } return result; }; // http://www.lua.org/manual/5.2/manual.html#3.1 function isKeyword(id) { switch (id.length) { case 2: return 'do' == id || 'if' == id || 'in' == id || 'or' == id; case 3: return 'and' == id || 'end' == id || 'for' == id || 'nil' == id || 'not' == id; case 4: return 'else' == id || 'goto' == id || 'then' == id || 'true' == id; case 5: return 'break' == id || 'false' == id || 'local' == id || 'until' == id || 'while' == id; case 6: return 'elseif' == id || 'repeat' == id || 'return' == id; case 8: return 'function' == id; } return false; } var currentIdentifier; var identifierMap; var identifiersInUse; var generateIdentifier = function(originalName) { // Preserve `self` in methods if (originalName == 'self') { return originalName; } if (hasOwnProperty.call(identifierMap, originalName)) { return identifierMap[originalName]; } var length = currentIdentifier.length; var position = length - 1; var character; var index; while (position >= 0) { character = currentIdentifier.charAt(position); index = indexOf(IDENTIFIER_PARTS, character); if (index != IDENTIFIER_PARTS_MAX) { currentIdentifier = currentIdentifier.substring(0, position) + IDENTIFIER_PARTS[index + 1] + generateZeroes(length - (position + 1)); if ( isKeyword(currentIdentifier) || indexOf(identifiersInUse, currentIdentifier) > -1 ) { return generateIdentifier(originalName); } identifierMap[originalName] = currentIdentifier; return currentIdentifier; } --position; } currentIdentifier = 'a' + generateZeroes(length); if (indexOf(identifiersInUse, currentIdentifier) > -1) { return generateIdentifier(originalName); } identifierMap[originalName] = currentIdentifier; return currentIdentifier; }; /*--------------------------------------------------------------------------*/ var joinStatements = function(a, b, separator) { separator || (separator = ' '); var lastCharA = a.slice(-1); var firstCharB = b.charAt(0); if (lastCharA == '' || firstCharB == '') { return a + b; } if (regexAlphaUnderscore.test(lastCharA)) { if (regexAlphaNumUnderscore.test(firstCharB)) { // e.g. `while` + `1` // e.g. `local a` + `local b` return a + separator + b; } else { // e.g. `not` + `(2>3 or 3<2)` // e.g. `x` + `^` return a + b; } } if (regexDigits.test(lastCharA)) { if ( firstCharB == '(' || !(firstCharB == '.' || regexAlphaUnderscore.test(firstCharB)) ) { // e.g. `1` + `+` // e.g. `1` + `==` return a + b; } else { // e.g. `1` + `..` // e.g. `1` + `and` return a + separator + b; } } if (lastCharA == firstCharB && lastCharA == '-') { // e.g. `1-` + `-2` return a + separator + b; } var secondLastCharA = a.slice(-2, -1); if (lastCharA == '.' && secondLastCharA != '.' && regexAlphaNumUnderscore.test(firstCharB)) { // e.g. `1.` + `print` return a + separator + b; } return a + b; }; var formatBase = function(base) { var result = ''; var type = base.type; var needsParens = base.inParens && ( type == 'CallExpression' || type == 'BinaryExpression' || type == 'FunctionDeclaration' || type == 'TableConstructorExpression' || type == 'LogicalExpression' || type == 'StringLiteral' ); if (needsParens) { result += '('; } result += formatExpression(base); if (needsParens) { result += ')'; } return result; }; var formatExpression = function(expression, options) { options = extend({ 'precedence': 0, 'preserveIdentifiers': false }, options); var result = ''; var currentPrecedence; var associativity; var operator; var expressionType = expression.type; if (expressionType == 'Identifier') { result = expression.isLocal && !options.preserveIdentifiers ? generateIdentifier(expression.name) : expression.name; } else if ( expressionType == 'StringLiteral' || expressionType == 'NumericLiteral' || expressionType == 'BooleanLiteral' || expressionType == 'NilLiteral' || expressionType == 'VarargLiteral' ) { result = expression.raw; } else if ( expressionType == 'LogicalExpression' || expressionType == 'BinaryExpression' ) { // If an expression with precedence x // contains an expression with precedence < x, // the inner expression must be wrapped in parens. operator = expression.operator; currentPrecedence = PRECEDENCE[operator]; associativity = 'left'; result = formatExpression(expression.left, { 'precedence': currentPrecedence, 'direction': 'left', 'parent': operator }); result = joinStatements(result, operator); result = joinStatements(result, formatExpression(expression.right, { 'precedence': currentPrecedence, 'direction': 'right', 'parent': operator })); if (operator == '^' || operator == '..') { associativity = "right"; } if ( currentPrecedence < options.precedence || ( currentPrecedence == options.precedence && associativity != options.direction && options.parent != '+' && !(options.parent == '*' && (operator == '/' || operator == '*')) ) ) { // The most simple case here is that of // protecting the parentheses on the RHS of // `1 - (2 - 3)` but deleting them from `(1 - 2) - 3`. // This is generally the right thing to do. The // semantics of `+` are special however: `1 + (2 - 3)` // == `1 + 2 - 3`. `-` and `+` are the only two operators // who share their precedence level. `*` also can // commute in such a way with `/`, but not with `%` // (all three share a precedence). So we test for // all of these conditions and avoid emitting // parentheses in the cases where we don’t have to. result = '(' + result + ')'; } } else if (expressionType == 'UnaryExpression') { operator = expression.operator; currentPrecedence = PRECEDENCE['unary' + operator]; result = joinStatements( operator, formatExpression(expression.argument, { 'precedence': currentPrecedence }) ); if ( currentPrecedence < options.precedence && // In principle, we should parenthesize the RHS of an // expression like `3^-2`, because `^` has higher precedence // than unary `-` according to the manual. But that is // misleading on the RHS of `^`, since the parser will // always try to find a unary operator regardless of // precedence. !( (options.parent == '^') && options.direction == 'right' ) ) { result = '(' + result + ')'; } } else if (expressionType == 'CallExpression') { result = formatBase(expression.base) + '('; each(expression.arguments, function(argument, needsComma) { result += formatExpression(argument); if (needsComma) { result += ','; } }); result += ')'; } else if (expressionType == 'TableCallExpression') { result = formatExpression(expression.base) + formatExpression(expression.arguments); } else if (expressionType == 'StringCallExpression') { result = formatExpression(expression.base) + formatExpression(expression.argument); } else if (expressionType == 'IndexExpression') { result = formatBase(expression.base) + '[' + formatExpression(expression.index) + ']'; } else if (expressionType == 'MemberExpression') { result = formatBase(expression.base) + expression.indexer + formatExpression(expression.identifier, { 'preserveIdentifiers': true }); } else if (expressionType == 'FunctionDeclaration') { result = 'function('; if (expression.parameters.length) { each(expression.parameters, function(parameter, needsComma) { // `Identifier`s have a `name`, `VarargLiteral`s have a `value` result += parameter.name ? generateIdentifier(parameter.name) : parameter.value; if (needsComma) { result += ','; } }); } result += ')'; result = joinStatements(result, formatStatementList(expression.body)); result = joinStatements(result, 'end'); } else if (expressionType == 'TableConstructorExpression') { result = '{'; each(expression.fields, function(field, needsComma) { if (field.type == 'TableKey') { result += '[' + formatExpression(field.key) + ']=' + formatExpression(field.value); } else if (field.type == 'TableValue') { result += formatExpression(field.value); } else { // at this point, `field.type == 'TableKeyString'` result += formatExpression(field.key, { // TODO: keep track of nested scopes (#18) 'preserveIdentifiers': true }) + '=' + formatExpression(field.value); } if (needsComma) { result += ','; } }); result += '}'; } else { throw TypeError('Unknown expression type: `' + expressionType + '`'); } return result; }; var formatStatementList = function(body) { var result = ''; each(body, function(statement) { result = joinStatements(result, formatStatement(statement), ';'); }); return result; }; var formatStatement = function(statement) { var result = ''; var statementType = statement.type; if (statementType == 'AssignmentStatement') { // left-hand side each(statement.variables, function(variable, needsComma) { result += formatExpression(variable); if (needsComma) { result += ','; } }); // right-hand side result += '='; each(statement.init, function(init, needsComma) { result += formatExpression(init); if (needsComma) { result += ','; } }); } else if (statementType == 'LocalStatement') { result = 'local '; // left-hand side each(statement.variables, function(variable, needsComma) { // Variables in a `LocalStatement` are always local, duh result += generateIdentifier(variable.name); if (needsComma) { result += ','; } }); // right-hand side if (statement.init.length) { result += '='; each(statement.init, function(init, needsComma) { result += formatExpression(init); if (needsComma) { result += ','; } }); } } else if (statementType == 'CallStatement') { result = formatExpression(statement.expression); } else if (statementType == 'IfStatement') { result = joinStatements( 'if', formatExpression(statement.clauses[0].condition) ); result = joinStatements(result, 'then'); result = joinStatements( result, formatStatementList(statement.clauses[0].body) ); each(statement.clauses.slice(1), function(clause) { if (clause.condition) { result = joinStatements(result, 'elseif'); result = joinStatements(result, formatExpression(clause.condition)); result = joinStatements(result, 'then'); } else { result = joinStatements(result, 'else'); } result = joinStatements(result, formatStatementList(clause.body)); }); result = joinStatements(result, 'end'); } else if (statementType == 'WhileStatement') { result = joinStatements('while', formatExpression(statement.condition)); result = joinStatements(result, 'do'); result = joinStatements(result, formatStatementList(statement.body)); result = joinStatements(result, 'end'); } else if (statementType == 'DoStatement') { result = joinStatements('do', formatStatementList(statement.body)); result = joinStatements(result, 'end'); } else if (statementType == 'ReturnStatement') { result = 'return'; each(statement.arguments, function(argument, needsComma) { result = joinStatements(result, formatExpression(argument)); if (needsComma) { result += ','; } }); } else if (statementType == 'BreakStatement') { result = 'break'; } else if (statementType == 'RepeatStatement') { result = joinStatements('repeat', formatStatementList(statement.body)); result = joinStatements(result, 'until'); result = joinStatements(result, formatExpression(statement.condition)) } else if (statementType == 'FunctionDeclaration') { result = (statement.isLocal ? 'local ' : '') + 'function '; result += formatExpression(statement.identifier); result += '('; if (statement.parameters.length) { each(statement.parameters, function(parameter, needsComma) { // `Identifier`s have a `name`, `VarargLiteral`s have a `value` result += parameter.name ? generateIdentifier(parameter.name) : parameter.value; if (needsComma) { result += ','; } }); } result += ')'; result = joinStatements(result, formatStatementList(statement.body)); result = joinStatements(result, 'end'); } else if (statementType == 'ForGenericStatement') { // see also `ForNumericStatement` result = 'for '; each(statement.variables, function(variable, needsComma) { // The variables in a `ForGenericStatement` are always local result += generateIdentifier(variable.name); if (needsComma) { result += ','; } }); result += ' in'; each(statement.iterators, function(iterator, needsComma) { result = joinStatements(result, formatExpression(iterator)); if (needsComma) { result += ','; } }); result = joinStatements(result, 'do'); result = joinStatements(result, formatStatementList(statement.body)); result = joinStatements(result, 'end'); } else if (statementType == 'ForNumericStatement') { // The variables in a `ForNumericStatement` are always local result = 'for ' + generateIdentifier(statement.variable.name) + '='; result += formatExpression(statement.start) + ',' + formatExpression(statement.end); if (statement.step) { result += ',' + formatExpression(statement.step); } result = joinStatements(result, 'do'); result = joinStatements(result, formatStatementList(statement.body)); result = joinStatements(result, 'end'); } else if (statementType == 'LabelStatement') { // The identifier names in a `LabelStatement` can safely be renamed result = '::' + generateIdentifier(statement.label.name) + '::'; } else if (statementType == 'GotoStatement') { // The identifier names in a `GotoStatement` can safely be renamed result = 'goto ' + generateIdentifier(statement.label.name); } else { throw TypeError('Unknown statement type: `' + statementType + '`'); } return result; }; var minify = function(argument) { // `argument` can be a Lua code snippet (string) // or a luaparse-compatible AST (object) var ast = typeof argument == 'string' ? parse(argument) : argument; // (Re)set temporary identifier values identifierMap = {}; identifiersInUse = []; // This is a shortcut to help generate the first identifier (`a`) faster currentIdentifier = '9'; // Make sure global variable names aren't renamed if (ast.globals) { each(ast.globals, function(object) { var name = object.name; identifierMap[name] = name; identifiersInUse.push(name); }); } else { throw Error('Missing required AST property: `globals`'); } return formatStatementList(ast.body); }; /*--------------------------------------------------------------------------*/ var luamin = { 'version': '1.0.4', 'minify': minify }; // Some AMD build optimizers, like r.js, check for specific condition patterns // like the following: if ( typeof define == 'function' && typeof define.amd == 'object' && define.amd ) { define(function() { return luamin; }); } else if (freeExports && !freeExports.nodeType) { if (freeModule) { // in Node.js or RingoJS v0.8.0+ freeModule.exports = luamin; } else { // in Narwhal or RingoJS v0.7.0- extend(freeExports, luamin); } } else { // in Rhino or a web browser root.luamin = luamin; } }(this)); ================================================ FILE: man/luamin.1 ================================================ .Dd April 19, 2013 .Dt luamin 1 .Sh NAME .Nm luamin .Nd minify Lua code .Sh SYNOPSIS .Nm .Op Fl c | -code Ar snippet .br .Op Fl f | -file Ar file .br .Op Fl a | -ast Ar ast .br .Op Fl v | -version .br .Op Fl h | -help .Sh DESCRIPTION .Nm is a Lua minifier written in JavaScript. It can compress Lua code snippets, or even Abstract Syntax Trees that represent Lua programs. .Sh OPTIONS .Bl -ohang -offset .It Sy "-v, --version" Print luamin's version. .It Sy "-h, --help" Show the help screen. .It Sy "-c, --code " Print minified version of the given Lua snippet. .It Sy "-f, --file " Print minified version of the given Lua file. .It Sy "-a, --ast " Print minified version of the given Lua AST. The AST must be compatible with .Xr luaparse 1 and must contain a .Va globals property. Such ASTs can be generated using .Xr luaparse 1 by enabling the .Va scope option. .El .Sh EXIT STATUS The .Nm luamin utility exits with one of the following values: .Pp .Bl -tag -width flag -compact .It Li 0 .Nm successfully minified the Lua code and printed the result. .It Li 1 .Nm wasn't instructed to minify any code (for example, the .Ar --help flag was set); or, an error occurred. .El .Sh EXAMPLES .Bl -ohang -offset .It Sy "luamin -c 'a = ((1 + 2) - 3) * (4 / (5 ^ 6))'" Print a minified version of the given Lua code snippet. .It Sy "luamin -f foo.lua" Read the Lua code in the file .Ar foo.lua and print a minified version. .It Sy echo\ 'a\ =\ "foo"\ ..\ "bar"'\ |\ luamin\ -c Print a minified version of the Lua snippet that gets piped in. .It Sy "luaparse --scope 'a = 42' | luamin -a" Print a minified version of the Lua code that corresponds to the given Abstract Syntax Tree that gets piped in. .El .Sh SEE ALSO .Xr luaparse 1 .Sh BUGS luamin's bug tracker is located at . .Sh AUTHOR Mathias Bynens .Sh WWW ================================================ FILE: package.json ================================================ { "name": "luamin", "version": "1.0.4", "description": "A Lua minifier written in JavaScript", "homepage": "https://mths.be/luamin", "main": "luamin.js", "bin": "bin/luamin", "keywords": [ "lua", "minify", "minifier" ], "license": "MIT", "author": { "name": "Mathias Bynens", "url": "https://mathiasbynens.be/" }, "repository": { "type": "git", "url": "https://github.com/mathiasbynens/luamin.git" }, "bugs": "https://github.com/mathiasbynens/luamin/issues", "files": [ "LICENSE-MIT.txt", "luamin.js", "bin/", "man/" ], "directories": { "bin": "bin", "man": "man", "test": "tests" }, "scripts": { "test": "node tests/tests.js" }, "dependencies": { "luaparse": "^0.2.1" }, "devDependencies": { "grunt": "^0.4.4", "grunt-shell": "^1.1.2", "istanbul": "^0.4.2", "qunit-extras": "^1.4.5", "qunitjs": "~1.11.0", "requirejs": "^2.1.22" } } ================================================ FILE: tests/index.html ================================================ luamin test suite
================================================ FILE: tests/tests.js ================================================ (function(root) { 'use strict'; var noop = Function.prototype; var load = (typeof require == 'function' && !(root.define && define.amd)) ? require : (!root.document && root.java && root.load) || noop; var QUnit = (function() { return root.QUnit || ( root.addEventListener || (root.addEventListener = noop), root.setTimeout || (root.setTimeout = noop), root.QUnit = load('../node_modules/qunitjs/qunit/qunit.js') || root.QUnit, addEventListener === noop && delete root.addEventListener, root.QUnit ); }()); var qe = load('../node_modules/qunit-extras/qunit-extras.js'); if (qe) { qe.runInContext(root); } /** The `luaparse` utility function */ var luaparse = root.luaparse || (root.luaparse = ( luaparse = load('../node_modules/luaparse/luaparse.js') || root.luaparse, luaparse = luaparse.luaparse || luaparse )); /** The `luamin` function to test */ var luamin = root.luamin || (root.luamin = ( luamin = load('../luamin.js') || root.luamin, luamin = luamin.luamin || luamin )); var minify = luamin.minify; /*--------------------------------------------------------------------------*/ var data = { // Assignments 'Assignments': [ { 'description': 'AssignmentStatement', 'original': 'a = 1, 2, 3', 'minified': 'a=1,2,3' }, { 'description': 'AssignmentStatement', 'original': 'a, b, c = 1', 'minified': 'a,b,c=1' }, { 'description': 'AssignmentStatement', 'original': 'a, b, c = 1, 2, 3', 'minified': 'a,b,c=1,2,3' }, { 'description': 'AssignmentStatement + MemberExpression', 'original': 'a.b = 1', 'minified': 'a.b=1' }, { 'description': 'AssignmentStatement + MemberExpression', 'original': 'a.b.c = 1', 'minified': 'a.b.c=1' }, { 'description': 'AssignmentStatement + IndexExpression', 'original': 'a[b] = 1', 'minified': 'a[b]=1' }, { 'description': 'AssignmentStatement + IndexExpression', 'original': 'a[b][c] = 1', 'minified': 'a[b][c]=1' }, { 'description': 'AssignmentStatement + MemberExpression + IndexExpression', 'original': 'a.b[c] = 1', 'minified': 'a.b[c]=1' }, { 'description': 'AssignmentStatement + IndexExpression + MemberExpression', 'original': 'a[b].c = 1', 'minified': 'a[b].c=1' }, { 'description': 'AssignmentStatement + IndexExpression', 'original': 'a[b], a[c] = 1', 'minified': 'a[b],a[c]=1' } ], // Comments 'Comments': [ { 'description': 'Comment', 'original': '-- comment', 'minified': '' }, { 'description': 'Comment', 'original': '-- comment\n-- comment', 'minified': '' }, { 'description': 'Comment', 'original': '--comment', 'minified': '' }, { 'description': 'Comment + line break + BreakStatement', 'original': '-- comment\nbreak', 'minified': 'break' }, { 'description': 'BreakStatement + Comment', 'original': 'break-- comment', 'minified': 'break' }, { 'description': 'Comment', 'original': '--[[comment]]--', 'minified': '' }, { 'description': 'Comment + BreakStatement', 'original': '--[[comment]]--\nbreak', 'minified': 'break' }, { 'description': 'Comment + BreakStatement', 'original': '--[=[comment]=]--\nbreak', 'minified': 'break' }, { 'description': 'Comment + BreakStatement', 'original': '--[===[comment\n--[=[sub]=]--\n]===]--\nbreak', 'minified': 'break' }, { 'description': 'Multi-line Comment', 'original': '--[[comment\nline two]]--', 'minified': '' }, { 'description': 'Multi-line Comment', 'original': '--[[\ncomment\nline two\n]]--', 'minified': '' }, { 'description': 'Comment + BreakStatement', 'original': '--[==\nbreak --]]--', 'minified': 'break' }, { 'description': 'IfStatement + Comment', 'original': 'if true -- comment\nthen end', 'minified': 'if true then end' } ], // Conditionals 'Conditionals': [ { 'description': 'IfStatement', 'original': 'if 1 then end', 'minified': 'if 1 then end' }, { 'description': 'IfStatement + LocalStatement', 'original': 'if 1 then local foo end', 'minified': 'if 1 then local a end' }, { 'description': 'IfStatement + LocalStatement', 'original': 'if 1 then local foo local bar end', 'minified': 'if 1 then local a;local b end' }, { 'description': 'IfStatement + LocalStatement', 'original': 'if 1 then local foo; local bar; end', 'minified': 'if 1 then local a;local b end' }, { 'description': 'IfStatement + ElseClause', 'original': 'if 1 then else end', 'minified': 'if 1 then else end' }, { 'description': 'IfStatement', 'original': 'if 1 then end', 'minified': 'if 1 then end' }, { 'description': 'IfStatement + ElseClause + LocalStatement', 'original': 'if 1 then local foo else local bar end', 'minified': 'if 1 then local a else local b end' }, { 'description': 'IfStatement + ElseClause + LocalStatement', 'original': 'if 1 then local foo; else local bar; end', 'minified': 'if 1 then local a else local b end' }, { 'description': 'IfStatement + ElseifClause + LocalStatement', 'original': 'if 1 then local foo elseif 2 then local bar end', 'minified': 'if 1 then local a elseif 2 then local b end' }, { 'description': 'IfStatement + ElseifClause + LocalStatement', 'original': 'if 1 then local foo; elseif 2 then local bar; end', 'minified': 'if 1 then local a elseif 2 then local b end' }, { 'description': 'IfStatement + ElseifClause', 'original': 'if 1 then elseif 2 then else end', 'minified': 'if 1 then elseif 2 then else end' }, { 'description': 'Nested IfStatement', 'original': 'if 1 then else if 2 then end end', 'minified': 'if 1 then else if 2 then end end' }, { 'description': 'IfStatement + ReturnStatement', 'original': 'if 1 then return end', 'minified': 'if 1 then return end' }, { 'description': 'IfStatement + IfStatement', 'original': 'if 1 then end; if 1 then end;', 'minified': 'if 1 then end;if 1 then end' } ], // DoStatement 'DoStatement': [ { 'description': 'DoStatement + LocalStatement', 'original': 'do local foo local bar end', 'minified': 'do local a;local b end' }, { 'description': 'DoStatement + LocalStatement', 'original': 'do local foo; local bar; end', 'minified': 'do local a;local b end' }, { 'description': 'DoStatement + LocalStatement', 'original': 'do local foo = 1 end', 'minified': 'do local a=1 end' }, { 'description': 'DoStatement + DoStatement', 'original': 'do do end end', 'minified': 'do do end end' }, { 'description': 'DoStatement + DoStatement', 'original': 'do do end; end', 'minified': 'do do end end' }, { 'description': 'DoStatement + DoStatement + DoStatement', 'original': 'do do do end end end', 'minified': 'do do do end end end' }, { 'description': 'DoStatement + DoStatement + DoStatement', 'original': 'do do do end; end; end', 'minified': 'do do do end end end' }, { 'description': 'DoStatement + DoStatement + DoStatement + ReturnStatement', 'original': 'do do do return end end end', 'minified': 'do do do return end end end' } ], // Expressions 'Expressions': [ { 'description': 'AssignmentStatement', 'original': 'a = {}', 'minified': 'a={}' }, { 'description': 'AssignmentStatement', 'original': 'a = (a)', 'minified': 'a=a' }, { 'description': 'AssignmentStatement', 'original': 'a = (nil)', 'minified': 'a=nil' }, { 'description': 'AssignmentStatement', 'original': 'a = (true)', 'minified': 'a=true' }, { 'description': 'AssignmentStatement', 'original': 'a = (1)', 'minified': 'a=1' }, { 'description': 'AssignmentStatement', 'original': 'a = ("foo")', 'minified': 'a="foo"' }, { 'description': 'AssignmentStatement', 'original': 'a = (\'foo\')', 'minified': 'a=\'foo\'' }, { 'description': 'AssignmentStatement', 'original': 'a = ([[foo]])', 'minified': 'a=[[foo]]' }, { 'description': 'AssignmentStatement + TableConstructorExpression', 'original': 'a = ({})', 'minified': 'a={}' }, { 'description': 'AssignmentStatement + MemberExpression', 'original': 'a = a.foo', 'minified': 'a=a.foo' }, { 'description': 'AssignmentStatement + IndexExpression', 'original': 'a = a[1]', 'minified': 'a=a[1]' }, { 'description': 'AssignmentStatement + IndexExpression', 'original': 'a = a["foo"]', 'minified': 'a=a["foo"]' }, { 'description': 'AssignmentStatement + IndexExpression', 'original': 'a = a[\'foo\']', 'minified': 'a=a[\'foo\']' }, { 'description': 'AssignmentStatement + IndexExpression + IndexExpression', 'original': 'a = a[b][c]', 'minified': 'a=a[b][c]' }, { 'description': 'AssignmentStatement + MemberExpression + IndexExpression', 'original': 'a = a.foo[c]', 'minified': 'a=a.foo[c]' }, { 'description': 'AssignmentStatement + IndexExpression + MemberExpression', 'original': 'a = a[b].c', 'minified': 'a=a[b].c' }, { 'description': 'AssignmentStatement + IndexExpression', 'original': 'a = (a)[b]', 'minified': 'a=a[b]' }, { 'description': 'AssignmentStatement + MemberExpression', 'original': 'a = (a).foo', 'minified': 'a=a.foo' }, { 'description': 'AssignmentStatement + MemberExpression + CallExpression', 'original': 'a = a.foo()', 'minified': 'a=a.foo()' }, { 'description': 'AssignmentStatement + IndexExpression + CallExpression', 'original': 'a = a[b]()', 'minified': 'a=a[b]()' }, { 'description': 'AssignmentStatement + MemberExpression + CallExpression', 'original': 'a = a:foo()', 'minified': 'a=a:foo()' }, { 'description': 'AssignmentStatement + CallExpression', 'original': 'a = (a)()', 'minified': 'a=a()' }, { 'description': 'AssignmentStatement + MemberExpression + CallExpression', 'original': 'a = (a).b()', 'minified': 'a=a.b()' }, { 'description': 'AssignmentStatement + IndexExpression + CallExpression', 'original': 'a = (a)[b]()', 'minified': 'a=a[b]()' }, { 'description': 'CallStatement + IndexExpression + BinaryExpression', 'original': 'print(("a".."b")[0])', 'minified': 'print(("a".."b")[0])' }, { 'description': 'AssignmentStatement + MemberExpression + CallExpression', 'original': 'a = (a):b()', 'minified': 'a=a:b()' }, { 'description': 'AssignmentStatement + StringCallExpression', 'original': 'a = a"foo"', 'minified': 'a=a"foo"' }, { 'description': 'AssignmentStatement + StringCallExpression', 'original': 'a = a"fo\\\"o"', 'minified': 'a=a"fo\\\"o"' }, { 'description': 'AssignmentStatement + StringCallExpression', 'original': 'a = a\'foo\'', 'minified': 'a=a\'foo\'' }, { 'description': 'AssignmentStatement + TableCallExpression', 'original': 'a = a{}', 'minified': 'a=a{}' }, { 'description': 'AssignmentStatement + FunctionDeclaration', 'original': 'a = function() end', 'minified': 'a=function()end' }, { 'description': 'AssignmentStatement + FunctionDeclaration', 'original': 'a = function(p) end', 'minified': 'a=function(b)end' }, { 'description': 'AssignmentStatement + FunctionDeclaration', 'original': 'a = function(p,q,r) end', 'minified': 'a=function(b,c,d)end' }, { 'description': 'AssignmentStatement + FunctionDeclaration', 'original': 'a = function(...) end', 'minified': 'a=function(...)end' }, { 'description': 'AssignmentStatement + FunctionDeclaration', 'original': 'a = function(p, ...) end', 'minified': 'a=function(b,...)end' }, { 'description': 'Assignments + FunctionDeclaration', 'original': 'a = function(p, q, r, ...) end', 'minified': 'a=function(b,c,d,...)end' }, { 'description': 'AssignmentStatement + TableConstructorExpression', 'original': 'a = {\'-\'}', 'minified': 'a={\'-\'}' }, { 'description': 'AssignmentStatement + TableConstructorExpression', 'original': 'a = {\'not\'}', 'minified': 'a={\'not\'}' }, { 'description': 'AssignmentStatement + TableConstructorExpression', 'original': 'a = {not true}', 'minified': 'a={not true}' }, { 'description': 'MemberExpression on a TableConstructorExpression', 'original': 'x = ({}).y', 'minified': 'x=({}).y' }, { 'description': 'MemberExpression + CallExpression on a TableConstructorExpression', 'original': 'x = ({ foo = print }):foo("test")', 'minified': 'x=({foo=print}):foo("test")' }, { 'description': 'MemberExpression + CallExpression on a TableConstructorExpression', 'original': 'x = ({ foo = print }).foo("test")', 'minified': 'x=({foo=print}).foo("test")' }, { 'description': 'LogicalExpression in parenthesis + MemberExpression + CallExpression', 'original': '(x or y):f()', 'minified': '(x or y):f()' }, { 'description': 'StringLiteral in parenthesis + MemberExpression + CallExpression', 'original': '("abc"):f()', 'minified': '("abc"):f()' } ], // ForGenericStatement 'ForGenericStatement': [ { 'description': 'ForGenericStatement', 'original': 'for a in b do end', 'minified': 'for a in b do end' }, { 'description': 'ForGenericStatement + LocalStatement', 'original': 'for a in b do local a local b end', 'minified': 'for a in b do local a;local b end' }, { 'description': 'ForGenericStatement + LocalStatement', 'original': 'for a in b do local a; local b; end', 'minified': 'for a in b do local a;local b end' }, { 'description': 'ForGenericStatement', 'original': 'for a, b, c in p do end', 'minified': 'for a,b,c in p do end' }, { 'description': 'ForGenericStatement', 'original': 'for a, b, c in p, q, r do end', 'minified': 'for a,b,c in p,q,r do end' }, { 'description': 'ForGenericStatement', 'original': 'for a in 1 do end', 'minified': 'for a in 1 do end' }, { 'description': 'ForGenericStatement', 'original': 'for a in true do end', 'minified': 'for a in true do end' }, { 'description': 'ForGenericStatement', 'original': 'for a in "foo" do end', 'minified': 'for a in"foo"do end' }, { 'description': 'ForGenericStatement', 'original': 'for a in b do break end', 'minified': 'for a in b do break end' }, { 'description': 'ForGenericStatement + ReturnStatement', 'original': 'for a in b do return end', 'minified': 'for a in b do return end' }, { 'description': 'ForGenericStatement + DoStatement', 'original': 'for a in b do do end end', 'minified': 'for a in b do do end end' }, { 'description': 'ForGenericStatement + DoStatement + BreakStatement', 'original': 'for a in b do do break end end', 'minified': 'for a in b do do break end end' }, { 'description': 'ForGenericStatement + DoStatement + ReturnStatement', 'original': 'for a in b do do return end end', 'minified': 'for a in b do do return end end' }, { 'description': 'ForNumericStatement', 'original': 'for a = p, q do end', 'minified': 'for a=p,q do end' }, { 'description': 'ForNumericStatement', 'original': 'for a = 1, 2 do end', 'minified': 'for a=1,2 do end' }, { 'description': 'ForNumericStatement + LocalStatement', 'original': 'for a = 1, 2 do local a local b end', 'minified': 'for a=1,2 do local a;local b end' }, { 'description': 'ForNumericStatement + LocalStatement', 'original': 'for a = 1, 2 do local a; local b; end', 'minified': 'for a=1,2 do local a;local b end' }, { 'description': 'ForNumericStatement', 'original': 'for a = p, q, r do end', 'minified': 'for a=p,q,r do end' }, { 'description': 'ForNumericStatement', 'original': 'for a = 1, 2, 3 do end', 'minified': 'for a=1,2,3 do end' }, { 'description': 'ForNumericStatement + BreakStatement', 'original': 'for a = p, q do break end', 'minified': 'for a=p,q do break end' }, { 'description': 'ForNumericStatement + ReturnStatement', 'original': 'for a = 1, 2 do return end', 'minified': 'for a=1,2 do return end' }, { 'description': 'ForNumericStatement + DoStatement', 'original': 'for a = p, q do do end end', 'minified': 'for a=p,q do do end end' }, { 'description': 'ForNumericStatement + DoStatement + BreakStatement', 'original': 'for a = p, q do do break end end', 'minified': 'for a=p,q do do break end end' }, { 'description': 'ForNumericStatement + DoStatement + ReturnStatement', 'original': 'for a = p, q do do return end end', 'minified': 'for a=p,q do do return end end' } ], // Function calls 'CallStatement': [ { 'description': 'CallStatement', 'original': 'a()', 'minified': 'a()' }, { 'description': 'CallStatement', 'original': 'a(1)', 'minified': 'a(1)' }, { 'description': 'CallStatement', 'original': 'a(1, 2, 3)', 'minified': 'a(1,2,3)' }, { 'description': 'EnclosedCallStatement', 'original': '(select(1, ...))', 'minified': '(select(1,...))' }, { 'description': 'CallStatement + CallExpression', 'original': 'a()()', 'minified': 'a()()' }, { 'description': 'CallStatement + MemberExpression', 'original': 'a.b()', 'minified': 'a.b()' }, { 'description': 'CallStatement + IndexExpression', 'original': 'a[b]()', 'minified': 'a[b]()' }, { 'description': 'CallStatement + MemberExpression', 'original': 'a.b.c()', 'minified': 'a.b.c()' }, { 'description': 'CallStatement + IndexExpression + IndexExpression', 'original': 'a[b][c]()', 'minified': 'a[b][c]()' }, { 'description': 'CallStatement + IndexExpression + MemberExpression', 'original': 'a[b].c()', 'minified': 'a[b].c()' }, { 'description': 'CallStatement + MemberExpression + IndexExpression', 'original': 'a.b[c]()', 'minified': 'a.b[c]()' }, { 'description': 'CallStatement + MemberExpression', 'original': 'a:b()', 'minified': 'a:b()' }, { 'description': 'CallStatement + MemberExpression + MemberExpression', 'original': 'a.b:c()', 'minified': 'a.b:c()' }, { 'description': 'CallStatement + IndexExpression + MemberExpression', 'original': 'a[b]:c()', 'minified': 'a[b]:c()' }, { 'description': 'CallStatement + MemberExpression + MemberExpression', 'original': 'a:b():c()', 'minified': 'a:b():c()' }, { 'description': 'CallStatement + MemberExpression + MemberExpression + IndexExpression + MemberExpression', 'original': 'a:b().c[d]:e()', 'minified': 'a:b().c[d]:e()' }, { 'description': 'CallStatement + MemberExpression + IndexExpression + MemberExpression + MemberExpression + CallExpression', 'original': 'a:b()[c].d:e()', 'minified': 'a:b()[c].d:e()' }, { 'description': 'CallStatement', 'original': '(a)()', 'minified': 'a()' }, { 'description': 'CallStatement', 'original': '(1)()', 'minified': '1()' }, { 'description': 'CallStatement', 'original': '("foo")()', 'minified': '("foo")()' }, { 'description': 'CallStatement', 'original': '(true)()', 'minified': 'true()' }, { 'description': 'CallStatement + CallExpression', 'original': '(a)()()', 'minified': 'a()()' }, { 'description': 'CallStatement + MemberExpression', 'original': '(a.b)()', 'minified': 'a.b()' }, { 'description': 'CallStatement + IndexExpression', 'original': '(a[b])()', 'minified': 'a[b]()' }, { 'description': 'CallStatement + MemberExpression', 'original': '(a).b()', 'minified': 'a.b()' }, { 'description': 'CallStatement + IndexExpression', 'original': '(a)[b]()', 'minified': 'a[b]()' }, { 'description': 'CallStatement + MemberExpression', 'original': '(a):b()', 'minified': 'a:b()' }, { 'description': 'CallStatement + MemberExpression + IndexExpression + MemberExpression + CallExpression', 'original': '(a).b[c]:d()', 'minified': 'a.b[c]:d()' }, { 'description': 'CallStatement + IndexExpression + MemberExpression + MemberExpression', 'original': '(a)[b].c:d()', 'minified': 'a[b].c:d()' }, { 'description': 'CallStatement + MemberExpression + CallExpression + MemberExpression', 'original': '(a):b():c()', 'minified': 'a:b():c()' }, { 'description': 'CallStatement + MemberExpression + CallExpression + MemberExpression + MemberExpression', 'original': '(a):b().c[d]:e()', 'minified': 'a:b().c[d]:e()' }, { 'description': 'CallStatement + MemberExpression + CallExpression + IndexExpression + MemberExpression + MemberExpression', 'original': '(a):b()[c].d:e()', 'minified': 'a:b()[c].d:e()' }, { 'description': 'CallStatement + StringCallExpression', 'original': 'a"foo"', 'minified': 'a"foo"' }, { 'description': 'CallStatement + StringCallExpression', 'original': 'a[[foo]]', 'minified': 'a[[foo]]' }, { 'description': 'CallStatement + MemberExpression + StringCallExpression', 'original': 'a.b"foo"', 'minified': 'a.b"foo"' }, { 'description': 'CallStatement + IndexExpression + StringCallExpression', 'original': 'a[b]"foo"', 'minified': 'a[b]"foo"' }, { 'description': 'CallStatement + MemberExpression + StringCallExpression', 'original': 'a:b"foo"', 'minified': 'a:b"foo"' }, { 'description': 'CallStatement + TableCallExpression', 'original': 'a{}', 'minified': 'a{}' }, { 'description': 'CallStatement + MemberExpression + TableCallExpression', 'original': 'a.b{}', 'minified': 'a.b{}' }, { 'description': 'CallStatement + IndexExpression + TableCallExpression', 'original': 'a[b]{}', 'minified': 'a[b]{}' }, { 'description': 'CallStatement + MemberExpression + TableCallExpression', 'original': 'a:b{}', 'minified': 'a:b{}' }, { 'description': 'CallStatement + StringCallExpression', 'original': 'a()"foo"', 'minified': 'a()"foo"' }, { 'description': 'CallStatement + StringCallExpression', 'original': 'a"foo"()', 'minified': 'a"foo"()' }, { 'description': 'CallStatement + StringCallExpression + MemberExpression', 'original': 'a"foo".b()', 'minified': 'a"foo".b()' }, { 'description': 'CallStatement + StringCallExpression + IndexExpression', 'original': 'a"foo"[b]()', 'minified': 'a"foo"[b]()' }, { 'description': 'CallStatement + StringCallExpression + MemberExpression', 'original': 'a"foo":c()', 'minified': 'a"foo":c()' }, { 'description': 'CallStatement + StringCallExpression + StringCallExpression', 'original': 'a"foo""bar"', 'minified': 'a"foo""bar"' }, { 'description': 'CallStatement + StringCallExpression + TableCallExpression', 'original': 'a"foo"{}', 'minified': 'a"foo"{}' }, { 'description': 'CallStatement + MemberExpression + StringCallExpression + MemberExpression + IndexExpression + MemberExpression + StringCallExpression', 'original': '(a):b"foo".c[d]:e"bar"', 'minified': 'a:b"foo".c[d]:e"bar"' }, { 'description': 'CallStatement + MemberExpression + StringCallExpression + IndexExpression + MemberExpression + MemberExpression + StringCallExpression', 'original': '(a):b"foo"[c].d:e"bar"', 'minified': 'a:b"foo"[c].d:e"bar"' }, { 'description': 'CallStatement + TableConstructorExpression', 'original': 'a(){}', 'minified': 'a(){}' }, { 'description': 'CallStatement + TableConstructorExpression', 'original': 'a{}()', 'minified': 'a{}()' }, { 'description': 'CallStatement + TableConstructorExpression + MemberExpression', 'original': 'a{}.b()', 'minified': 'a{}.b()' }, { 'description': 'CallStatement + TableConstructorExpression + IndexExpression', 'original': 'a{}[b]()', 'minified': 'a{}[b]()' }, { 'description': 'CallStatement + TableConstructorExpression + MemberExpression', 'original': 'a{}:c()', 'minified': 'a{}:c()' }, { 'description': 'CallStatement + TableConstructorExpression + StringCallExpression', 'original': 'a{}"foo"', 'minified': 'a{}"foo"' }, { 'description': 'CallStatement + TableConstructorExpression + TableConstructorExpression', 'original': 'a{}{}', 'minified': 'a{}{}' }, { 'description': 'CallStatement + MemberExpression + TableConstructorExpression + MemberExpression + MemberExpression + MemberExpression + TableConstructorExpression', 'original': '(a):b{}.c[d]:e{}', 'minified': 'a:b{}.c[d]:e{}' }, { 'description': 'CallStatement + MemberExpression + TableConstructorExpression + IndexExpression + MemberExpression + MemberExpression + TableConstructorExpression', 'original': '(a):b{}[c].d:e{}', 'minified': 'a:b{}[c].d:e{}' } ], // FunctionDeclaration 'FunctionDeclaration': [ { 'description': 'FunctionDeclaration', 'original': 'function a() end', 'minified': 'function a()end' }, { 'description': 'FunctionDeclaration', 'original': 'function a(p) end', 'minified': 'function a(b)end' }, { 'description': 'FunctionDeclaration', 'original': 'function a(p, q, r) end', 'minified': 'function a(b,c,d)end' }, { 'description': 'FunctionDeclaration + ReturnStatement', 'original': 'function a(p) return end', 'minified': 'function a(b)return end' }, { 'description': 'FunctionDeclaration + DoStatement', 'original': 'function a(p) do end end', 'minified': 'function a(b)do end end' }, { 'description': 'FunctionDeclaration + MemberExpression', 'original': 'function a.b() end', 'minified': 'function a.b()end' }, { 'description': 'FunctionDeclaration + MemberExpression', 'original': 'function a.b.c.d() end', 'minified': 'function a.b.c.d()end' }, { 'description': 'FunctionDeclaration + MemberExpression', 'original': 'function a:b() end', 'minified': 'function a:b()end' }, { 'description': 'FunctionDeclaration + MemberExpression', 'original': 'function a.b.c:d() end', 'minified': 'function a.b.c:d()end' }, { 'description': 'FunctionDeclaration', 'original': 'function a(...) end', 'minified': 'function a(...)end' }, { 'description': 'FunctionDeclaration', 'original': 'function a(p, ...) end', 'minified': 'function a(b,...)end' }, { 'description': 'FunctionDeclaration', 'original': 'function a(p, q, r, ...) end', 'minified': 'function a(b,c,d,...)end' }, { 'description': 'FunctionDeclaration + LocalStatement', 'original': 'function a() local a local b end', 'minified': 'function a()local a;local b end' }, { 'description': 'FunctionDeclaration + LocalStatement', 'original': 'function a() local a; local b; end', 'minified': 'function a()local a;local b end' }, { 'description': 'FunctionDeclaration + FunctionDeclaration', 'original': 'function a() end; function a() end;', 'minified': 'function a()end;function a()end' }, { 'description': 'FunctionDeclaration + WhileStatement', 'original': 'a = function() while true do end end', 'minified': 'a=function()while true do end end' }, { 'description': 'CallExpression + FunctionDeclaration lambda', 'original': '(function() end)()', 'minified': '(function()end)()' } ], // Literals 'Literals': [ { 'description': 'NumericLiteral', 'original': 'a = 1', 'minified': 'a=1' }, { 'description': 'NumericLiteral', 'original': 'a = .1', 'minified': 'a=.1' }, { 'description': 'NumericLiteral', 'original': 'a = 1.', 'minified': 'a=1.' }, { 'description': 'NumericLiteral + Any Statement', 'original': 'a = 1.;b=2', 'minified': 'a=1.;b=2' }, { 'description': 'NumericLiteral', 'original': 'a = 1.1', 'minified': 'a=1.1' }, { 'description': 'NumericLiteral', 'original': 'a = 10.1', 'minified': 'a=10.1' }, { 'description': 'NumericLiteral', 'original': 'a = 1e1', 'minified': 'a=1e1' }, { 'description': 'NumericLiteral', 'original': 'a = 1E1', 'minified': 'a=1E1' }, { 'description': 'NumericLiteral', 'original': 'a = 1e+9', 'minified': 'a=1e+9' }, { 'description': 'NumericLiteral', 'original': 'a = 1e-1', 'minified': 'a=1e-1' }, { 'description': 'NumericLiteral', 'original': 'a = 0xf', 'minified': 'a=0xf' }, { 'description': 'NumericLiteral', 'original': 'a = 0xf.', 'minified': 'a=0xf.' }, { 'description': 'NumericLiteral', 'original': 'a = 0xf.3', 'minified': 'a=0xf.3' }, { 'description': 'NumericLiteral', 'original': 'a = 0xfp1', 'minified': 'a=0xfp1' }, { 'description': 'NumericLiteral', 'original': 'a = 0xfp+1', 'minified': 'a=0xfp+1' }, { 'description': 'NumericLiteral', 'original': 'a = 0xfp-1', 'minified': 'a=0xfp-1' }, { 'description': 'NumericLiteral', 'original': 'a = 0xFP+9', 'minified': 'a=0xFP+9' }, { 'description': 'NumericLiteral', 'original': 'a = 1 .. 3 .. -2', 'minified': 'a=1 ..3 ..-2' }, { 'description': 'NumericLiteral + StringLiteral', 'original': 'a = 1 .. "bar"', 'minified': 'a=1 .."bar"' }, { 'description': 'StringLiteral', 'original': 'a = \'bar\'', 'minified': 'a=\'bar\'' }, { 'description': 'StringLiteral', 'original': 'a = "bar"', 'minified': 'a="bar"' }, { 'description': 'StringLiteral', 'original': 'a = [[bar]]', 'minified': 'a=[[bar]]' }, { 'description': 'NilLiteral', 'original': 'a = nil', 'minified': 'a=nil' }, { 'description': 'BooleanLiteral', 'original': 'a = true', 'minified': 'a=true' }, { 'description': 'BooleanLiteral', 'original': 'a = false', 'minified': 'a=false' }, { 'description': 'VarargLiteral', 'original': 'a = ...', 'minified': 'a=...' } ], // Escape sequences 'Escape sequences': [ { 'description': 'String escape sequence', 'original': 'a = "bar\\tbaz"', 'minified': 'a="bar\\tbaz"' }, { 'description': 'String escape sequence', 'original': 'a = "bar\\\\tbaz"', 'minified': 'a="bar\\\\tbaz"' }, { 'description': 'String escape sequence', 'original': 'a = "bar\\\\nbaz"', 'minified': 'a="bar\\\\nbaz"' }, { 'description': 'String escape sequence', 'original': 'a = "bar\\\\rbaz"', 'minified': 'a="bar\\\\rbaz"' }, { 'description': 'String escape sequence', 'original': 'a = "bar\\80baz"', 'minified': 'a="bar\\80baz"' }, { 'description': 'String escape sequence', 'original': 'a = "bar\\800\\0baz"', 'minified': 'a="bar\\800\\0baz"' }, { 'description': 'String escape sequence', 'original': 'a = "bar\\\\z baz"', 'minified': 'a="bar\\\\z baz"' }, { 'description': 'String escape sequence', 'original': 'a = "bar\\\\f\\\\v\\bbaz"', 'minified': 'a="bar\\\\f\\\\v\\bbaz"' }, { 'description': 'String escape sequence', 'original': 'a = "bar\\f\\v\\bbaz"', 'minified': 'a="bar\\f\\v\\bbaz"' }, { 'description': 'String escape sequence', 'original': 'a = [[bar\\f\\v\\bbaz]]', 'minified': 'a=[[bar\\f\\v\\bbaz]]' }, { 'description': 'String escape sequence', 'original': "c = '\\\\'", 'minified': "c='\\\\'" }, { 'description': 'String escape sequence', 'original': "c = '\\\''", 'minified': "c='\\\''" }, { 'description': 'String escape sequence', 'original': "c = '\\123", 'minified': "c='\\123" }, { 'description': 'String escape sequence', 'original': "c = '\\x23", 'minified': "c='\\x23" }, { 'description': 'String escape sequence', 'original': "c = '\\xx'", 'minified': "c='\\xx'" } ], // LocalStatement 'LocalStatement': [ { 'description': 'LocalStatement', 'original': 'local a', 'minified': 'local a' }, { 'description': 'LocalStatement', 'original': 'local a;', 'minified': 'local a' }, { 'description': 'LocalStatement', 'original': 'local a, b, c', 'minified': 'local a,b,c' }, { 'description': 'LocalStatement', 'original': 'local a; local b local c;', 'minified': 'local a;local b;local c' }, { 'description': 'LocalStatement', 'original': 'local a = 1', 'minified': 'local a=1' }, { 'description': 'LocalStatement', 'original': 'local a local b = a', 'minified': 'local a;local b=a' }, { 'description': 'LocalStatement', 'original': 'local a, b = 1, 2', 'minified': 'local a,b=1,2' }, { 'description': 'LocalStatement', 'original': 'local a, b, c = 1, 2, 3', 'minified': 'local a,b,c=1,2,3' }, { 'description': 'LocalStatement', 'original': 'local a, b, c = 1', 'minified': 'local a,b,c=1' }, { 'description': 'LocalStatement', 'original': 'local a = 1, 2, 3', 'minified': 'local a=1,2,3' }, { 'description': 'LocalStatement', 'original': 'local function a() end', 'minified': 'local function a()end' }, { 'description': 'LocalStatement', 'original': 'local function a(p) end', 'minified': 'local function a(b)end' }, { 'description': 'LocalStatement', 'original': 'local function a(p,q,r) end', 'minified': 'local function a(b,c,d)end' }, { 'description': 'LocalStatement', 'original': 'local function a(p) return end', 'minified': 'local function a(b)return end' }, { 'description': 'LocalStatement', 'original': 'local function a(p) do end end', 'minified': 'local function a(b)do end end' }, { 'description': 'LocalStatement', 'original': 'local function a(...) end', 'minified': 'local function a(...)end' }, { 'description': 'LocalStatement', 'original': 'local function a(p,...) end', 'minified': 'local function a(b,...)end' }, { 'description': 'LocalStatement', 'original': 'local function a(p,q,r,...) end', 'minified': 'local function a(b,c,d,...)end' }, { 'description': 'LocalStatement', 'original': 'local function a() local a local b end', 'minified': 'local function a()local a;local b end' }, { 'description': 'LocalStatement', 'original': 'local function a() local a; local b; end', 'minified': 'local function a()local a;local b end' }, { 'description': 'LocalStatement', 'original': 'local function a() end; local function a() end;', 'minified': 'local function a()end;local function a()end' } ], // Operators 'Operators': [ { 'description': 'Operators', 'original': 'a = -10', 'minified': 'a=-10' }, { 'description': 'Operators', 'original': 'a = -"foo"', 'minified': 'a=-"foo"' }, { 'description': 'Operators', 'original': 'a = -a', 'minified': 'a=-a' }, { 'description': 'Operators', 'original': 'a = -nil', 'minified': 'a=-nil' }, { 'description': 'Operators', 'original': 'a = -true', 'minified': 'a=-true' }, { 'description': 'Operators', 'original': 'a = -{}', 'minified': 'a=-{}' }, { 'description': 'Operators', 'original': 'a = -function() end', 'minified': 'a=-function()end' }, { 'description': 'Operators', 'original': 'a = -a()', 'minified': 'a=-a()' }, { 'description': 'Operators', 'original': 'a = -(a)', 'minified': 'a=-a' }, { 'description': 'Operators', 'original': 'a = not 10', 'minified': 'a=not 10' }, { 'description': 'Operators', 'original': 'a = not "foo"', 'minified': 'a=not"foo"' }, { 'description': 'Operators', 'original': 'a = not a', 'minified': 'a=not a' }, { 'description': 'Operators', 'original': 'a = not nil', 'minified': 'a=not nil' }, { 'description': 'Operators', 'original': 'a = not true', 'minified': 'a=not true' }, { 'description': 'Operators', 'original': 'a = not {}', 'minified': 'a=not{}' }, { 'description': 'Operators', 'original': 'a = not function() end', 'minified': 'a=not function()end' }, { 'description': 'Operators', 'original': 'a = not a()', 'minified': 'a=not a()' }, { 'description': 'Operators', 'original': 'a = not (a)', 'minified': 'a=not a' }, { 'description': 'Operators', 'original': 'a = 1 + 2; a = 1 - 2', 'minified': 'a=1+2;a=1-2' }, { 'description': 'Operators', 'original': 'a = 1 * 2; a = 1 / 2', 'minified': 'a=1*2;a=1/2' }, { 'description': 'Operators', 'original': 'a = 1 ^ 2; a = 1 .. 2', 'minified': 'a=1^2;a=1 ..2' }, { 'description': 'Operators', 'original': 'a = 1 + -2; a = 1 - -2', 'minified': 'a=1+-2;a=1- -2' }, { 'description': 'Operators', 'original': 'a = 1 * not 2; a = 1 / not 2', 'minified': 'a=1*not 2;a=1/not 2' }, { 'description': 'Operators', 'original': 'a = 1 + 2 - 3 * 4 / 5 ^ 6', 'minified': 'a=1+2-3*4/5^6' }, { 'description': 'Operators', 'original': 'a = a + b - c', 'minified': 'a=a+b-c' }, { 'description': 'Operators', 'original': 'a = "foo" + "bar"', 'minified': 'a="foo"+"bar"' }, { 'description': 'Operators', 'original': 'a = "foo".."bar".."baz"', 'minified': 'a="foo".."bar".."baz"' }, { 'description': 'Operators', 'original': 'a = ("foo".."bar".."baz")', 'minified': 'a="foo".."bar".."baz"' }, { 'description': 'Operators', 'original': 'a = (("foo".."bar".."baz"))', 'minified': 'a="foo".."bar".."baz"' }, { 'description': 'Operators', 'original': 'a = true + false - nil', 'minified': 'a=true+false-nil' }, { 'description': 'Operators', 'original': 'a = {} * {}', 'minified': 'a={}*{}' }, { 'description': 'Operators', 'original': 'a = function() end / function() end', 'minified': 'a=function()end/function()end' }, { 'description': 'Operators', 'original': 'a = a() ^ b()', 'minified': 'a=a()^b()' }, { 'description': 'Operators', 'original': 'a = 1 == 2; a = 1 ~= 2', 'minified': 'a=1==2;a=1~=2' }, { 'description': 'Operators', 'original': 'a = 1 < 2; a = 1 <= 2', 'minified': 'a=1<2;a=1<=2' }, { 'description': 'Operators', 'original': 'a = 1 > 2; a = 1 >= 2', 'minified': 'a=1>2;a=1>=2' }, { 'description': 'Operators', 'original': 'a = 1 < 2 < 3', 'minified': 'a=1<2<3' }, { 'description': 'Operators', 'original': 'a = 1 >= 2 >= 3', 'minified': 'a=1>=2>=3' }, { 'description': 'Operators', 'original': 'a = "foo" == "bar"', 'minified': 'a="foo"=="bar"' }, { 'description': 'Operators', 'original': 'a = "foo" > "bar"', 'minified': 'a="foo">"bar"' }, { 'description': 'Operators', 'original': 'a = a ~= b', 'minified': 'a=a~=b' }, { 'description': 'Operators', 'original': 'a = true == false', 'minified': 'a=true==false' }, { 'description': 'Operators', 'original': 'a = 1 and 2; a = 1 or 2', 'minified': 'a=1 and 2;a=1 or 2' }, { 'description': 'Operators', 'original': 'a = 1 and 2 and 3', 'minified': 'a=1 and 2 and 3' }, { 'description': 'Operators', 'original': 'a = 1 or 2 or 3', 'minified': 'a=1 or 2 or 3' }, { 'description': 'Operators', 'original': 'a = 1 and 2 or 3', 'minified': 'a=1 and 2 or 3' }, { 'description': 'Operators', 'original': 'a = a and b or c', 'minified': 'a=a and b or c' }, { 'description': 'Operators', 'original': 'a = a() and (b)() or c.d', 'minified': 'a=a()and b()or c.d' }, { 'description': 'Operators', 'original': 'a = "foo" and "bar"', 'minified': 'a="foo"and"bar"' }, { 'description': 'Operators', 'original': 'a = true or false', 'minified': 'a=true or false' }, { 'description': 'Operators', 'original': 'a = {} and {} or {}', 'minified': 'a={}and{}or{}' }, { 'description': 'Operators', 'original': 'a = (1) and ("foo") or (nil)', 'minified': 'a=1 and"foo"or nil' }, { 'description': 'Operators', 'original': 'a = function() end == function() end', 'minified': 'a=function()end==function()end' }, { 'description': 'Operators', 'original': 'a = function() end or function() end', 'minified': 'a=function()end or function()end' }, { 'description': 'Operators', 'original': 'a = true or false and nil', 'minified': 'a=true or false and nil' }, { 'description': 'Operators', 'original': 'a = 2^-2 == 1/4 and -2^- -2 == - - -4', 'minified': 'a=2^-2==1/4 and-2^- -2==- - -4' }, { 'description': 'Operators', 'original': 'a = -3-1-5 == 0+0-9', 'minified': 'a=-3-1-5==0+0-9' } ], // Operator precedence 'Operator precedence': [ // http://www.lua.org/manual/5.1/manual.html#2.5.6 { 'description': 'Operator precedence', 'original': 'a = (1 + 2) * 3', 'minified': 'a=(1+2)*3' }, { 'description': 'Operator precedence', 'original': 'a = ((1 + 2) - 3) * (4 / (5 ^ 6))', 'minified': 'a=(1+2-3)*4/5^6' }, { 'description': 'Operator precedence', 'original': 'a = (1 + (2 - (3 * (4 / (5 ^ ((6)))))))', 'minified': 'a=1+2-3*4/5^6' }, { 'description': 'Operator precedence', 'original': 'a = (((1 or false) and true) or false) == true', 'minified': 'a=((1 or false)and true or false)==true' }, { 'description': 'Operator precedence', 'original': 'a = (((nil and true) or false) and true) == false', 'minified': 'a=((nil and true or false)and true)==false' }, { 'description': 'Operator precedence', 'original': 'a = not ((true or false) and nil)', 'minified': 'a=not((true or false)and nil)' }, { 'description': 'Operator precedence', 'original': 'a = -2^2 == -4 and (-2)^2 == 4 and 2*2-3-1 == 0', 'minified': 'a=-2^2==-4 and(-2)^2==4 and 2*2-3-1==0' }, { 'description': 'Operator precedence', 'original': 'a = 2*1+3/3 == 3 and 1+2 .. 3*1 == "33"', 'minified': 'a=2*1+3/3==3 and 1+2 ..3*1=="33"' }, { 'description': 'Operator precedence', 'original': 'a = not nil and 2 and not(2 > 3 or 3 < 2)', 'minified': 'a=not nil and 2 and not(2>3 or 3<2)' }, { 'description': 'Operator precedence', 'original': 'a = not(2+1 > 3*1) and "a".."b" > "a"', 'minified': 'a=not(2+1>3*1)and"a".."b">"a"' }, { 'description': 'Operator precedence', 'original': 'a = 2 ^ (3 ^ 2)', 'minified': 'a=2^3^2' }, { 'description': 'Operator precedence', 'original': 'a = (2 ^ 3) * 4', 'minified': 'a=2^3*4' }, { 'description': 'Operator precedence', 'original': 'a = 2 ^ (2 ^ 3)', 'minified': 'a=2^2^3' }, { 'description': 'Operator precedence', 'original': 'a = 2 ^ (2 ^ (3 ^ 4))', 'minified': 'a=2^2^3^4' }, { 'description': 'Operator precedence', 'original': 'a = 2 ^ (2 ^ (3 ^ 4)) + 1', 'minified': 'a=2^2^3^4+1' }, { 'description': 'Operator precedence', 'original': 'a = (1 * 2) / 3', 'minified': 'a=1*2/3' }, { 'description': 'Operator precedence', 'original': 'a = ( 1 + ( 1 * 2 ) ) > 3', 'minified': 'a=1+1*2>3' }, { 'description': 'Operator precedence', 'original': 'a = (1 < 2) and (2 < 1)', 'minified': 'a=1<2 and 2<1' }, { 'description': 'Operator precedence', 'original': 'a = ((1 / 2) + (4 * 2)) > 8', 'minified': 'a=1/2+4*2>8' }, { 'description': 'Operator precedence', 'original': 'a = (2 < 1) == true', 'minified': 'a=2<1==true' }, { 'description': 'Operator precedence', 'original': 'a = (2 < (1 + 1)) == true', 'minified': 'a=2<1+1==true' }, { 'description': 'Operator precedence', 'original': 'a = (not 1) + 1', 'minified': 'a=not 1+1' }, { 'description': 'Operator precedence', 'original': 'a = (not (not (1)) + 1)', 'minified': 'a=not not 1+1' }, { 'description': 'Operator precedence', 'original': 'a = 1 + (#1)', 'minified': 'a=1+#1' }, { 'description': 'Operator precedence', 'original': 'a = - (x ^ 2)', 'minified': 'a=-x^2' }, { 'description': 'Operator precedence', 'original': 'a = (4 ^ (2 ^ 3))', 'minified': 'a=4^2^3' }, { 'description': 'Operator precedence: right associativity', 'original': 'a = (((4) ^ 2) ^ 3)', 'minified': 'a=(4^2)^3' }, { 'description': 'Operator precedence: left associativity', 'original': 'a = 1 - (2 - 3)', 'minified': 'a=1-(2-3)' }, { 'description': 'Operator precedence: left associativity with special de-parenthesizing', 'original': 'a = 1 + (2 - 3)', 'minified': 'a=1+2-3' }, { 'description': 'Operator precedence: left associativity with special de-parenthesizing', 'original': 'a = 1 + (2 + 3)', 'minified': 'a=1+2+3' }, { 'description': 'Operator precedence: left associativity with special de-parenthesizing', 'original': 'a = 1 * (2 / 3)', 'minified': 'a=1*2/3' }, { 'description': 'Operator precedence: left associativity with special de-parenthesizing', 'original': 'a = 1 * (2 * 3)', 'minified': 'a=1*2*3' }, { 'description': 'Operator precedence', 'original': 'a = ("a" .. ("b" .. "c"))', 'minified': 'a="a".."b".."c"' }, { 'description': 'Operator precedence: right associativity', 'original': 'a = ((("a") .. "b") .. "c")', 'minified': 'a=("a".."b").."c"' }, { 'description': 'Operator precedence: RHS parens', 'original': 'a = false and (false or true)', 'minified': 'a=false and(false or true)' }, { 'description': 'Operator precedence: RHS parens', 'original': 'a = 1 * (2 - 3)', 'minified': 'a=1*(2-3)' } ], // RepeatStatement 'RepeatStatement': [ { 'description': 'RepeatStatement', 'original': 'repeat until 0', 'minified': 'repeat until 0' }, { 'description': 'RepeatStatement', 'original': 'repeat until false', 'minified': 'repeat until false' }, { 'description': 'RepeatStatement', 'original': 'repeat local a until 1', 'minified': 'repeat local a until 1' }, { 'description': 'RepeatStatement', 'original': 'repeat local a local b until 0', 'minified': 'repeat local a;local b until 0' }, { 'description': 'RepeatStatement', 'original': 'repeat local a; local b; until 0', 'minified': 'repeat local a;local b until 0' }, { 'description': 'RepeatStatement', 'original': 'repeat return until 0', 'minified': 'repeat return until 0' }, { 'description': 'RepeatStatement', 'original': 'repeat break until 0', 'minified': 'repeat break until 0' }, { 'description': 'RepeatStatement', 'original': 'repeat do end until 0', 'minified': 'repeat do end until 0' }, { 'description': 'RepeatStatement', 'original': 'repeat do return end until 0', 'minified': 'repeat do return end until 0' }, { 'description': 'RepeatStatement', 'original': 'repeat do break end until 0', 'minified': 'repeat do break end until 0' } ], // ReturnStatement 'ReturnStatement': [ { 'description': 'ReturnStatement', 'original': 'return 1', 'minified': 'return 1' }, { 'description': 'ReturnStatement', 'original': 'return "foo"', 'minified': 'return"foo"' }, { 'description': 'ReturnStatement', 'original': 'return 1, 2, 3', 'minified': 'return 1,2,3' }, { 'description': 'ReturnStatement', 'original': 'return a, b, c, d', 'minified': 'return a,b,c,d' }, { 'description': 'ReturnStatement', 'original': 'return 1, 2;', 'minified': 'return 1,2' } ], // Statements 'Statements': [ { 'description': 'BreakStatement', 'original': 'break', 'minified': 'break' }, { 'description': 'LabelStatement', 'original': '::foo::', 'minified': '::a::' }, { 'description': 'GotoStatement', 'original': 'goto foo', 'minified': 'goto a' }, { 'description': 'LabelStatement + GotoStatement', 'original': 'for x = 1, 10 do print(x) goto done end ::done::', 'minified': 'for a=1,10 do print(a)goto b end::b::' } ], // TableConstructorExpressions 'TableConstructorExpressions': [ { 'description': 'TableConstructorExpression', 'original': 'a = {}', 'minified': 'a={}' }, { 'description': 'TableConstructorExpression', 'original': 'a = {{{}}}', 'minified': 'a={{{}}}' }, { 'description': 'TableConstructorExpression', 'original': 'a = {{},{},{{}},}', 'minified': 'a={{},{},{{}}}' }, { 'description': 'TableConstructorExpression', 'original': 'a = { 1 }', 'minified': 'a={1}' }, { 'description': 'TableConstructorExpression', 'original': 'a = { 1, }', 'minified': 'a={1}' }, { 'description': 'TableConstructorExpression', 'original': 'a = { 1; }', 'minified': 'a={1}' }, { 'description': 'TableConstructorExpression', 'original': 'a = { 1, 2 }', 'minified': 'a={1,2}' }, { 'description': 'TableConstructorExpression', 'original': 'a = { a, b, c, }', 'minified': 'a={a,b,c}' }, { 'description': 'TableConstructorExpression', 'original': 'a = { true; false, nil; }', 'minified': 'a={true,false,nil}' }, { 'description': 'TableConstructorExpression', 'original': 'a = { a.b, a[b]; a:c(), }', 'minified': 'a={a.b,a[b],a:c()}' }, { 'description': 'TableConstructorExpression', 'original': 'a = { 1 + 2, a > b, "a" or "b" }', 'minified': 'a={1+2,a>b,"a"or"b"}' }, { 'description': 'TableConstructorExpression', 'original': 'a = { a = 1, }', 'minified': 'a={a=1}' }, { 'description': 'TableConstructorExpression', 'original': 'a = { a = 1, b = "foo", c = nil }', 'minified': 'a={a=1,b="foo",c=nil}' }, { 'description': 'TableConstructorExpression', 'original': 'a = { 1, a = "foo"; b = {}, d = true; }', 'minified': 'a={1,a="foo",b={},d=true}' }, { 'description': 'TableConstructorExpression', 'original': 'a = { ["foo"] = "bar" }', 'minified': 'a={["foo"]="bar"}' }, { 'description': 'TableConstructorExpression', 'original': 'a = { [1] = a, [2] = b, }', 'minified': 'a={[1]=a,[2]=b}' }, { 'description': 'TableConstructorExpression', 'original': 'a = { true, a = 1; ["foo"] = "bar", }', 'minified': 'a={true,a=1,["foo"]="bar"}' }, { 'description': 'IndexExpression on a TableConstructorExpression', 'original': 'x = ({})[1]', 'minified': 'x=({})[1]' } ], // WhileStatement 'WhileStatement': [ { 'description': 'WhileStatement', 'original': 'while 1 do end', 'minified': 'while 1 do end' }, { 'description': 'WhileStatement', 'original': 'while 1 do local a end', 'minified': 'while 1 do local a end' }, { 'description': 'WhileStatement', 'original': 'while 1 do local a local b end', 'minified': 'while 1 do local a;local b end' }, { 'description': 'WhileStatement', 'original': 'while 1 do local a; local b; end', 'minified': 'while 1 do local a;local b end' }, { 'description': 'WhileStatement', 'original': 'while true do end', 'minified': 'while true do end' }, { 'description': 'WhileStatement', 'original': 'while 1 do return end', 'minified': 'while 1 do return end' }, { 'description': 'WhileStatement', 'original': 'while 1 do do end end', 'minified': 'while 1 do do end end' }, { 'description': 'WhileStatement', 'original': 'while 1 do do return end end', 'minified': 'while 1 do do return end end' }, { 'description': 'WhileStatement', 'original': 'while 1 do break end', 'minified': 'while 1 do break end' }, { 'description': 'WhileStatement', 'original': 'while 1 do do break end end', 'minified': 'while 1 do do break end end' } ], // Rename local variables 'Variable name shortening': [ { 'description': 'Variable shortening should not generate reserved keywords', 'original': 'a, a0 = 1; local b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w, x, y, z, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, _, a1, a2, a3, a4, a5, a6, a7, a8, a9, aa, ab, ac, ad, ae, af, ag, ah, ai, aj, ak, al, am, an, ao, ap, aq, ar, as, at, au, av, aw, ax, ay, az, aA, aB, aC, aD, aE, aF, aG, aH, aI, aJ, aK, aL, aM, aN, aO, aP, aQ, aR, aS, aT, aU, aV, aW, aX, aY, aZ, a_, b0, b1, b2, b3, b4, b5, b6, b7, b8, b9, ba, bb, bc, bd, be, bf, bg, bh, bi, bj, bk, bl, bm, bn, bo, bp, bq, br, bs, bt, bu, bv, bw, bx, by, bz, bA, bB, bC, bD, bE, bF, bG, bH, bI, bJ, bK, bL, bM, bN, bO, bP, bQ, bR, bS, bT, bU, bV, bW, bX, bY, bZ, b_, c0, c1, c2, c3, c4, c5, c6, c7, c8, c9, ca, cb, cc, cd, ce, cf, cg, ch, ci, cj, ck, cl, cm, cn, co, cp, cq, cr, cs, ct, cu, cv, cw, cx, cy, cz, cA, cB, cC, cD, cE, cF, cG, cH, cI, cJ, cK, cL, cM, cN, cO, cP, cQ, cR, cS, cT, cU, cV, cW, cX, cY, cZ, c_, d0, d1, d2, d3, d4, d5, d6, d7, d8, d9, da, db, dc, dd, de, df, dg, dh, di, dj, dk, dl, dm, dn, dp, dq, dr, ds, dt, du, dv, dw, dx, dy, dz, dA, dB, dC, dD, dE, dF, dG, dH, dI, dJ, dK, dL, dM, dN, dO, dP, dQ, dR, dS, dT, dU, dV, dW, dX, dY, dZ, d_, e0, e1, e2, e3, e4, e5, e6, e7, e8, e9, ea, eb, ec, ed, ee, ef, eg, eh, ei, ej, ek, el, em, en, eo, ep, eq, er, es, et, eu, ev, ew, ex, ey, ez, eA, eB, eC, eD, eE, eF, eG, eH, eI, eJ, eK, eL, eM, eN, eO, eP, eQ, eR, eS, eT, eU, eV, eW, eX, eY, eZ, e_, f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, fa, fb, fc, fd, fe, ff, fg, fh, fi, fj, fk, fl, fm, fn, fo, fp, fq, fr, fs, ft, fu, fv, fw, fx, fy, fz, fA, fB, fC, fD, fE, fF, fG, fH, fI, fJ, fK, fL, fM, fN, fO, fP, fQ, fR, fS, fT, fU, fV, fW, fX, fY, fZ, f_, g0, g1, g2, g3, g4, g5, g6, g7, g8, g9, ga, gb, gc, gd, ge, gf, gg, gh, gi, gj, gk, gl, gm, gn, go, gp, gq, gr, gs, gt, gu, gv, gw, gx, gy, gz, gA, gB, gC, gD, gE, gF, gG, gH, gI, gJ, gK, gL, gM, gN, gO, gP, gQ, gR, gS, gT, gU, gV, gW, gX, gY, gZ, g_, h0, h1, h2, h3, h4, h5, h6, h7, h8, h9, ha, hb, hc, hd, he, hf, hg, hh, hi, hj, hk, hl, hm, hn, ho, hp, hq, hr, hs, ht, hu, hv, hw, hx, hy, hz, hA, hB, hC, hD, hE, hF, hG, hH, hI, hJ, hK, hL, hM, hN, hO, hP, hQ, hR, hS, hT, hU, hV, hW, hX, hY, hZ, h_, i0, i1, i2, i3, i4, i5, i6, i7, i8, i9, ia, ib, ic, id, ie, ig, ih, ii, ij, ik, il, im, io, ip, iq, ir, is, it, iu, iv, iw, ix, iy, iz, iA, iB, iC, iD, iE, iF, iG, iH, iI, iJ, iK, iL, iM, iN, iO, iP, iQ, iR, iS, iT, iU, iV, iW, iX, iY, iZ, i_, j0, j1, j2, j3, j4, j5, j6, j7, j8, j9, ja, jb, jc, jd, je, jf, jg, jh, ji, jj, jk, jl, jm, jn, jo, jp, jq, jr, js, jt, ju, jv, jw, jx, jy, jz, jA, jB, jC, jD, jE, jF, jG, jH, jI, jJ, jK, jL, jM, jN, jO, jP, jQ, jR, jS, jT, jU, jV, jW, jX, jY, jZ, j_, k0, k1, k2, k3, k4, k5, k6, k7, k8, k9, ka, kb, kc, kd, ke, kf, kg, kh, ki, kj, kk, kl, km, kn, ko, kp, kq, kr, ks, kt, ku, kv, kw, kx, ky, kz, kA, kB, kC, kD, kE, kF, kG, kH, kI, kJ, kK, kL, kM, kN, kO, kP, kQ, kR, kS, kT, kU, kV, kW, kX, kY, kZ, k_, l0, l1, l2, l3, l4, l5, l6, l7, l8, l9, la, lb, lc, ld, le, lf, lg, lh, li, lj, lk, ll, lm, ln, lo, lp, lq, lr, ls, lt, lu, lv, lw, lx, ly, lz, lA, lB, lC, lD, lE, lF, lG, lH, lI, lJ, lK, lL, lM, lN, lO, lP, lQ, lR, lS, lT, lU, lV, lW, lX, lY, lZ, l_, m0, m1, m2, m3, m4, m5, m6, m7, m8, m9, ma, mb, mc, md, me, mf, mg, mh, mi, mj, mk, ml, mm, mn, mo, mp, mq, mr, ms, mt, mu, mv, mw, mx, my, mz, mA, mB, mC, mD, mE, mF, mG, mH, mI, mJ, mK, mL, mM, mN, mO, mP, mQ, mR, mS, mT, mU, mV, mW, mX, mY, mZ, m_, n0, n1, n2, n3, n4, n5, n6, n7, n8, n9, na, nb, nc, nd, ne, nf, ng, nh, ni, nj, nk, nl, nm, nn, no, np, nq, nr, ns, nt, nu, nv, nw, nx, ny, nz, nA, nB, nC, nD, nE, nF, nG, nH, nI, nJ, nK, nL, nM, nN, nO, nP, nQ, nR, nS, nT, nU, nV, nW, nX, nY, nZ, n_, o0, o1, o2, o3, o4, o5, o6, o7, o8, o9, oa, ob, oc, od, oe, of, og, oh, oi, oj, ok, ol, om, on, oo, op, oq, os, ot, ou, ov, ow, ox, oy, oz, oA, oB, oC, oD, oE, oF, oG, oH, oI, oJ, oK, oL, oM, oN, oO, oP, oQ, oR, oS, oT, oU, oV, oW, oX, oY, oZ, o_, p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, pa, pb, pc, pd, pe, pf, pg, ph, pi, pj, pk, pl, pm, pn, po, pp, pq, pr, ps, pt, pu, pv, pw, px, py, pz, pA, pB, pC, pD, pE, pF, pG, pH, pI, pJ, pK, pL, pM, pN, pO, pP, pQ, pR, pS, pT, pU, pV, pW, pX, pY, pZ, p_, q0, q1, q2, q3, q4, q5, q6, q7, q8, q9, qa, qb, qc, qd, qe, qf, qg, qh, qi, qj, qk, ql, qm, qn, qo, qp, qq, qr, qs, qt, qu, qv, qw, qx, qy, qz, qA, qB, qC, qD, qE, qF, qG, qH, qI, qJ, qK, qL, qM, qN, qO, qP, qQ, qR, qS, qT, qU, qV, qW, qX, qY, qZ, q_, r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, ra, rb, rc, rd, re, rf, rg, rh, ri, rj, rk, rl, rm, rn, ro, rp, rq, rr, rs, rt, ru, rv, rw, rx, ry, rz, rA, rB, rC, rD, rE, rF, rG, rH, rI, rJ, rK, rL, rM, rN, rO, rP, rQ, rR, rS, rT, rU, rV, rW, rX, rY, rZ, r_, s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, sa, sb, sc, sd, se, sf, sg, sh, si, sj, sk, sl, sm, sn, so, sp, sq, sr, ss, st, su, sv, sw, sx, sy, sz, sA, sB, sC, sD, sE, sF, sG, sH, sI, sJ, sK, sL, sM, sN, sO, sP, sQ, sR, sS, sT, sU, sV, sW, sX, sY, sZ, s_, t0, t1, t2, t3, t4, t5, t6, t7, t8, t9, ta, tb, tc, td, te, tf, tg, th, ti, tj, tk, tl, tm, tn, to, tp, tq, tr, ts, tt, tu, tv, tw, tx, ty, tz, tA, tB, tC, tD, tE, tF, tG, tH, tI, tJ, tK, tL, tM, tN, tO, tP, tQ, tR, tS, tT, tU, tV, tW, tX, tY, tZ, t_, u0, u1, u2, u3, u4, u5, u6, u7, u8, u9, ua, ub, uc, ud, ue, uf, ug, uh, ui, uj, uk, ul, um, un, uo, up, uq, ur, us, ut, uu, uv, uw, ux, uy, uz, uA, uB, uC, uD, uE, uF, uG, uH, uI, uJ, uK, uL, uM, uN, uO, uP, uQ, uR, uS, uT, uU, uV, uW, uX, uY, uZ, u_, v0, v1, v2, v3, v4, v5, v6, v7, v8, v9, va, vb, vc, vd, ve, vf, vg, vh, vi, vj, vk, vl, vm, vn, vo, vp, vq, vr, vs, vt, vu, vv, vw, vx, vy, vz, vA, vB, vC, vD, vE, vF, vG, vH, vI, vJ, vK, vL, vM, vN, vO, vP, vQ, vR, vS, vT, vU, vV, vW, vX, vY, vZ, v_, w0, w1, w2, w3, w4, w5, w6, w7, w8, w9, wa, wb, wc, wd, we, wf, wg, wh, wi, wj, wk, wl, wm, wn, wo, wp, wq, wr, ws, wt, wu, wv, ww, wx, wy, wz, wA, wB, wC, wD, wE, wF, wG, wH, wI, wJ, wK, wL, wM, wN, wO, wP, wQ, wR, wS, wT, wU, wV, wW, wX, wY, wZ, w_, x0, x1, x2, x3, x4, x5, x6, x7, x8, x9, xa, xb, xc, xd, xe, xf, xg, xh, xi, xj, xk, xl, xm, xn, xo, xp, xq, xr, xs, xt, xu, xv, xw, xx, xy, xz, xA, xB, xC, xD, xE, xF, xG, xH, xI, xJ, xK, xL, xM, xN, xO, xP, xQ, xR, xS, xT, xU, xV, xW, xX, xY, xZ, x_, y0, y1, y2, y3, y4, y5, y6, y7, y8, y9, ya, yb, yc, yd, ye, yf, yg, yh, yi, yj, yk, yl, ym, yn, yo, yp, yq, yr, ys, yt, yu, yv, yw, yx, yy, yz, yA, yB, yC, yD, yE, yF, yG, yH, yI, yJ, yK, yL, yM, yN, yO, yP, yQ, yR, yS, yT, yU, yV, yW, yX, yY, yZ, y_, z0, z1, z2, z3, z4, z5, z6, z7, z8, z9, za, zb, zc, zd, ze, zf, zg, zh, zi, zj, zk, zl, zm, zn, zo, zp, zq, zr, zs, zt, zu, zv, zw, zx, zy, zz, zA, zB, zC, zD, zE, zF, zG, zH, zI, zJ, zK, zL, zM, zN, zO, zP, zQ, zR, zS, zT, zU, zV, zW, zX, zY, zZ, z_, A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, Aa, Ab, Ac, Ad, Ae, Af, Ag, Ah, Ai, Aj, Ak, Al, Am, An, Ao, Ap, Aq, Ar, As, At, Au, Av, Aw, Ax, Ay, Az, AA, AB, AC, AD, AE, AF, AG, AH, AI, AJ, AK, AL, AM, AN, AO, AP, AQ, AR, AS, AT, AU, AV, AW, AX, AY, AZ, A_, B0, B1, B2, B3, B4, B5, B6, B7, B8, B9, Ba, Bb, Bc, Bd, Be, Bf, Bg, Bh, Bi, Bj, Bk, Bl, Bm, Bn, Bo, Bp, Bq, Br, Bs, Bt, Bu, Bv, Bw, Bx, By, Bz, BA, BB, BC, BD, BE, BF, BG, BH, BI, BJ, BK, BL, BM, BN, BO, BP, BQ, BR, BS, BT, BU, BV, BW, BX, BY, BZ, B_, C0, C1, C2, C3, C4, C5, C6, C7, C8, C9, Ca, Cb, Cc, Cd, Ce, Cf, Cg, Ch, Ci, Cj, Ck, Cl, Cm, Cn, Co, Cp, Cq, Cr, Cs, Ct, Cu, Cv, Cw, Cx, Cy, Cz, CA, CB, CC, CD, CE, CF, CG, CH, CI, CJ, CK, CL, CM, CN, CO, CP, CQ, CR, CS, CT, CU, CV, CW, CX, CY, CZ, C_, D0, D1, D2, D3, D4, D5, D6, D7, D8, D9, Da, Db, Dc, Dd, De, Df, Dg, Dh, Di, Dj, Dk, Dl, Dm, Dn, Do, Dp, Dq, Dr, Ds, Dt, Du, Dv, Dw, Dx, Dy, Dz, DA, DB, DC, DD, DE, DF, DG, DH, DI, DJ, DK, DL, DM, DN, DO, DP, DQ, DR, DS, DT, DU, DV, DW, DX, DY, DZ, D_, E0, E1, E2, E3, E4, E5, E6, E7, E8, E9, Ea, Eb, Ec, Ed, Ee, Ef, Eg, Eh, Ei, Ej, Ek, El, Em, En, Eo, Ep, Eq, Er, Es, Et, Eu, Ev, Ew, Ex, Ey, Ez, EA, EB, EC, ED, EE, EF, EG, EH, EI, EJ, EK, EL, EM, EN, EO, EP, EQ, ER, ES, ET, EU, EV, EW, EX, EY, EZ, E_, F0, F1, F2, F3, F4, F5, F6, F7, F8, F9, Fa, Fb, Fc, Fd, Fe, Ff, Fg, Fh, Fi, Fj, Fk, Fl, Fm, Fn, Fo, Fp, Fq, Fr, Fs, Ft, Fu, Fv, Fw, Fx, Fy, Fz, FA, FB, FC, FD, FE, FF, FG, FH, FI, FJ, FK, FL, FM, FN, FO, FP, FQ, FR, FS, FT, FU, FV, FW, FX, FY, FZ, F_, G0, G1, G2, G3, G4, G5, G6, G7, G8, G9, Ga, Gb, Gc, Gd, Ge, Gf, Gg, Gh, Gi, Gj, Gk, Gl, Gm, Gn, Go, Gp, Gq, Gr, Gs, Gt, Gu, Gv, Gw, Gx, Gy, Gz, GA, GB, GC, GD, GE, GF, GG, GH, GI, GJ, GK, GL, GM, GN, GO, GP, GQ, GR, GS, GT, GU, GV, GW, GX, GY, GZ, G_, H0, H1, H2, H3, H4, H5, H6, H7, H8, H9, Ha, Hb, Hc, Hd, He, Hf, Hg, Hh, Hi, Hj, Hk, Hl, Hm, Hn, Ho, Hp, Hq, Hr, Hs, Ht, Hu, Hv, Hw, Hx, Hy, Hz, HA, HB, HC, HD, HE, HF, HG, HH, HI, HJ, HK, HL, HM, HN, HO, HP, HQ, HR, HS, HT, HU, HV, HW, HX, HY, HZ, H_, I0, I1, I2, I3, I4, I5, I6, I7, I8, I9, Ia, Ib, Ic, Id, Ie, If, Ig, Ih, Ii, Ij, Ik, Il, Im, In, Io, Ip, Iq, Ir, Is, It, Iu, Iv, Iw, Ix, Iy, Iz, IA, IB, IC, ID, IE, IF, IG, IH, II, IJ, IK, IL, IM, IN, IO, IP, IQ, IR, IS, IT, IU, IV, IW, IX, IY, IZ, I_, J0, J1, J2, J3, J4, J5, J6, J7, J8, J9, Ja, Jb, Jc, Jd, Je, Jf, Jg, Jh, Ji, Jj, Jk, Jl, Jm, Jn, Jo, Jp, Jq, Jr, Js, Jt, Ju, Jv, Jw, Jx, Jy, Jz, JA, JB, JC, JD, JE, JF, JG, JH, JI, JJ, JK, JL, JM, JN, JO, JP, JQ, JR, JS, JT, JU, JV, JW, JX, JY, JZ, J_, K0, K1, K2, K3, K4, K5, K6, K7, K8, K9, Ka, Kb, Kc, Kd, Ke, Kf, Kg, Kh, Ki, Kj, Kk, Kl, Km, Kn, Ko, Kp, Kq, Kr, Ks, Kt, Ku, Kv, Kw, Kx, Ky, Kz, KA, KB, KC, KD, KE, KF, KG, KH, KI, KJ, KK, KL, KM, KN, KO, KP, KQ, KR, KS, KT, KU, KV, KW, KX, KY, KZ, K_, L0, L1, L2, L3, L4, L5, L6, L7, L8, L9, La, Lb, Lc, Ld, Le, Lf, Lg, Lh, Li, Lj, Lk, Ll, Lm, Ln, Lo, Lp, Lq, Lr, Ls, Lt, Lu, Lv, Lw, Lx, Ly, Lz, LA, LB, LC, LD, LE, LF, LG, LH, LI, LJ, LK, LL, LM, LN, LO, LP, LQ, LR, LS, LT, LU, LV, LW, LX, LY, LZ, L_, M0, M1, M2, M3, M4, M5, M6, M7, M8, M9, Ma, Mb, Mc, Md, Me, Mf, Mg, Mh, Mi, Mj, Mk, Ml, Mm, Mn, Mo, Mp, Mq, Mr, Ms, Mt, Mu, Mv, Mw, Mx, My, Mz, MA, MB, MC, MD, ME, MF, MG, MH, MI, MJ, MK, ML, MM, MN, MO, MP, MQ, MR, MS, MT, MU, MV, MW, MX, MY, MZ, M_, N0, N1, N2, N3, N4, N5, N6, N7, N8, N9, Na, Nb, Nc, Nd, Ne, Nf, Ng, Nh, Ni, Nj, Nk, Nl, Nm, Nn, No, Np, Nq, Nr, Ns, Nt, Nu, Nv, Nw, Nx, Ny, Nz, NA, NB, NC, ND, NE, NF, NG, NH, NI, NJ, NK, NL, NM, NN, NO, NP, NQ, NR, NS, NT, NU, NV, NW, NX, NY, NZ, N_, O0, O1, O2, O3, O4, O5, O6, O7, O8, O9, Oa, Ob, Oc, Od, Oe, Of, Og, Oh, Oi, Oj, Ok, Ol, Om, On, Oo, Op, Oq, Or, Os, Ot, Ou, Ov, Ow, Ox, Oy, Oz, OA, OB, OC, OD, OE, OF, OG, OH, OI, OJ, OK, OL, OM, ON, OO, OP, OQ, OR, OS, OT, OU, OV, OW, OX, OY, OZ, O_, P0, P1, P2, P3, P4, P5, P6, P7, P8, P9, Pa, Pb, Pc, Pd, Pe, Pf, Pg, Ph, Pi, Pj, Pk, Pl, Pm, Pn, Po, Pp, Pq, Pr, Ps, Pt, Pu, Pv, Pw, Px, Py, Pz, PA, PB, PC, PD, PE, PF, PG, PH, PI, PJ, PK, PL, PM, PN, PO, PP, PQ, PR, PS, PT, PU, PV, PW, PX, PY, PZ, P_, Q0, Q1, Q2, Q3, Q4, Q5, Q6, Q7, Q8, Q9, Qa, Qb, Qc, Qd, Qe, Qf, Qg, Qh, Qi, Qj, Qk, Ql, Qm, Qn, Qo, Qp, Qq, Qr, Qs, Qt, Qu, Qv, Qw, Qx, Qy, Qz, QA, QB, QC, QD, QE, QF, QG, QH, QI, QJ, QK, QL, QM, QN, QO, QP, QQ, QR, QS, QT, QU, QV, QW, QX, QY, QZ, Q_, R0, R1, R2, R3, R4, R5, R6, R7, R8, R9, Ra, Rb, Rc, Rd, Re, Rf, Rg, Rh, Ri, Rj, Rk, Rl, Rm, Rn, Ro, Rp, Rq, Rr, Rs, Rt, Ru, Rv, Rw, Rx, Ry, Rz, RA, RB, RC, RD, RE, RF, RG, RH, RI, RJ, RK, RL, RM, RN, RO, RP, RQ, RR, RS, RT, RU, RV, RW, RX, RY, RZ, R_, S0, S1, S2, S3, S4, S5, S6, S7, S8, S9, Sa, Sb, Sc, Sd, Se, Sf, Sg, Sh, Si, Sj, Sk, Sl, Sm, Sn, So, Sp, Sq, Sr, Ss, St, Su, Sv, Sw, Sx, Sy, Sz, SA, SB, SC, SD, SE, SF, SG, SH, SI, SJ, SK, SL, SM, SN, SO, SP, SQ, SR, SS, ST, SU, SV, SW, SX, SY, SZ, S_, T0, T1, T2, T3, T4, T5, T6, T7, T8, T9, Ta, Tb, Tc, Td, Te, Tf, Tg, Th, Ti, Tj, Tk, Tl, Tm, Tn, To, Tp, Tq, Tr, Ts, Tt, Tu, Tv, Tw, Tx, Ty, Tz, TA, TB, TC, TD, TE, TF, TG, TH, TI, TJ, TK, TL, TM, TN, TO, TP, TQ, TR, TS, TT, TU, TV, TW, TX, TY, TZ, T_, U0, U1, U2, U3, U4, U5, U6, U7, U8, U9, Ua, Ub, Uc, Ud, Ue, Uf, Ug, Uh, Ui, Uj, Uk, Ul, Um, Un, Uo, Up, Uq, Ur, Us, Ut, Uu, Uv, Uw, Ux, Uy, Uz, UA, UB, UC, UD, UE, UF, UG, UH, UI, UJ, UK, UL, UM, UN, UO, UP, UQ, UR, US, UT, UU, UV, UW, UX, UY, UZ, U_, V0, V1, V2, V3, V4, V5, V6, V7, V8, V9, Va, Vb, Vc, Vd, Ve, Vf, Vg, Vh, Vi, Vj, Vk, Vl, Vm, Vn, Vo, Vp, Vq, Vr, Vs, Vt, Vu, Vv, Vw, Vx, Vy, Vz, VA, VB, VC, VD, VE, VF, VG, VH, VI, VJ, VK, VL, VM, VN, VO, VP, VQ, VR, VS, VT, VU, VV, VW, VX, VY, VZ, V_, W0, W1, W2, W3, W4, W5, W6, W7, W8, W9, Wa, Wb, Wc, Wd, We, Wf, Wg, Wh, Wi, Wj, Wk, Wl, Wm, Wn, Wo, Wp, Wq, Wr, Ws, Wt, Wu, Wv, Ww, Wx, Wy, Wz, WA, WB, WC, WD, WE, WF, WG, WH, WI, WJ, WK, WL, WM, WN, WO, WP, WQ, WR, WS, WT, WU, WV, WW, WX, WY, WZ, W_, X0, X1, X2, X3, X4, X5, X6, X7, X8, X9, Xa, Xb, Xc, Xd, Xe, Xf, Xg, Xh, Xi, Xj, Xk, Xl, Xm, Xn, Xo, Xp, Xq, Xr, Xs, Xt, Xu, Xv, Xw, Xx, Xy, Xz, XA, XB, XC, XD, XE, XF, XG, XH, XI, XJ, XK, XL, XM, XN, XO, XP, XQ, XR, XS, XT, XU, XV, XW, XX, XY, XZ, X_, Y0, Y1, Y2, Y3, Y4, Y5, Y6, Y7, Y8, Y9, Ya, Yb, Yc, Yd, Ye, Yf, Yg, Yh, Yi, Yj, Yk, Yl, Ym, Yn, Yo, Yp, Yq, Yr, Ys, Yt, Yu, Yv, Yw, Yx, Yy, Yz, YA, YB, YC, YD, YE, YF, YG, YH, YI, YJ, YK, YL, YM, YN, YO, YP, YQ, YR, YS, YT, YU, YV, YW, YX, YY, YZ, Y_, Z0, Z1, Z2, Z3, Z4, Z5, Z6, Z7, Z8, Z9, Za, Zb, Zc, Zd, Ze, Zf, Zg, Zh, Zi, Zj, Zk, Zl, Zm, Zn, Zo, Zp, Zq, Zr, Zs, Zt, Zu, Zv, Zw, Zx, Zy, Zz, ZA, ZB, ZC, ZD, ZE, ZF, ZG, ZH, ZI, ZJ, ZK, ZL, ZM, ZN, ZO, ZP, ZQ, ZR, ZS, ZT, ZU, ZV, ZW, ZX, ZY, ZZ, Z_, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _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U,XV,XW,XX,XY,XZ,X_,Y0,Y1,Y2,Y3,Y4,Y5,Y6,Y7,Y8,Y9,Ya,Yb,Yc,Yd,Ye,Yf,Yg,Yh,Yi,Yj,Yk,Yl,Ym,Yn,Yo,Yp,Yq,Yr,Ys,Yt,Yu,Yv,Yw,Yx,Yy,Yz,YA,YB,YC,YD,YE,YF,YG,YH,YI,YJ,YK,YL,YM,YN,YO,YP,YQ,YR,YS,YT,YU,YV,YW,YX,YY,YZ,Y_,Z0,Z1,Z2,Z3,Z4,Z5,Z6,Z7,Z8,Z9,Za,Zb,Zc,Zd,Ze,Zf,Zg,Zh,Zi,Zj,Zk,Zl,Zm,Zn,Zo,Zp,Zq,Zr,Zs,Zt,Zu,Zv,Zw,Zx,Zy,Zz,ZA,ZB,ZC,ZD,ZE,ZF,ZG,ZH,ZI,ZJ,ZK,ZL,ZM,ZN,ZO,ZP,ZQ,ZR,ZS,ZT,ZU,ZV,ZW,ZX,ZY,ZZ,Z_,_0,_1,_2,_3,_4,_5,_6,_7,_8,_9,_a,_b,_c,_d,_e,_f,_g,_h,_i,_j,_k,_l,_m,_n,_o,_p,_q,_r,_s,_t,_u,_v,_w,_x,_y,_z,_A,_B,_C,_D,_E,_F,_G,_H,_I,_J,_K,_L,_M,_N,_O,_P,_Q,_R,_S,_T,_U,_V,_W,_X,_Y,_Z,__,a00,a01,a02=1;print(dontrenameme)' }, { 'description': 'Identifier in MemberExpression', 'original': 'local x = y() print(x.someProperty)', 'minified': 'local a=y()print(a.someProperty)' }, { 'description': 'Identifier in MemberExpression', 'original': 'local x = y() print(x["someProperty"])', 'minified': 'local a=y()print(a["someProperty"])' }, { 'description': 'Identifier in MemberExpression', 'original': 'local x = y() print(x:someProperty())', 'minified': 'local a=y()print(a:someProperty())' }, { 'description': 'Variable shortening should not shorten `self` in a function', 'original': 'local t = {num = 2} function t:func() return self.num end', 'minified': 'local a={num=2}function a:func()return self.num end' } ], // TableKey 'TableKey': [ { 'description': 'TableKeyString', 'original': 'function f(x) end function g(y) local h = { x = y } end', 'minified': 'function f(a)end;function g(b)local c={x=b}end', } ], // Miscellaneous 'Miscellaneous': [ { 'description': 'Empty input', 'original': '', 'minified': '' }, { 'description': 'Passing an AST', 'original': {'type':'Chunk','body':[{'type':'AssignmentStatement','variables':[{'type':'Identifier','name':'a','isLocal':false}],'init':[{'type':'NumericLiteral','value':42,'raw':'42'}]}],'comments':[],'globals':[{'type':'Identifier','name':'a','isLocal':false}]}, 'minified': 'a=42' } ], // Error handling 'Error handling': [ { 'description': 'Unknown statement type: `LolStatement`', 'original': {'type':'Chunk','body':[{'type':'LolStatement','variables':[{'type':'Identifier','name':'a','isLocal':false}],'init':[{'type':'NumericLiteral','value':42,'raw':'42'}]}],'comments':[],'globals':[{'type':'Identifier','name':'a','isLocal':false}]}, 'error': TypeError }, { 'description': 'Unknown expression type: `LolExpression`', 'original': {'type':'Chunk','body':[{'type':'AssignmentStatement','variables':[{'type':'LolExpression','name':'a','isLocal':false}],'init':[{'type':'NumericLiteral','value':42,'raw':'42'}]}],'comments':[],'globals':[{'type':'Identifier','name':'a','isLocal':false}]}, 'error': TypeError }, { 'description': 'Missing required AST property: `globals`', 'original': {'type':'Chunk','body':[{'type':'AssignmentStatement','variables':[{'type':'Identifier','name':'a'}],'init':[{'type':'NumericLiteral','value':42,'raw':'42'}]}],'comments':[]}, 'error': Error } ] }; function forEach(array, fn) { var index = -1; var length = array.length; while (++index < length) { fn(array[index]); } } function forOwn(object, fn) { var key; for (key in object) { if (object.hasOwnProperty(key)) { fn(object[key], key); } } } // explicitly call `QUnit.module()` instead of `module()` // in case we are in a CLI environment // `throws` is a reserved word in ES3; alias it to avoid errors var raises = QUnit.assert['throws']; // Extend `Object.prototype` to see if luamin can handle it Object.prototype.preserveIdentifiers = true; QUnit.module('luamin'); forOwn(data, function(items, groupName) { test(groupName, function() { if (groupName == 'Error handling') { forEach(items, function(item) { raises( function() { minify(item.original); }, item.error, item.description ); }); } else { forEach(items, function(item) { equal( minify(item.original), item.minified, item.description ); }); } }); }); /*--------------------------------------------------------------------------*/ // configure QUnit and call `QUnit.start()` for // Narwhal, Node.js, PhantomJS, Rhino, and RingoJS if (!root.document || root.phantom) { QUnit.config.noglobals = true; QUnit.start(); } }(typeof global == 'object' && global || this));