private Lexem TransformRegexLiteral(Lexem lex) { return(new Lexem(LexemType.Regex, lex.StartLocation, lex.EndLocation, lex.Value.Replace(@"##", "#"))); }
private bool Equals(Lexem other) { return(Type.Equals(other.Type) && string.Equals(Value, other.Value)); }
private Lexem transformCharLiteral(Lexem lex) { var value = lex.Value; if (value.Length < 3 || value.Length > 4) error(LexerMessages.IncorrectCharLiteral); value = value[1] == '\\' ? escapeChar(value[2]).ToString() : value[1].ToString(); return new Lexem(LexemType.Char, lex.StartLocation, lex.EndLocation, value); }
private Lexem transformRegexLiteral(Lexem lex) { return new Lexem(LexemType.Regex, lex.StartLocation, lex.EndLocation, lex.Value.Replace(@"\#", "#")); }
private bool Equals(Lexem other) { return Type.Equals(other.Type) && string.Equals(Value, other.Value); }