Skip to content

Commit

Permalink
Resolve conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
SlexAxton committed Sep 17, 2014
2 parents 520a022 + 02fe969 commit 91c2bfe
Showing 1 changed file with 15 additions and 8 deletions.
23 changes: 15 additions & 8 deletions jed.js
Expand Up @@ -90,7 +90,9 @@ in order to offer easy upgrades -- jsgettext.berlios.de
}
},
// The default domain if one is missing
"domain" : "messages"
"domain" : "messages",
// enable debug mode to log untranslated strings to the console
"debug" : false
};

// Mix in the sent options with the default options
Expand Down Expand Up @@ -288,6 +290,11 @@ in order to offer easy upgrades -- jsgettext.berlios.de
this.options.missing_key_callback(key, domain);
}
res = [ null, singular_key, plural_key ];

// collect untranslated strings
if (this.options.debug===true) {
console.log(res[ getPluralFormFunc(pluralForms)( val ) + 1 ]);
}
return res[ getPluralFormFunc()( val ) + 1 ];
}

Expand Down Expand Up @@ -600,15 +607,15 @@ performAction: function anonymous(yytext,yyleng,yylineno,yy,yystate,$$,_$) {

var $0 = $$.length - 1;
switch (yystate) {
case 1: return { type : 'GROUP', expr: $$[$0-1] };
case 1: return { type : 'GROUP', expr: $$[$0-1] };
break;
case 2:this.$ = { type: 'TERNARY', expr: $$[$0-4], truthy : $$[$0-2], falsey: $$[$0] };
case 2:this.$ = { type: 'TERNARY', expr: $$[$0-4], truthy : $$[$0-2], falsey: $$[$0] };
break;
case 3:this.$ = { type: "OR", left: $$[$0-2], right: $$[$0] };
break;
case 4:this.$ = { type: "AND", left: $$[$0-2], right: $$[$0] };
break;
case 5:this.$ = { type: 'LT', left: $$[$0-2], right: $$[$0] };
case 5:this.$ = { type: 'LT', left: $$[$0-2], right: $$[$0] };
break;
case 6:this.$ = { type: 'LTE', left: $$[$0-2], right: $$[$0] };
break;
Expand All @@ -622,11 +629,11 @@ case 10:this.$ = { type: 'EQ', left: $$[$0-2], right: $$[$0] };
break;
case 11:this.$ = { type: 'MOD', left: $$[$0-2], right: $$[$0] };
break;
case 12:this.$ = { type: 'GROUP', expr: $$[$0-1] };
case 12:this.$ = { type: 'GROUP', expr: $$[$0-1] };
break;
case 13:this.$ = { type: 'VAR' };
case 13:this.$ = { type: 'VAR' };
break;
case 14:this.$ = { type: 'NUM', val: Number(yytext) };
case 14:this.$ = { type: 'NUM', val: Number(yytext) };
break;
}
},
Expand Down Expand Up @@ -912,7 +919,7 @@ next:function () {
if (this._input === "") {
return this.EOF;
} else {
this.parseError('Lexical error on line '+(this.yylineno+1)+'. Unrecognized text.\n'+this.showPosition(),
this.parseError('Lexical error on line '+(this.yylineno+1)+'. Unrecognized text.\n'+this.showPosition(),
{text: "", token: null, line: this.yylineno});
}
},
Expand Down

0 comments on commit 91c2bfe

Please sign in to comment.