Exemplo n.º 1
0
		public void VisitVariableDeclarationStatement(VariableDeclarationStatement variableDeclarationStatement)
		{
			StartNode(variableDeclarationStatement);
			foreach (var v in variableDeclarationStatement.Variables) {
				WriteModifiers(variableDeclarationStatement.GetChildrenByRole(VariableDeclarationStatement.ModifierRole));
				WriteKeyword ("var");
				v.NameToken.AcceptVisitor (this);
				if (!variableDeclarationStatement.Type.IsNull) {
					WriteToken (Roles.Colon);
					Space ();
					variableDeclarationStatement.Type.AcceptVisitor (this);
				}
				if (!v.Initializer.IsNull) {
					Space(policy.SpaceAroundAssignment);
					WriteToken(Roles.Assign);
					Space(policy.SpaceAroundAssignment);
					v.Initializer.AcceptVisitor(this);
				}
				Semicolon();
			}
			EndNode(variableDeclarationStatement);
		}
Exemplo n.º 2
0
		public void VisitVariableDeclarationStatement(VariableDeclarationStatement variableDeclarationStatement)
		{
			StartNode(variableDeclarationStatement);
			WriteModifiers(variableDeclarationStatement.GetChildrenByRole(VariableDeclarationStatement.ModifierRole));
			variableDeclarationStatement.Type.AcceptVisitor(this);
			Space();
			WriteCommaSeparatedList(variableDeclarationStatement.Variables);
			Semicolon();
			EndNode(variableDeclarationStatement);
		}
Exemplo n.º 3
0
 public void VisitVariableDeclarationStatement(VariableDeclarationStatement variableDeclarationStatement)
 {
     JsonObject statement = CreateJsonStatement(variableDeclarationStatement);
     JsonValue modifier = GetModifiers(variableDeclarationStatement.GetChildrenByRole(VariableDeclarationStatement.ModifierRole));
     if (modifier != null && modifier.ValueType != JsonValueType.Null)
     {
         statement.AddJsonValue("modifier", modifier);
     }
     statement.AddJsonValue("declaration-type-info", GenTypeInfo(variableDeclarationStatement.Type));
     statement.AddJsonValue("variables-list", GetCommaSeparatedList(variableDeclarationStatement.Variables));
     Push(statement);
 }