Use "charAt(...)" instead of "[...]" for accessing string characters (compatibility with IE < 8).

redux
David Majda 15 years ago
parent 28459236aa
commit 09291d6f0f

@ -749,7 +749,7 @@ PEG.Grammar.Class.prototype.compile = function(resultVar) {
return PEG.Compiler.formatCode(
"if (this._input.substr(this._pos).match(${regexp}) !== null) {",
" var ${resultVar} = this._input[this._pos];",
" var ${resultVar} = this._input.charAt(this._pos);",
" this._pos++;",
"} else {",
" var ${resultVar} = null;",
@ -768,7 +768,7 @@ PEG.Grammar.Class.prototype.compile = function(resultVar) {
PEG.Grammar.Any.prototype.compile = function(resultVar) {
return PEG.Compiler.formatCode(
"if (this._input.length > this._pos) {",
" var ${resultVar} = this._input[this._pos];",
" var ${resultVar} = this._input.charAt(this._pos);",
" this._pos++;",
"} else {",
" var ${resultVar} = null;",

@ -836,7 +836,7 @@ PEG.grammarParser = (function(){
if (this._input.substr(this._pos).match(/^[^{}]/) !== null) {
var result97 = this._input[this._pos];
var result97 = this._input.charAt(this._pos);
this._pos++;
} else {
var result97 = null;
@ -1698,7 +1698,7 @@ PEG.grammarParser = (function(){
}
if (result172 !== null) {
if (this._input.length > this._pos) {
var result173 = this._input[this._pos];
var result173 = this._input.charAt(this._pos);
this._pos++;
} else {
var result173 = null;
@ -1902,7 +1902,7 @@ PEG.grammarParser = (function(){
}
if (result193 !== null) {
if (this._input.length > this._pos) {
var result194 = this._input[this._pos];
var result194 = this._input.charAt(this._pos);
this._pos++;
} else {
var result194 = null;
@ -2262,7 +2262,7 @@ PEG.grammarParser = (function(){
}
if (result227 !== null) {
if (this._input.length > this._pos) {
var result228 = this._input[this._pos];
var result228 = this._input.charAt(this._pos);
this._pos++;
} else {
var result228 = null;
@ -2364,7 +2364,7 @@ PEG.grammarParser = (function(){
}
if (result236 !== null) {
if (this._input.length > this._pos) {
var result237 = this._input[this._pos];
var result237 = this._input.charAt(this._pos);
this._pos++;
} else {
var result237 = null;
@ -2641,7 +2641,7 @@ PEG.grammarParser = (function(){
if (this._input.substr(this._pos).match(/^[0-9]/) !== null) {
var result264 = this._input[this._pos];
var result264 = this._input.charAt(this._pos);
this._pos++;
} else {
var result264 = null;
@ -2671,7 +2671,7 @@ PEG.grammarParser = (function(){
if (this._input.substr(this._pos).match(/^[0-9a-fA-F]/) !== null) {
var result265 = this._input[this._pos];
var result265 = this._input.charAt(this._pos);
this._pos++;
} else {
var result265 = null;
@ -2733,7 +2733,7 @@ PEG.grammarParser = (function(){
if (this._input.substr(this._pos).match(/^[a-z]/) !== null) {
var result269 = this._input[this._pos];
var result269 = this._input.charAt(this._pos);
this._pos++;
} else {
var result269 = null;
@ -2763,7 +2763,7 @@ PEG.grammarParser = (function(){
if (this._input.substr(this._pos).match(/^[A-Z]/) !== null) {
var result270 = this._input[this._pos];
var result270 = this._input.charAt(this._pos);
this._pos++;
} else {
var result270 = null;
@ -2910,7 +2910,7 @@ PEG.grammarParser = (function(){
}
if (result283 !== null) {
if (this._input.length > this._pos) {
var result284 = this._input[this._pos];
var result284 = this._input.charAt(this._pos);
this._pos++;
} else {
var result284 = null;
@ -2944,7 +2944,7 @@ PEG.grammarParser = (function(){
}
if (result283 !== null) {
if (this._input.length > this._pos) {
var result284 = this._input[this._pos];
var result284 = this._input.charAt(this._pos);
this._pos++;
} else {
var result284 = null;
@ -3028,7 +3028,7 @@ PEG.grammarParser = (function(){
}
if (result291 !== null) {
if (this._input.length > this._pos) {
var result292 = this._input[this._pos];
var result292 = this._input.charAt(this._pos);
this._pos++;
} else {
var result292 = null;
@ -3070,7 +3070,7 @@ PEG.grammarParser = (function(){
}
if (result291 !== null) {
if (this._input.length > this._pos) {
var result292 = this._input[this._pos];
var result292 = this._input.charAt(this._pos);
this._pos++;
} else {
var result292 = null;
@ -3225,7 +3225,7 @@ PEG.grammarParser = (function(){
if (this._input.substr(this._pos).match(/^[\n\r\u2028\u2029]/) !== null) {
var result300 = this._input[this._pos];
var result300 = this._input.charAt(this._pos);
this._pos++;
} else {
var result300 = null;
@ -3256,7 +3256,7 @@ PEG.grammarParser = (function(){
var savedReportMatchFailures = context.reportMatchFailures;
context.reportMatchFailures = false;
if (this._input.substr(this._pos).match(/^[   - ]/) !== null) {
var result301 = this._input[this._pos];
var result301 = this._input.charAt(this._pos);
this._pos++;
} else {
var result301 = null;

Loading…
Cancel
Save