Esempio n. 1
0
 public Map <string, object> ToMap(System.Collections.IDictionary dict)
 {
     if (comparer.CaseInsensitive)
     {
         return(delegate(string k)
         {
             return dict[k.ToLower()];
         });
     }
     else
     {
         return(Functors.AsMap <string, object>(dict));
     }
 }
Esempio n. 2
0
        internal static WordsData instance(string[] names)
        {
            Hashtable operators = new Hashtable();

            string[] ops = sort(names);
            Lexer[]  lxs = new Lexer[ops.Length];
            for (int i = 0; i < ops.Length; i++)
            {
                string  s       = ops[i];
                Scanner scanner = s.Length == 1 ? Scanners.IsChar(s[0]) : Scanners.IsString(s);
                object  tok     = Tokens.CreateReservedWordToken(s);
                operators[s] = tok;
                Lexer lx = Lexers.Lex(scanner, Tokenizers.ForValue(tok));
                lxs[i] = lx;
            }
            return(new WordsData(Functors.AsMap <string, object>(operators), lxs));
        }