Trying a different check for regex productions.
This commit is contained in:
parent
6c58f8b8a3
commit
26e7b3936e
|
@ -111,10 +111,10 @@
|
|||
return this.fail();
|
||||
}
|
||||
this.input = this.input.substr(((probe[1] != null) && putback ? probe[1].length : probe[0].length));
|
||||
if (probe[1] != null) {
|
||||
return probe[1];
|
||||
} else {
|
||||
if (probe[1] === undefined) {
|
||||
return probe[0];
|
||||
} else {
|
||||
return probe[1];
|
||||
}
|
||||
};
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ exports.ReParse = class ReParse
|
|||
probe = @input.match pattern
|
||||
return @fail() unless probe
|
||||
@input = @input.substr (if probe[1]? and putback then probe[1].length else probe[0].length)
|
||||
if probe[1]? then probe[1] else probe[0]
|
||||
if probe[1] is `undefined` then probe[0] else probe[1]
|
||||
|
||||
# Attempts to apply the method and produce a value. If it fails,
|
||||
# restores the input to the previous state.
|
||||
|
|
Loading…
Reference in New Issue