Exemplo n.º 1
0
 internal VariableExpressionAst(VariableToken token) : this(token.Extent, token.VariablePath, token.Kind == TokenKind.SplattedVariable)
 {
 }
Exemplo n.º 2
0
 internal VariableExpressionAst(VariableToken token) : this(token.Extent, token.VariablePath, token.Kind == TokenKind.SplattedVariable)
 {
 }
Exemplo n.º 3
0
 private ExpressionAst CheckUsingVariable(VariableToken variableToken, bool withMemberAccess)
 {
     VariablePath variablePath = variableToken.VariablePath;
     if (!variablePath.IsDriveQualified || !variablePath.DriveName.Equals("using", StringComparison.OrdinalIgnoreCase) || variablePath.UnqualifiedPath.Length <= 0)
     {
         return new VariableExpressionAst(variableToken);
     }
     else
     {
         VariablePath variablePath1 = new VariablePath(variablePath.UnqualifiedPath);
         ExpressionAst variableExpressionAst = new VariableExpressionAst(variableToken.Extent, variablePath1, variableToken.Kind == TokenKind.SplattedVariable);
         if (withMemberAccess)
         {
             variableExpressionAst = this.CheckPostPrimaryExpressionOperators(this.NextMemberAccessToken(true), variableExpressionAst);
         }
         return new UsingExpressionAst(variableExpressionAst.Extent, variableExpressionAst);
     }
 }
Exemplo n.º 4
0
        private ExpressionAst CheckUsingVariable(VariableToken variableToken, bool withMemberAccess)
        {
            var variablePath = variableToken.VariablePath;
            if (variablePath.IsDriveQualified && variablePath.DriveName.Equals("using", StringComparison.OrdinalIgnoreCase) && variablePath.UnqualifiedPath.Length > 0)
            {
                var realVariablePath = new VariablePath(variablePath.UnqualifiedPath);
                ExpressionAst childExpr = new VariableExpressionAst(variableToken.Extent, realVariablePath, (variableToken.Kind == TokenKind.SplattedVariable));
                if (withMemberAccess)
                {
                    childExpr = CheckPostPrimaryExpressionOperators(NextMemberAccessToken(true), childExpr);
                }

                return new UsingExpressionAst(childExpr.Extent, childExpr);
            }
            return new VariableExpressionAst(variableToken);
        }