diff --git a/grammar_parser.meta b/grammar_parser.meta index b4e48e0..141d8f8 100644 --- a/grammar_parser.meta +++ b/grammar_parser.meta @@ -131,7 +131,7 @@ Object.last() { self[self.length() - 1] } //} //Stream.atEnd() { self.position >= self.limit } -Stream.peek() { !self.atEnd() && self.content[self.position] } +Stream.peek() { self.content[self.position] } //Stream.inc() { !self.atEnd() && { self.position = self.position + 1; } } //Stream.setLastBegin = () { self.lastBegin = self.position; }; @@ -170,7 +170,7 @@ StringLiteral.match(stream, context, actions) { StringLiteral.getMatchingExpression() { //return `(@stream).match(@self.string) && ((@stream).position += len(@self.string)) && @true; return `{ - if (stream.match(@self.string)) { + if (stream.content.compareFrom(stream.position, @self.string) == 0) { stream.position += len(@self.string); @true; } else { @@ -330,7 +330,7 @@ CharacterClass.staticmatch(stream, context, actions, value) { CharacterClass.getMatchingExpression() { //return `CharacterClass.staticmatch(@stream, @context, @actions, @self.value); - return `{ CharacterClass.staticmatch(stream, context, actions, @self.value) }; + return `{ !stream.atEnd() && (@self.value).charClass().bitTest(stream.peek()) && stream.inc() && @true }; } // Dot