mirror of
https://github.com/jashkenas/coffeescript.git
synced 2022-11-09 12:23:24 -05:00
appeasing Jeremy: switching prefix increments out for postfix equivalent
This commit is contained in:
parent
fc0a169a9a
commit
c6c527e830
13 changed files with 72 additions and 63 deletions
|
@ -32,7 +32,7 @@
|
|||
isOption = !!(arg.match(LONG_FLAG) || arg.match(SHORT_FLAG));
|
||||
matchedRule = false;
|
||||
_ref = this.rules;
|
||||
for (_j = 0, _len2 = _ref.length; _j < _len2; ++_j) {
|
||||
for (_j = 0, _len2 = _ref.length; _j < _len2; _j++) {
|
||||
rule = _ref[_j];
|
||||
if (rule.shortFlag === arg || rule.longFlag === arg) {
|
||||
value = rule.hasArgument ? (skippingArgument = true, args[i + 1]) : true;
|
||||
|
@ -57,7 +57,7 @@
|
|||
lines = [];
|
||||
if (this.banner) lines.unshift("" + this.banner + "\n");
|
||||
_ref = this.rules;
|
||||
for (_i = 0, _len = _ref.length; _i < _len; ++_i) {
|
||||
for (_i = 0, _len = _ref.length; _i < _len; _i++) {
|
||||
rule = _ref[_i];
|
||||
spaces = 15 - rule.longFlag.length;
|
||||
spaces = spaces > 0 ? Array(spaces + 1).join(' ') : '';
|
||||
|
@ -82,7 +82,7 @@
|
|||
buildRules = function(rules) {
|
||||
var tuple, _i, _len, _results;
|
||||
_results = [];
|
||||
for (_i = 0, _len = rules.length; _i < _len; ++_i) {
|
||||
for (_i = 0, _len = rules.length; _i < _len; _i++) {
|
||||
tuple = rules[_i];
|
||||
if (tuple.length < 3) tuple.unshift(null);
|
||||
_results.push(buildRule.apply(null, tuple));
|
||||
|
@ -109,11 +109,11 @@
|
|||
var arg, l, match, result, _i, _j, _len, _len2, _ref;
|
||||
args = args.slice(0);
|
||||
result = [];
|
||||
for (_i = 0, _len = args.length; _i < _len; ++_i) {
|
||||
for (_i = 0, _len = args.length; _i < _len; _i++) {
|
||||
arg = args[_i];
|
||||
if (match = arg.match(MULTI_FLAG)) {
|
||||
_ref = match[1].split('');
|
||||
for (_j = 0, _len2 = _ref.length; _j < _len2; ++_j) {
|
||||
for (_j = 0, _len2 = _ref.length; _j < _len2; _j++) {
|
||||
l = _ref[_j];
|
||||
result.push('-' + l);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue