Пример #1
0
 public override void VisitVariableStatement(IVariableStatement variableStatement)
 {
     foreach (var variableDeclaration in variableStatement.DeclarationsEnumerable)
     {
         ProcessProviderFunctionDeclaration(variableDeclaration);
     }
     base.VisitVariableStatement(variableStatement);
 }
Пример #2
0
        public static IType GetTypeOfFirstVariableDeclarationOrDefault(this IVariableStatement variableStatement, ITypeChecker typeChecker)
        {
            var firstDeclaration = GetFirstDeclarationOrDefault(variableStatement);

            if (firstDeclaration == null)
            {
                return(null);
            }

            return(typeChecker.GetTypeAtLocation(firstDeclaration));
        }
Пример #3
0
        /// <summary>
        /// Gets the first declaration of a variable statement
        /// </summary>
        /// <param name="variableStatement">A variable statement</param>
        /// <returns>The first variable declaration within the statement or null if no variable exists</returns>
        public static IDeclaration GetFirstDeclarationOrDefault(this IVariableStatement variableStatement)
        {
            var elements = variableStatement?.DeclarationList?.Declarations;

            if (elements == null || elements.Count == 0)
            {
                return(null);
            }

            return(elements[0]);
        }
Пример #4
0
 /// <inheritdoc />
 public override void VisitVariableStatement(IVariableStatement node)
 {
     Register(node, node.Flags, DocNodeType.Value, node.DeclarationList.Declarations[0].Name.GetText(), base.VisitVariableStatement);
 }
 public override void VisitVariableStatement(IVariableStatement variableStatement)
 {
     foreach (var variableDeclaration in variableStatement.DeclarationsEnumerable)
         ProcessProviderFunctionDeclaration(variableDeclaration);
     base.VisitVariableStatement(variableStatement);
 }
Пример #6
0
 /// <summary>
 /// Uses the containing statement to print statement-level decorators and flags, followed by an individual variable declaration
 /// </summary>
 /// <remarks>
 /// The statement is forced to be an ambient one
 /// </remarks>
 private void AppendSingleVariableStatementAndForceAmbient(IVariableStatement containingStatement, IVariableDeclaration varDeclaration)
 {
     AppendDecoratorsWithPositionFor(containingStatement, varDeclaration);
     AppendFlagsAndForceAmbient(containingStatement.Flags);
     VisitVariableDeclarationList(new VariableDeclarationList(varDeclaration));
 }
Пример #7
0
 private void AppendDecoratorsWithPositionFor(IVariableStatement statement, IVariableDeclaration declaration)
 {
     AppendPositionDecorator(declaration);
     base.AppendDecorators(statement);
 }