public void Visit(JsonExpression expression) { Builder.Append("{"); indent++; foreach (var value in expression.Values) { Indent(); Builder.Append("\"").Append(value.Key).Append("\": "); value.Value.Accept(this); } indent--; Indent(); Builder.Append("}"); }
public void Visit(JsonExpression json) { JsObject instance = Global.ObjectClass.New(); JsScope scope = new JsScope() { Prototype = CurrentScope }; scope.DefineOwnProperty(JsInstance.THIS, instance); EnterScope(scope); try { foreach (var item in json.Values) { item.Value.Accept(this); instance.DefineOwnProperty(item.Key, Result); } } finally { ExitScope(); } Result = instance; }
public void Visit(JsonExpression json) { JsObject instance = Global.ObjectClass.New(); foreach (var item in json.Values) { Result = instance; item.Value.Accept(this); } Result = instance; }
void Analyze(JsonExpression Stmt) { SetCurrentLineAndCharNos(Stmt); if (Stmt.Values != null) { foreach(string Name in Stmt.Values.Keys) { //if (Name != null) Analyzer.CheckIdentifier(Name); Analyze(Stmt.Values[Name]); } } }