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); }
/// <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; }
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); }