コード例 #1
0
ファイル: Parser.cs プロジェクト: Timwi/ParseCs
        private static bool removeNullable(CsExpression expr)
        {
            var bin = expr as CsBinaryOperatorExpression;
            var typeOp = expr as CsBinaryTypeOperatorExpression;

            if (bin != null)
            {
                var result = removeNullable(bin.Right);
                if (result)
                    bin.EndIndex = bin.Right.EndIndex;
                return result;
            }
            else if (typeOp != null)
            {
                var nullable = typeOp.Right as CsNullableTypeName;
                if (typeOp.Operator == BinaryTypeOperator.Is && nullable != null)
                {
                    typeOp.Right = nullable.InnerType;
                    typeOp.EndIndex = nullable.InnerType.EndIndex;
                    return true;
                }
            }
            return false;
        }
コード例 #2
0
ファイル: ParseTree.cs プロジェクト: Timwi/ParseCs
 internal static ResolveContext ToResolveContext(CsExpression expr, NameResolver resolver, bool isChecked)
 {
     return expr.ToResolveContext(resolver, isChecked);
 }