public override sealed bool Match(Parser parser) { if (parser.Code.Length >= parser.Pos + Pattern.Length && parser.Comparer.Compare(parser.Code.Substring(parser.Pos, Pattern.Length), Pattern) == 0) { this.Value = Pattern; parser.GetLineCol(out pos, out line, out col); parser.Advance(Pattern.Length); return true; } else { return false; } }
public sealed override bool Match(Parser parser) { if (parser.Code.Length >= parser.Pos + Pattern.Length && parser.Comparer.Compare(parser.Code.Substring(parser.Pos, Pattern.Length), Pattern) == 0) { this.Value = Pattern; parser.GetLineCol(out pos, out line, out col); parser.Advance(Pattern.Length); return(true); } else { return(false); } }
public override bool Match(Parser parser) { Match m = this.Pattern.Match(parser.Code, parser.Pos); if (m.Success && parser.Comparer.Compare(m.Value, keyword) == 0) { Value = m.Value; parser.GetLineCol(out pos, out line, out col); parser.Advance(m.Length); return(true); } else { return(false); } }
public override sealed bool Match(Parser parser) { Match m = this.Pattern.Match(parser.Code, parser.Pos); // Exclude keywords from matches if (m.Success && !parser.Keywords.Contains(m.Value)) { Value = m.Value; parser.GetLineCol(out pos, out line, out col); parser.Advance(m.Length); return true; } else { return false; } }
public sealed override bool Match(Parser parser) { Match m = this.Pattern.Match(parser.Code, parser.Pos); // Exclude keywords from matches if (m.Success && !parser.Keywords.Contains(m.Value)) { Value = m.Value; parser.GetLineCol(out pos, out line, out col); parser.Advance(m.Length); return(true); } else { return(false); } }