예제 #1
0
파일: Parser.cs 프로젝트: nickchal/pash
 private ExpressionAst ErrorRecoveryParameterInExpression(ParameterToken paramToken, ExpressionAst expr)
 {
     object[] text = new object[1];
     text[0] = paramToken.Text;
     this.ReportError(paramToken.Extent, ParserStrings.UnexpectedToken, text);
     this.SkipToken();
     Ast[] commandParameterAst = new Ast[2];
     commandParameterAst[0] = expr;
     commandParameterAst[1] = new CommandParameterAst(paramToken.Extent, paramToken.ParameterName, null, paramToken.Extent);
     return new ErrorExpressionAst(Parser.ExtentOf(expr, paramToken), commandParameterAst);
 }
예제 #2
0
파일: Parser.cs 프로젝트: dfinke/powershell
        private ExpressionAst ErrorRecoveryParameterInExpression(ParameterToken paramToken, ExpressionAst expr)
        {
            // ErrorRecovery - when we have a parameter in an expression, eat it under the assumption
            // that it's an incomplete operator.  This simplifies analysis later, e.g. trying to autocomplete
            // operators.

            ReportError(paramToken.Extent, () => ParserStrings.UnexpectedToken, paramToken.Text);
            SkipToken();
            return new ErrorExpressionAst(ExtentOf(expr, paramToken),
                new Ast[] {
                    expr,
                    new CommandParameterAst(paramToken.Extent, paramToken.ParameterName, null, paramToken.Extent)});
        }