Exemplo n.º 1
0
        public void DictionaryDeclaration()
        {
            var src    = @"new { a => b; c => true }";
            var result = new NewDictionaryNode
            {
                { Expr.Get("a"), Expr.Get("b") },
                { Expr.Get("c"), Expr.True() }
            };

            TestParser(src, result);
        }
Exemplo n.º 2
0
        /// <summary>
        /// new_dict_line                               = "{" init_dict_expr_block "}"
        /// </summary>
        private NewDictionaryNode parseNewDictLine()
        {
            if (!check(LexemType.CurlyOpen))
                return null;

            var node = new NewDictionaryNode();
            node.Expressions = parseInitExprDictLine().ToList();
            if (node.Expressions.Count == 0)
                error(ParserMessages.DictionaryItem);

            ensure(LexemType.CurlyClose, ParserMessages.SymbolExpected, "}");

            return node;
        }
Exemplo n.º 3
0
        public void DictionaryDeclaration()
        {
            var src = @"new { a => b; c => true }";
            var result = new NewDictionaryNode
            {
                { Expr.Get("a"), Expr.Get("b")},
                { Expr.Get("c"), Expr.True()}
            };

            TestParser(src, result);
        }