Ejemplo n.º 1
0
        private bool Duplicate(Identifier name)
        {
            var found = matches.ContainsKey(name);

            if (found)
            {
                var key = matches.Keys
                          .FirstOrDefault(x => x.Value == name.Value);
                logger.LogError(
                    $"Duplicate character definition '{name.Value}' (old={key!.Start})",
                    name);
            }
            return(found);
        }
Ejemplo n.º 2
0
 public void Add(Identifier name, IMatch match) =>
 matches.Add(name, match);
Ejemplo n.º 3
0
 public void LogMissing(Identifier name)
 {
     logger.LogError(
         $"Missing character class '{name.Value}'",
         name);
 }
Ejemplo n.º 4
0
 public bool TryFind(Identifier name, out IMatch?match) =>
 matches.TryGetValue(name, out match);