Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
01ba1e71
R
roslyn
项目概览
lwm1986
/
roslyn
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
R
roslyn
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
01ba1e71
编写于
8月 14, 2017
作者:
F
Fredric Silberberg
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Refactored ILabelStatement to ILabeledStatement.
上级
7902721e
变更
23
显示空白变更内容
内联
并排
Showing
23 changed file
with
113 addition
and
113 deletion
+113
-113
src/Compilers/CSharp/Portable/Operations/CSharpOperationFactory.cs
...lers/CSharp/Portable/Operations/CSharpOperationFactory.cs
+5
-5
src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IForLoopStatement.cs
.../Semantic/IOperation/IOperationTests_IForLoopStatement.cs
+2
-2
src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IWhileUntilLoopStatement.cs
...ic/IOperation/IOperationTests_IWhileUntilLoopStatement.cs
+2
-2
src/Compilers/Core/Portable/Generated/Operations.xml.Generated.cs
...ilers/Core/Portable/Generated/Operations.xml.Generated.cs
+17
-17
src/Compilers/Core/Portable/Operations/ILabeledStatement.cs
src/Compilers/Core/Portable/Operations/ILabeledStatement.cs
+2
-2
src/Compilers/Core/Portable/Operations/OperationCloner.cs
src/Compilers/Core/Portable/Operations/OperationCloner.cs
+2
-2
src/Compilers/Core/Portable/Operations/OperationKind.cs
src/Compilers/Core/Portable/Operations/OperationKind.cs
+2
-2
src/Compilers/Core/Portable/Operations/OperationVisitor.cs
src/Compilers/Core/Portable/Operations/OperationVisitor.cs
+2
-2
src/Compilers/Core/Portable/PublicAPI.Unshipped.txt
src/Compilers/Core/Portable/PublicAPI.Unshipped.txt
+6
-6
src/Compilers/VisualBasic/Portable/Operations/VisualBasicOperationFactory.vb
...lBasic/Portable/Operations/VisualBasicOperationFactory.vb
+3
-3
src/Compilers/VisualBasic/Test/Semantic/Binding/BindingCollectionInitializerTests.vb
...est/Semantic/Binding/BindingCollectionInitializerTests.vb
+1
-1
src/Compilers/VisualBasic/Test/Semantic/Binding/BindingObjectInitializerTests.vb
...ic/Test/Semantic/Binding/BindingObjectInitializerTests.vb
+4
-4
src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IBlockStatement_MethodBlocks.vb
...Operation/IOperationTests_IBlockStatement_MethodBlocks.vb
+18
-18
src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IConversionExpression.vb
...antic/IOperation/IOperationTests_IConversionExpression.vb
+16
-16
src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IObjectCreationExpression.vb
...c/IOperation/IOperationTests_IObjectCreationExpression.vb
+2
-2
src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IParameterReferenceExpression.vb
...peration/IOperationTests_IParameterReferenceExpression.vb
+2
-2
src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IWhileUntilLoopStatement.vb
...ic/IOperation/IOperationTests_IWhileUntilLoopStatement.vb
+2
-2
src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_InvalidExpression.vb
.../Semantic/IOperation/IOperationTests_InvalidExpression.vb
+2
-2
src/Compilers/VisualBasic/Test/Semantic/Semantics/AnonymousTypesTests.vb
...isualBasic/Test/Semantic/Semantics/AnonymousTypesTests.vb
+14
-14
src/Compilers/VisualBasic/Test/Semantic/Semantics/SelectCaseTests.vb
...rs/VisualBasic/Test/Semantic/Semantics/SelectCaseTests.vb
+2
-2
src/Test/Utilities/Portable/Compilation/OperationTreeVerifier.cs
...t/Utilities/Portable/Compilation/OperationTreeVerifier.cs
+3
-3
src/Test/Utilities/Portable/Compilation/TestOperationWalker.cs
...est/Utilities/Portable/Compilation/TestOperationWalker.cs
+2
-2
src/Test/Utilities/Portable/Diagnostics/OperationTestAnalyzer.cs
...t/Utilities/Portable/Diagnostics/OperationTestAnalyzer.cs
+2
-2
未找到文件。
src/Compilers/CSharp/Portable/Operations/CSharpOperationFactory.cs
浏览文件 @
01ba1e71
...
...
@@ -1264,24 +1264,24 @@ private IVariableDeclarationStatement CreateBoundMultipleLocalDeclarationsOperat
return
new
LazyVariableDeclarationStatement
(
declarations
,
_semanticModel
,
syntax
,
type
,
constantValue
);
}
private
ILabelStatement
CreateBoundLabelStatementOperation
(
BoundLabelStatement
boundLabelStatement
)
private
ILabel
ed
Statement
CreateBoundLabelStatementOperation
(
BoundLabelStatement
boundLabelStatement
)
{
ILabelSymbol
label
=
boundLabelStatement
.
Label
;
Lazy
<
IOperation
>
labeledS
tatement
=
new
Lazy
<
IOperation
>(()
=>
Create
(
null
));
Lazy
<
IOperation
>
s
tatement
=
new
Lazy
<
IOperation
>(()
=>
Create
(
null
));
SyntaxNode
syntax
=
boundLabelStatement
.
Syntax
;
ITypeSymbol
type
=
null
;
Optional
<
object
>
constantValue
=
default
(
Optional
<
object
>);
return
new
LazyLabel
Statement
(
label
,
labeledS
tatement
,
_semanticModel
,
syntax
,
type
,
constantValue
);
return
new
LazyLabel
edStatement
(
label
,
s
tatement
,
_semanticModel
,
syntax
,
type
,
constantValue
);
}
private
ILabelStatement
CreateBoundLabeledStatementOperation
(
BoundLabeledStatement
boundLabeledStatement
)
private
ILabel
ed
Statement
CreateBoundLabeledStatementOperation
(
BoundLabeledStatement
boundLabeledStatement
)
{
ILabelSymbol
label
=
boundLabeledStatement
.
Label
;
Lazy
<
IOperation
>
labeledStatement
=
new
Lazy
<
IOperation
>(()
=>
Create
(
boundLabeledStatement
.
Body
));
SyntaxNode
syntax
=
boundLabeledStatement
.
Syntax
;
ITypeSymbol
type
=
null
;
Optional
<
object
>
constantValue
=
default
(
Optional
<
object
>);
return
new
LazyLabelStatement
(
label
,
labeledStatement
,
_semanticModel
,
syntax
,
type
,
constantValue
);
return
new
LazyLabel
ed
Statement
(
label
,
labeledStatement
,
_semanticModel
,
syntax
,
type
,
constantValue
);
}
private
IExpressionStatement
CreateBoundExpressionStatementOperation
(
BoundExpressionStatement
boundExpressionStatement
)
...
...
src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IForLoopStatement.cs
浏览文件 @
01ba1e71
...
...
@@ -911,8 +911,8 @@ static void Main(string[] args)
Right: ILiteralExpression (Text: 1) (OperationKind.LiteralExpression, Type: System.Int32, Constant: 1) (Syntax: '1')
Body: IBlockStatement (2 statements) (OperationKind.BlockStatement) (Syntax: '{ ... }')
IBranchStatement (BranchKind.GoTo, Label: stop) (OperationKind.BranchStatement) (Syntax: 'goto stop;')
ILabel
Statement (Label: stop) (OperationKind.Label
Statement) (Syntax: 'stop: ... j = j + 1;')
Labeled
Statement: IExpressionStatement (OperationKind.ExpressionStatement) (Syntax: 'j = j + 1;')
ILabel
edStatement (Label: stop) (OperationKind.Labeled
Statement) (Syntax: 'stop: ... j = j + 1;')
Statement: IExpressionStatement (OperationKind.ExpressionStatement) (Syntax: 'j = j + 1;')
Expression: ISimpleAssignmentExpression (OperationKind.SimpleAssignmentExpression, Type: System.Int32) (Syntax: 'j = j + 1')
Left: ILocalReferenceExpression: j (OperationKind.LocalReferenceExpression, Type: System.Int32) (Syntax: 'j')
Right: IBinaryOperatorExpression (BinaryOperationKind.IntegerAdd) (OperationKind.BinaryOperatorExpression, Type: System.Int32) (Syntax: 'j + 1')
...
...
src/Compilers/CSharp/Test/Semantic/IOperation/IOperationTests_IWhileUntilLoopStatement.cs
浏览文件 @
01ba1e71
...
...
@@ -434,8 +434,8 @@ public static int GetFirstEvenNumber(int number)
IExpressionStatement (OperationKind.ExpressionStatement) (Syntax: 'number++;')
Expression: IIncrementExpression (UnaryOperandKind.IntegerPostfixIncrement) (OperationKind.IncrementExpression, Type: System.Int32) (Syntax: 'number++')
Left: IParameterReferenceExpression: number (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'number')
ILabel
Statement (Label: Even) (OperationKind.Label
Statement) (Syntax: 'Even: ... urn number;')
Labeled
Statement: IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'return number;')
ILabel
edStatement (Label: Even) (OperationKind.Labeled
Statement) (Syntax: 'Even: ... urn number;')
Statement: IReturnStatement (OperationKind.ReturnStatement) (Syntax: 'return number;')
ReturnedValue: IParameterReferenceExpression: number (OperationKind.ParameterReferenceExpression, Type: System.Int32) (Syntax: 'number')
"
;
VerifyOperationTreeForTest
<
WhileStatementSyntax
>(
source
,
expectedOperationTree
);
...
...
src/Compilers/Core/Portable/Generated/Operations.xml.Generated.cs
浏览文件 @
01ba1e71
...
...
@@ -2583,10 +2583,10 @@ public LazyIsTypeExpression(Lazy<IOperation> operand, ITypeSymbol isType, Semant
/// <summary>
/// Represents a C# or VB label statement.
/// </summary>
internal
abstract
partial
class
BaseLabel
Statement
:
Operation
,
ILabel
Statement
internal
abstract
partial
class
BaseLabel
edStatement
:
Operation
,
ILabeled
Statement
{
protected
BaseLabelStatement
(
ILabelSymbol
label
,
SemanticModel
semanticModel
,
SyntaxNode
syntax
,
ITypeSymbol
type
,
Optional
<
object
>
constantValue
)
:
base
(
OperationKind
.
LabelStatement
,
semanticModel
,
syntax
,
type
,
constantValue
)
protected
BaseLabel
ed
Statement
(
ILabelSymbol
label
,
SemanticModel
semanticModel
,
SyntaxNode
syntax
,
ITypeSymbol
type
,
Optional
<
object
>
constantValue
)
:
base
(
OperationKind
.
Label
ed
Statement
,
semanticModel
,
syntax
,
type
,
constantValue
)
{
Label
=
label
;
}
...
...
@@ -2594,55 +2594,55 @@ internal abstract partial class BaseLabelStatement : Operation, ILabelStatement
/// Label that can be the target of branches.
/// </summary>
public
ILabelSymbol
Label
{
get
;
}
protected
abstract
IOperation
Labeled
StatementImpl
{
get
;
}
protected
abstract
IOperation
StatementImpl
{
get
;
}
public
override
IEnumerable
<
IOperation
>
Children
{
get
{
yield
return
Labeled
Statement
;
yield
return
Statement
;
}
}
/// <summary>
/// Statement that has been labeled.
/// </summary>
public
IOperation
LabeledStatement
=>
Operation
.
SetParentOperation
(
Labeled
StatementImpl
,
this
);
public
IOperation
Statement
=>
Operation
.
SetParentOperation
(
StatementImpl
,
this
);
public
override
void
Accept
(
OperationVisitor
visitor
)
{
visitor
.
VisitLabelStatement
(
this
);
visitor
.
VisitLabel
ed
Statement
(
this
);
}
public
override
TResult
Accept
<
TArgument
,
TResult
>(
OperationVisitor
<
TArgument
,
TResult
>
visitor
,
TArgument
argument
)
{
return
visitor
.
VisitLabelStatement
(
this
,
argument
);
return
visitor
.
VisitLabel
ed
Statement
(
this
,
argument
);
}
}
/// <summary>
/// Represents a C# or VB label statement.
/// </summary>
internal
sealed
partial
class
Label
Statement
:
BaseLabelStatement
,
ILabel
Statement
internal
sealed
partial
class
Label
edStatement
:
BaseLabeledStatement
,
ILabeled
Statement
{
public
LabelStatement
(
ILabelSymbol
label
,
IOperation
labeledStatement
,
SemanticModel
semanticModel
,
SyntaxNode
syntax
,
ITypeSymbol
type
,
Optional
<
object
>
constantValue
)
:
public
Label
ed
Statement
(
ILabelSymbol
label
,
IOperation
labeledStatement
,
SemanticModel
semanticModel
,
SyntaxNode
syntax
,
ITypeSymbol
type
,
Optional
<
object
>
constantValue
)
:
base
(
label
,
semanticModel
,
syntax
,
type
,
constantValue
)
{
Labeled
StatementImpl
=
labeledStatement
;
StatementImpl
=
labeledStatement
;
}
protected
override
IOperation
Labeled
StatementImpl
{
get
;
}
protected
override
IOperation
StatementImpl
{
get
;
}
}
/// <summary>
/// Represents a C# or VB label statement.
/// </summary>
internal
sealed
partial
class
LazyLabel
Statement
:
BaseLabelStatement
,
ILabel
Statement
internal
sealed
partial
class
LazyLabel
edStatement
:
BaseLabeledStatement
,
ILabeled
Statement
{
private
readonly
Lazy
<
IOperation
>
_lazy
Labeled
Statement
;
private
readonly
Lazy
<
IOperation
>
_lazyStatement
;
public
LazyLabel
Statement
(
ILabelSymbol
label
,
Lazy
<
IOperation
>
labeledS
tatement
,
SemanticModel
semanticModel
,
SyntaxNode
syntax
,
ITypeSymbol
type
,
Optional
<
object
>
constantValue
)
:
base
(
label
,
semanticModel
,
syntax
,
type
,
constantValue
)
public
LazyLabel
edStatement
(
ILabelSymbol
label
,
Lazy
<
IOperation
>
s
tatement
,
SemanticModel
semanticModel
,
SyntaxNode
syntax
,
ITypeSymbol
type
,
Optional
<
object
>
constantValue
)
:
base
(
label
,
semanticModel
,
syntax
,
type
,
constantValue
)
{
_lazy
LabeledStatement
=
labeledStatement
??
throw
new
System
.
ArgumentNullException
(
nameof
(
labeledS
tatement
));
_lazy
Statement
=
statement
??
throw
new
System
.
ArgumentNullException
(
nameof
(
s
tatement
));
}
protected
override
IOperation
LabeledStatementImpl
=>
_lazyLabeled
Statement
.
Value
;
protected
override
IOperation
StatementImpl
=>
_lazy
Statement
.
Value
;
}
/// <summary>
...
...
src/Compilers/Core/Portable/Operations/ILabelStatement.cs
→
src/Compilers/Core/Portable/Operations/ILabel
ed
Statement.cs
浏览文件 @
01ba1e71
...
...
@@ -11,7 +11,7 @@ namespace Microsoft.CodeAnalysis.Semantics
/// This interface is reserved for implementation by its associated APIs. We reserve the right to
/// change it in the future.
/// </remarks>
public
interface
ILabelStatement
:
IOperation
public
interface
ILabel
ed
Statement
:
IOperation
{
/// <summary>
/// Label that can be the target of branches.
...
...
@@ -20,7 +20,7 @@ public interface ILabelStatement : IOperation
/// <summary>
/// Statement that has been labeled.
/// </summary>
IOperation
Labeled
Statement
{
get
;
}
IOperation
Statement
{
get
;
}
}
}
src/Compilers/Core/Portable/Operations/OperationCloner.cs
浏览文件 @
01ba1e71
...
...
@@ -99,9 +99,9 @@ public override IOperation VisitForEachLoopStatement(IForEachLoopStatement opera
return
new
ForEachLoopStatement
(
operation
.
IterationVariable
,
Visit
(
operation
.
Collection
),
operation
.
LoopKind
,
Visit
(
operation
.
Body
),
((
Operation
)
operation
).
SemanticModel
,
operation
.
Syntax
,
operation
.
Type
,
operation
.
ConstantValue
);
}
public
override
IOperation
VisitLabel
Statement
(
ILabel
Statement
operation
,
object
argument
)
public
override
IOperation
VisitLabel
edStatement
(
ILabeled
Statement
operation
,
object
argument
)
{
return
new
Label
Statement
(
operation
.
Label
,
Visit
(
operation
.
Labeled
Statement
),
((
Operation
)
operation
).
SemanticModel
,
operation
.
Syntax
,
operation
.
Type
,
operation
.
ConstantValue
);
return
new
Label
edStatement
(
operation
.
Label
,
Visit
(
operation
.
Statement
),
((
Operation
)
operation
).
SemanticModel
,
operation
.
Syntax
,
operation
.
Type
,
operation
.
ConstantValue
);
}
public
override
IOperation
VisitBranchStatement
(
IBranchStatement
operation
,
object
argument
)
...
...
src/Compilers/Core/Portable/Operations/OperationKind.cs
浏览文件 @
01ba1e71
...
...
@@ -25,8 +25,8 @@ public enum OperationKind
IfStatement
=
0x5
,
/// <summary>Indicates an <see cref="ILoopStatement"/>.</summary>
LoopStatement
=
0x6
,
/// <summary>Indicates an <see cref="ILabelStatement"/>.</summary>
LabelStatement
=
0x7
,
/// <summary>Indicates an <see cref="ILabel
ed
Statement"/>.</summary>
Label
ed
Statement
=
0x7
,
/// <summary>Indicates an <see cref="IBranchStatement"/>.</summary>
BranchStatement
=
0x8
,
/// <summary>Indicates an <see cref="IEmptyStatement"/>.</summary>
...
...
src/Compilers/Core/Portable/Operations/OperationVisitor.cs
浏览文件 @
01ba1e71
...
...
@@ -90,7 +90,7 @@ public virtual void VisitForEachLoopStatement(IForEachLoopStatement operation)
DefaultVisit
(
operation
);
}
public
virtual
void
VisitLabel
Statement
(
ILabel
Statement
operation
)
public
virtual
void
VisitLabel
edStatement
(
ILabeled
Statement
operation
)
{
DefaultVisit
(
operation
);
}
...
...
@@ -560,7 +560,7 @@ public virtual TResult VisitForEachLoopStatement(IForEachLoopStatement operation
return
DefaultVisit
(
operation
,
argument
);
}
public
virtual
TResult
VisitLabel
Statement
(
ILabel
Statement
operation
,
TArgument
argument
)
public
virtual
TResult
VisitLabel
edStatement
(
ILabeled
Statement
operation
,
TArgument
argument
)
{
return
DefaultVisit
(
operation
,
argument
);
}
...
...
src/Compilers/Core/Portable/PublicAPI.Unshipped.txt
浏览文件 @
01ba1e71
...
...
@@ -90,7 +90,7 @@ Microsoft.CodeAnalysis.OperationKind.InvalidStatement = 1 -> Microsoft.CodeAnaly
Microsoft.CodeAnalysis.OperationKind.InvocationExpression = 259 -> Microsoft.CodeAnalysis.OperationKind
Microsoft.CodeAnalysis.OperationKind.IsPatternExpression = 517 -> Microsoft.CodeAnalysis.OperationKind
Microsoft.CodeAnalysis.OperationKind.IsTypeExpression = 278 -> Microsoft.CodeAnalysis.OperationKind
Microsoft.CodeAnalysis.OperationKind.LabelStatement = 7 -> Microsoft.CodeAnalysis.OperationKind
Microsoft.CodeAnalysis.OperationKind.Label
ed
Statement = 7 -> Microsoft.CodeAnalysis.OperationKind
Microsoft.CodeAnalysis.OperationKind.LambdaExpression = 273 -> Microsoft.CodeAnalysis.OperationKind
Microsoft.CodeAnalysis.OperationKind.LiteralExpression = 257 -> Microsoft.CodeAnalysis.OperationKind
Microsoft.CodeAnalysis.OperationKind.LocalFunctionStatement = 49 -> Microsoft.CodeAnalysis.OperationKind
...
...
@@ -482,9 +482,9 @@ Microsoft.CodeAnalysis.Semantics.IIsPatternExpression.Pattern.get -> Microsoft.C
Microsoft.CodeAnalysis.Semantics.IIsTypeExpression
Microsoft.CodeAnalysis.Semantics.IIsTypeExpression.IsType.get -> Microsoft.CodeAnalysis.ITypeSymbol
Microsoft.CodeAnalysis.Semantics.IIsTypeExpression.Operand.get -> Microsoft.CodeAnalysis.IOperation
Microsoft.CodeAnalysis.Semantics.ILabelStatement
Microsoft.CodeAnalysis.Semantics.ILabelStatement.Label.get -> Microsoft.CodeAnalysis.ILabelSymbol
Microsoft.CodeAnalysis.Semantics.ILabel
Statement.Labeled
Statement.get -> Microsoft.CodeAnalysis.IOperation
Microsoft.CodeAnalysis.Semantics.ILabel
ed
Statement
Microsoft.CodeAnalysis.Semantics.ILabel
ed
Statement.Label.get -> Microsoft.CodeAnalysis.ILabelSymbol
Microsoft.CodeAnalysis.Semantics.ILabel
edStatement.
Statement.get -> Microsoft.CodeAnalysis.IOperation
Microsoft.CodeAnalysis.Semantics.ILambdaExpression
Microsoft.CodeAnalysis.Semantics.ILambdaExpression.Body.get -> Microsoft.CodeAnalysis.Semantics.IBlockStatement
Microsoft.CodeAnalysis.Semantics.ILambdaExpression.Signature.get -> Microsoft.CodeAnalysis.IMethodSymbol
...
...
@@ -818,7 +818,7 @@ virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitInvalidStatement(
virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitInvocationExpression(Microsoft.CodeAnalysis.Semantics.IInvocationExpression operation) -> void
virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitIsPatternExpression(Microsoft.CodeAnalysis.Semantics.IIsPatternExpression operation) -> void
virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitIsTypeExpression(Microsoft.CodeAnalysis.Semantics.IIsTypeExpression operation) -> void
virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitLabel
Statement(Microsoft.CodeAnalysis.Semantics.ILabel
Statement operation) -> void
virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitLabel
edStatement(Microsoft.CodeAnalysis.Semantics.ILabeled
Statement operation) -> void
virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitLambdaExpression(Microsoft.CodeAnalysis.Semantics.ILambdaExpression operation) -> void
virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitLiteralExpression(Microsoft.CodeAnalysis.Semantics.ILiteralExpression operation) -> void
virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor.VisitLocalFunctionStatement(Microsoft.CodeAnalysis.Semantics.ILocalFunctionStatement operation) -> void
...
...
@@ -908,7 +908,7 @@ virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor<TArgument, TResult>.Vi
virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor<TArgument, TResult>.VisitInvocationExpression(Microsoft.CodeAnalysis.Semantics.IInvocationExpression operation, TArgument argument) -> TResult
virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor<TArgument, TResult>.VisitIsPatternExpression(Microsoft.CodeAnalysis.Semantics.IIsPatternExpression operation, TArgument argument) -> TResult
virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor<TArgument, TResult>.VisitIsTypeExpression(Microsoft.CodeAnalysis.Semantics.IIsTypeExpression operation, TArgument argument) -> TResult
virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor<TArgument, TResult>.VisitLabel
Statement(Microsoft.CodeAnalysis.Semantics.ILabel
Statement operation, TArgument argument) -> TResult
virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor<TArgument, TResult>.VisitLabel
edStatement(Microsoft.CodeAnalysis.Semantics.ILabeled
Statement operation, TArgument argument) -> TResult
virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor<TArgument, TResult>.VisitLambdaExpression(Microsoft.CodeAnalysis.Semantics.ILambdaExpression operation, TArgument argument) -> TResult
virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor<TArgument, TResult>.VisitLiteralExpression(Microsoft.CodeAnalysis.Semantics.ILiteralExpression operation, TArgument argument) -> TResult
virtual Microsoft.CodeAnalysis.Semantics.OperationVisitor<TArgument, TResult>.VisitLocalFunctionStatement(Microsoft.CodeAnalysis.Semantics.ILocalFunctionStatement operation, TArgument argument) -> TResult
...
...
src/Compilers/VisualBasic/Portable/Operations/VisualBasicOperationFactory.vb
浏览文件 @
01ba1e71
...
...
@@ -999,13 +999,13 @@ Namespace Microsoft.CodeAnalysis.Semantics
Return
New
LazyReturnStatement
(
OperationKind
.
YieldReturnStatement
,
returnedValue
,
_semanticModel
,
syntax
,
type
,
constantValue
)
End
Function
Private
Function
CreateBoundLabelStatementOperation
(
boundLabelStatement
As
BoundLabelStatement
)
As
ILabelStatement
Private
Function
CreateBoundLabelStatementOperation
(
boundLabelStatement
As
BoundLabelStatement
)
As
ILabel
ed
Statement
Dim
label
As
ILabelSymbol
=
boundLabelStatement
.
Label
Dim
labeledS
tatement
As
Lazy
(
Of
IOperation
)
=
New
Lazy
(
Of
IOperation
)(
Function
()
Nothing
)
Dim
s
tatement
As
Lazy
(
Of
IOperation
)
=
New
Lazy
(
Of
IOperation
)(
Function
()
Nothing
)
Dim
syntax
As
SyntaxNode
=
boundLabelStatement
.
Syntax
Dim
type
As
ITypeSymbol
=
Nothing
Dim
constantValue
As
[
Optional
]
(
Of
Object
)
=
New
[
Optional
]
(
Of
Object
)()
Return
New
LazyLabel
Statement
(
label
,
labeledS
tatement
,
_semanticModel
,
syntax
,
type
,
constantValue
)
Return
New
LazyLabel
edStatement
(
label
,
s
tatement
,
_semanticModel
,
syntax
,
type
,
constantValue
)
End
Function
Private
Function
CreateBoundGotoStatementOperation
(
boundGotoStatement
As
BoundGotoStatement
)
As
IBranchStatement
...
...
src/Compilers/VisualBasic/Test/Semantic/Binding/BindingCollectionInitializerTests.vb
浏览文件 @
01ba1e71
...
...
@@ -417,7 +417,7 @@ IBlockStatement (6 statements, 4 locals) (OperationKind.BlockStatement, IsInvali
Left
:
IFieldReferenceExpression
:
C2
.
a
As
System
.
String
(
OperationKind
.
FieldReferenceExpression
,
Type
:
System
.
String
,
IsInvalid
)
(
Syntax
:
'a')
Instance
Receiver
:
IOperation
:
(
OperationKind
.
None
,
IsInvalid
)
(
Syntax
:
'New C2() Wi ... .a = "goo"}')
Right
:
ILiteralExpression
(
OperationKind
.
LiteralExpression
,
Type
:
System
.
String
,
Constant
:
"goo"
,
IsInvalid
)
(
Syntax
:
'"goo"')
ILabel
Statement
(
Label
:
exit
)
(
OperationKind
.
Label
Statement
)
(
Syntax
:
'End Sub')
ILabel
edStatement
(
Label
:
exit
)
(
OperationKind
.
Labeled
Statement
)
(
Syntax
:
'End Sub')
LabeledStatement
:
null
IReturnStatement
(
OperationKind
.
ReturnStatement
)
(
Syntax
:
'End Sub')
ReturnedValue
:
null
...
...
src/Compilers/VisualBasic/Test/Semantic/Binding/BindingObjectInitializerTests.vb
浏览文件 @
01ba1e71
...
...
@@ -759,7 +759,7 @@ IBlockStatement (4 statements, 1 locals) (OperationKind.BlockStatement, IsInvali
Children
(
1
):
IInvalidExpression
(
OperationKind
.
InvalidExpression
,
Type
:
?
,
IsInvalid
)
(
Syntax
:
'Unknown')
Children
(
0
)
ILabel
Statement
(
Label
:
exit
)
(
OperationKind
.
Label
Statement
)
(
Syntax
:
'End Sub')
ILabel
edStatement
(
Label
:
exit
)
(
OperationKind
.
Labeled
Statement
)
(
Syntax
:
'End Sub')
LabeledStatement
:
null
IReturnStatement
(
OperationKind
.
ReturnStatement
)
(
Syntax
:
'End Sub')
ReturnedValue
:
null
...
...
@@ -1131,7 +1131,7 @@ IObjectCreationExpression (Constructor: Sub C1..ctor()) (OperationKind.ObjectCre
IReturnStatement
(
OperationKind
.
ReturnStatement
)
(
Syntax
:
'Return .Field')
ReturnedValue
:
IFieldReferenceExpression
:
C1
.
Field
As
System
.
Int32
(
OperationKind
.
FieldReferenceExpression
,
Type
:
System
.
Int32
)
(
Syntax
:
'.Field')
Instance
Receiver
:
IOperation
:
(
OperationKind
.
None
)
(
Syntax
:
'New C1 With ... d Function}')
ILabel
Statement
(
Label
:
exit
)
(
OperationKind
.
Label
Statement
)
(
Syntax
:
'End Function')
ILabel
edStatement
(
Label
:
exit
)
(
OperationKind
.
Labeled
Statement
)
(
Syntax
:
'End Function')
LabeledStatement
:
null
IReturnStatement
(
OperationKind
.
ReturnStatement
)
(
Syntax
:
'End Function')
ReturnedValue
:
ILocalReferenceExpression
:
(
OperationKind
.
LocalReferenceExpression
,
Type
:
System
.
Int32
)
(
Syntax
:
'End Function')
...
...
@@ -1403,7 +1403,7 @@ IObjectCreationExpression (Constructor: Sub C2..ctor()) (OperationKind.ObjectCre
Conversion
:
CommonConversion
(
Exists
:
False
,
IsIdentity
:
False
,
IsNumeric
:
False
,
IsReference
:
False
,
IsUserDefined
:
False
)
(
MethodSymbol
:
null
)
Operand
:
IFieldReferenceExpression
:
C2
.
Field
As
System
.
Func
(
Of
System
.
Object
)
(
OperationKind
.
FieldReferenceExpression
,
Type
:
System
.
Func
(
Of
System
.
Object
))
(
Syntax
:
'.Field')
Instance
Receiver
:
IOperation
:
(
OperationKind
.
None
)
(
Syntax
:
'As New C2 W ... d Function}')
ILabel
Statement
(
Label
:
exit
)
(
OperationKind
.
Label
Statement
)
(
Syntax
:
'End Function')
ILabel
edStatement
(
Label
:
exit
)
(
OperationKind
.
Labeled
Statement
)
(
Syntax
:
'End Function')
LabeledStatement
:
null
IReturnStatement
(
OperationKind
.
ReturnStatement
)
(
Syntax
:
'End Function')
ReturnedValue
:
ILocalReferenceExpression
:
(
OperationKind
.
LocalReferenceExpression
,
Type
:
System
.
Object
)
(
Syntax
:
'End Function')
...
...
@@ -1420,7 +1420,7 @@ IObjectCreationExpression (Constructor: Sub C2..ctor()) (OperationKind.ObjectCre
Conversion
:
CommonConversion
(
Exists
:
False
,
IsIdentity
:
False
,
IsNumeric
:
False
,
IsReference
:
False
,
IsUserDefined
:
False
)
(
MethodSymbol
:
null
)
Operand
:
IFieldReferenceExpression
:
C2
.
Field
As
System
.
Func
(
Of
System
.
Object
)
(
OperationKind
.
FieldReferenceExpression
,
Type
:
System
.
Func
(
Of
System
.
Object
))
(
Syntax
:
'.Field')
Instance
Receiver
:
IOperation
:
(
OperationKind
.
None
)
(
Syntax
:
'As New C2 W ... d Function}')
ILabel
Statement
(
Label
:
exit
)
(
OperationKind
.
Label
Statement
)
(
Syntax
:
'End Function')
ILabel
edStatement
(
Label
:
exit
)
(
OperationKind
.
Labeled
Statement
)
(
Syntax
:
'End Function')
LabeledStatement
:
null
IReturnStatement
(
OperationKind
.
ReturnStatement
)
(
Syntax
:
'End Function')
ReturnedValue
:
ILocalReferenceExpression
:
(
OperationKind
.
LocalReferenceExpression
,
Type
:
System
.
Object
)
(
Syntax
:
'End Function')
...
...
src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IBlockStatement_MethodBlocks.vb
浏览文件 @
01ba1e71
...
...
@@ -28,8 +28,8 @@ IBlockStatement (3 statements) (OperationKind.BlockStatement) (Syntax: 'Sub Meth
Right
:
ILiteralExpression
(
Text
:
2
)
(
OperationKind
.
LiteralExpression
,
Type
:
System
.
Int32
,
Constant
:
2
)
(
Syntax
:
'2')
IfTrue
:
IBlockStatement
(
0
statements
)
(
OperationKind
.
BlockStatement
)
(
Syntax
:
'If 1 > 2 Th ... End If')
IfFalse
:
null
ILabel
Statement
(
Label
:
exit
)
(
OperationKind
.
Label
Statement
)
(
Syntax
:
'End Sub')
Labeled
Statement
:
null
ILabel
edStatement
(
Label
:
exit
)
(
OperationKind
.
Labeled
Statement
)
(
Syntax
:
'End Sub')
Statement
:
null
IReturnStatement
(
OperationKind
.
ReturnStatement
)
(
Syntax
:
'End Sub')
ReturnedValue
:
null
]]
>
.
Value
...
...
@@ -58,8 +58,8 @@ IBlockStatement (3 statements) (OperationKind.BlockStatement) (Syntax: 'Sub New(
Right
:
ILiteralExpression
(
Text
:
2
)
(
OperationKind
.
LiteralExpression
,
Type
:
System
.
Int32
,
Constant
:
2
)
(
Syntax
:
'2')
IfTrue
:
IBlockStatement
(
0
statements
)
(
OperationKind
.
BlockStatement
)
(
Syntax
:
'If 1 > 2 Th ... End If')
IfFalse
:
null
ILabel
Statement
(
Label
:
exit
)
(
OperationKind
.
Label
Statement
)
(
Syntax
:
'End Sub')
Labeled
Statement
:
null
ILabel
edStatement
(
Label
:
exit
)
(
OperationKind
.
Labeled
Statement
)
(
Syntax
:
'End Sub')
Statement
:
null
IReturnStatement
(
OperationKind
.
ReturnStatement
)
(
Syntax
:
'End Sub')
ReturnedValue
:
null
]]
>
.
Value
...
...
@@ -93,8 +93,8 @@ IBlockStatement (4 statements, 1 locals) (OperationKind.BlockStatement) (Syntax:
IfFalse
:
null
IReturnStatement
(
OperationKind
.
ReturnStatement
)
(
Syntax
:
'Return True')
ReturnedValue
:
ILiteralExpression
(
Text
:
True
)
(
OperationKind
.
LiteralExpression
,
Type
:
System
.
Boolean
,
Constant
:
True
)
(
Syntax
:
'True')
ILabel
Statement
(
Label
:
exit
)
(
OperationKind
.
Label
Statement
)
(
Syntax
:
'End Function')
Labeled
Statement
:
null
ILabel
edStatement
(
Label
:
exit
)
(
OperationKind
.
Labeled
Statement
)
(
Syntax
:
'End Function')
Statement
:
null
IReturnStatement
(
OperationKind
.
ReturnStatement
)
(
Syntax
:
'End Function')
ReturnedValue
:
ILocalReferenceExpression
:
Method
(
OperationKind
.
LocalReferenceExpression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'End Function')
]]
>
.
Value
...
...
@@ -126,8 +126,8 @@ IBlockStatement (3 statements, 1 locals) (OperationKind.BlockStatement) (Syntax:
Right
:
ILiteralExpression
(
Text
:
2
)
(
OperationKind
.
LiteralExpression
,
Type
:
System
.
Int32
,
Constant
:
2
)
(
Syntax
:
'2')
IfTrue
:
IBlockStatement
(
0
statements
)
(
OperationKind
.
BlockStatement
)
(
Syntax
:
'If 1 > 2 Th ... End If')
IfFalse
:
null
ILabel
Statement
(
Label
:
exit
)
(
OperationKind
.
Label
Statement
)
(
Syntax
:
'End Get')
Labeled
Statement
:
null
ILabel
edStatement
(
Label
:
exit
)
(
OperationKind
.
Labeled
Statement
)
(
Syntax
:
'End Get')
Statement
:
null
IReturnStatement
(
OperationKind
.
ReturnStatement
)
(
Syntax
:
'End Get')
ReturnedValue
:
ILocalReferenceExpression
:
Prop
(
OperationKind
.
LocalReferenceExpression
,
Type
:
System
.
Int32
)
(
Syntax
:
'End Get')
]]
>
.
Value
...
...
@@ -162,8 +162,8 @@ IBlockStatement (3 statements) (OperationKind.BlockStatement) (Syntax: 'Set(Valu
Right
:
ILiteralExpression
(
Text
:
2
)
(
OperationKind
.
LiteralExpression
,
Type
:
System
.
Int32
,
Constant
:
2
)
(
Syntax
:
'2')
IfTrue
:
IBlockStatement
(
0
statements
)
(
OperationKind
.
BlockStatement
)
(
Syntax
:
'If 1 > 2 Th ... End If')
IfFalse
:
null
ILabel
Statement
(
Label
:
exit
)
(
OperationKind
.
Label
Statement
)
(
Syntax
:
'End Set')
Labeled
Statement
:
null
ILabel
edStatement
(
Label
:
exit
)
(
OperationKind
.
Labeled
Statement
)
(
Syntax
:
'End Set')
Statement
:
null
IReturnStatement
(
OperationKind
.
ReturnStatement
)
(
Syntax
:
'End Set')
ReturnedValue
:
null
]]
>
.
Value
...
...
@@ -202,8 +202,8 @@ IBlockStatement (3 statements) (OperationKind.BlockStatement) (Syntax: 'AddHandl
Right
:
ILiteralExpression
(
Text
:
2
)
(
OperationKind
.
LiteralExpression
,
Type
:
System
.
Int32
,
Constant
:
2
)
(
Syntax
:
'2')
IfTrue
:
IBlockStatement
(
0
statements
)
(
OperationKind
.
BlockStatement
)
(
Syntax
:
'If 1 > 2 Th ... End If')
IfFalse
:
null
ILabel
Statement
(
Label
:
exit
)
(
OperationKind
.
Label
Statement
)
(
Syntax
:
'End AddHandler')
Labeled
Statement
:
null
ILabel
edStatement
(
Label
:
exit
)
(
OperationKind
.
Labeled
Statement
)
(
Syntax
:
'End AddHandler')
Statement
:
null
IReturnStatement
(
OperationKind
.
ReturnStatement
)
(
Syntax
:
'End AddHandler')
ReturnedValue
:
null
]]
>
.
Value
...
...
@@ -242,8 +242,8 @@ IBlockStatement (3 statements) (OperationKind.BlockStatement) (Syntax: 'RemoveHa
Right
:
ILiteralExpression
(
Text
:
2
)
(
OperationKind
.
LiteralExpression
,
Type
:
System
.
Int32
,
Constant
:
2
)
(
Syntax
:
'2')
IfTrue
:
IBlockStatement
(
0
statements
)
(
OperationKind
.
BlockStatement
)
(
Syntax
:
'If 1 > 2 Th ... End If')
IfFalse
:
null
ILabel
Statement
(
Label
:
exit
)
(
OperationKind
.
Label
Statement
)
(
Syntax
:
'End RemoveHandler')
Labeled
Statement
:
null
ILabel
edStatement
(
Label
:
exit
)
(
OperationKind
.
Labeled
Statement
)
(
Syntax
:
'End RemoveHandler')
Statement
:
null
IReturnStatement
(
OperationKind
.
ReturnStatement
)
(
Syntax
:
'End RemoveHandler')
ReturnedValue
:
null
]]
>
.
Value
...
...
@@ -282,8 +282,8 @@ IBlockStatement (3 statements) (OperationKind.BlockStatement) (Syntax: 'RaiseEve
Right
:
ILiteralExpression
(
Text
:
2
)
(
OperationKind
.
LiteralExpression
,
Type
:
System
.
Int32
,
Constant
:
2
)
(
Syntax
:
'2')
IfTrue
:
IBlockStatement
(
0
statements
)
(
OperationKind
.
BlockStatement
)
(
Syntax
:
'If 1 > 2 Th ... End If')
IfFalse
:
null
ILabel
Statement
(
Label
:
exit
)
(
OperationKind
.
Label
Statement
)
(
Syntax
:
'End RaiseEvent')
Labeled
Statement
:
null
ILabel
edStatement
(
Label
:
exit
)
(
OperationKind
.
Labeled
Statement
)
(
Syntax
:
'End RaiseEvent')
Statement
:
null
IReturnStatement
(
OperationKind
.
ReturnStatement
)
(
Syntax
:
'End RaiseEvent')
ReturnedValue
:
null
]]
>
.
Value
...
...
@@ -317,8 +317,8 @@ IBlockStatement (4 statements, 1 locals) (OperationKind.BlockStatement) (Syntax:
IfFalse
:
null
IReturnStatement
(
OperationKind
.
ReturnStatement
)
(
Syntax
:
'Return 0')
ReturnedValue
:
ILiteralExpression
(
Text
:
0
)
(
OperationKind
.
LiteralExpression
,
Type
:
System
.
Int32
,
Constant
:
0
)
(
Syntax
:
'0')
ILabel
Statement
(
Label
:
exit
)
(
OperationKind
.
Label
Statement
)
(
Syntax
:
'End Operator')
Labeled
Statement
:
null
ILabel
edStatement
(
Label
:
exit
)
(
OperationKind
.
Labeled
Statement
)
(
Syntax
:
'End Operator')
Statement
:
null
IReturnStatement
(
OperationKind
.
ReturnStatement
)
(
Syntax
:
'End Operator')
ReturnedValue
:
ILocalReferenceExpression
:
(
OperationKind
.
LocalReferenceExpression
,
Type
:
System
.
Int32
)
(
Syntax
:
'End Operator')
]]
>
.
Value
...
...
src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IConversionExpression.vb
浏览文件 @
01ba1e71
...
...
@@ -764,8 +764,8 @@ IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclaratio
Conversion
:
CommonConversion
(
Exists
:
False
,
IsIdentity
:
False
,
IsNumeric
:
False
,
IsReference
:
False
,
IsUserDefined
:
False
)
(
MethodSymbol
:
null
)
Operand
:
ILambdaExpression
(
Signature
:
Sub
(
i
As
System
.
Int32
))
(
OperationKind
.
LambdaExpression
,
Type
:
null
)
(
Syntax
:
'Sub(i As In ... End Sub')
IBlockStatement
(
2
statements
)
(
OperationKind
.
BlockStatement
)
(
Syntax
:
'Sub(i As In ... End Sub')
ILabel
Statement
(
Label
:
exit
)
(
OperationKind
.
Label
Statement
)
(
Syntax
:
'End Sub')
Labeled
Statement
:
null
ILabel
edStatement
(
Label
:
exit
)
(
OperationKind
.
Labeled
Statement
)
(
Syntax
:
'End Sub')
Statement
:
null
IReturnStatement
(
OperationKind
.
ReturnStatement
)
(
Syntax
:
'End Sub')
ReturnedValue
:
null
]]
>
.
Value
...
...
@@ -797,8 +797,8 @@ IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclaratio
Conversion
:
CommonConversion
(
Exists
:
False
,
IsIdentity
:
False
,
IsNumeric
:
False
,
IsReference
:
False
,
IsUserDefined
:
False
)
(
MethodSymbol
:
null
)
Operand
:
ILambdaExpression
(
Signature
:
Sub
())
(
OperationKind
.
LambdaExpression
,
Type
:
null
)
(
Syntax
:
'Sub()'BIND: ... End Sub')
IBlockStatement
(
2
statements
)
(
OperationKind
.
BlockStatement
)
(
Syntax
:
'Sub()'BIND: ... End Sub')
ILabel
Statement
(
Label
:
exit
)
(
OperationKind
.
Label
Statement
)
(
Syntax
:
'End Sub')
Labeled
Statement
:
null
ILabel
edStatement
(
Label
:
exit
)
(
OperationKind
.
Labeled
Statement
)
(
Syntax
:
'End Sub')
Statement
:
null
IReturnStatement
(
OperationKind
.
ReturnStatement
)
(
Syntax
:
'End Sub')
ReturnedValue
:
null
]]
>
.
Value
...
...
@@ -830,8 +830,8 @@ IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclaratio
Conversion
:
CommonConversion
(
Exists
:
False
,
IsIdentity
:
False
,
IsNumeric
:
False
,
IsReference
:
False
,
IsUserDefined
:
False
)
(
MethodSymbol
:
null
)
Operand
:
ILambdaExpression
(
Signature
:
Sub
(
i
As
System
.
Int32
))
(
OperationKind
.
LambdaExpression
,
Type
:
null
,
IsInvalid
)
(
Syntax
:
'Sub(i As In ... End Sub')
IBlockStatement
(
2
statements
)
(
OperationKind
.
BlockStatement
,
IsInvalid
)
(
Syntax
:
'Sub(i As In ... End Sub')
ILabel
Statement
(
Label
:
exit
)
(
OperationKind
.
Label
Statement
,
IsInvalid
)
(
Syntax
:
'End Sub')
Labeled
Statement
:
null
ILabel
edStatement
(
Label
:
exit
)
(
OperationKind
.
Labeled
Statement
,
IsInvalid
)
(
Syntax
:
'End Sub')
Statement
:
null
IReturnStatement
(
OperationKind
.
ReturnStatement
,
IsInvalid
)
(
Syntax
:
'End Sub')
ReturnedValue
:
null
]]
>
.
Value
...
...
@@ -871,8 +871,8 @@ IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclaratio
Locals
:
Local_1
:
<
anonymous
local
>
As
System
.
Int32
IReturnStatement
(
OperationKind
.
ReturnStatement
)
(
Syntax
:
'Return 1')
ReturnedValue
:
ILiteralExpression
(
Text
:
1
)
(
OperationKind
.
LiteralExpression
,
Type
:
System
.
Int32
,
Constant
:
1
)
(
Syntax
:
'1')
ILabel
Statement
(
Label
:
exit
)
(
OperationKind
.
Label
Statement
)
(
Syntax
:
'End Function')
Labeled
Statement
:
null
ILabel
edStatement
(
Label
:
exit
)
(
OperationKind
.
Labeled
Statement
)
(
Syntax
:
'End Function')
Statement
:
null
IReturnStatement
(
OperationKind
.
ReturnStatement
)
(
Syntax
:
'End Function')
ReturnedValue
:
ILocalReferenceExpression
:
(
OperationKind
.
LocalReferenceExpression
,
Type
:
System
.
Int32
)
(
Syntax
:
'End Function')
]]
>
.
Value
...
...
@@ -908,8 +908,8 @@ IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclaratio
Locals
:
Local_1
:
<
anonymous
local
>
As
System
.
Int32
IReturnStatement
(
OperationKind
.
ReturnStatement
)
(
Syntax
:
'Return 1')
ReturnedValue
:
ILiteralExpression
(
Text
:
1
)
(
OperationKind
.
LiteralExpression
,
Type
:
System
.
Int32
,
Constant
:
1
)
(
Syntax
:
'1')
ILabel
Statement
(
Label
:
exit
)
(
OperationKind
.
Label
Statement
)
(
Syntax
:
'End Function')
Labeled
Statement
:
null
ILabel
edStatement
(
Label
:
exit
)
(
OperationKind
.
Labeled
Statement
)
(
Syntax
:
'End Function')
Statement
:
null
IReturnStatement
(
OperationKind
.
ReturnStatement
)
(
Syntax
:
'End Function')
ReturnedValue
:
ILocalReferenceExpression
:
(
OperationKind
.
LocalReferenceExpression
,
Type
:
System
.
Int32
)
(
Syntax
:
'End Function')
]]
>
.
Value
...
...
@@ -941,8 +941,8 @@ IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclaratio
Conversion
:
CommonConversion
(
Exists
:
False
,
IsIdentity
:
False
,
IsNumeric
:
False
,
IsReference
:
False
,
IsUserDefined
:
False
)
(
MethodSymbol
:
null
)
Operand
:
ILambdaExpression
(
Signature
:
Sub
())
(
OperationKind
.
LambdaExpression
,
Type
:
null
,
IsInvalid
)
(
Syntax
:
'Sub()'BIND: ... End Sub')
IBlockStatement
(
2
statements
)
(
OperationKind
.
BlockStatement
,
IsInvalid
)
(
Syntax
:
'Sub()'BIND: ... End Sub')
ILabel
Statement
(
Label
:
exit
)
(
OperationKind
.
Label
Statement
,
IsInvalid
)
(
Syntax
:
'End Sub')
Labeled
Statement
:
null
ILabel
edStatement
(
Label
:
exit
)
(
OperationKind
.
Labeled
Statement
,
IsInvalid
)
(
Syntax
:
'End Sub')
Statement
:
null
IReturnStatement
(
OperationKind
.
ReturnStatement
,
IsInvalid
)
(
Syntax
:
'End Sub')
ReturnedValue
:
null
]]
>
.
Value
...
...
@@ -2104,8 +2104,8 @@ IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclaratio
ReturnedValue
:
IBinaryOperatorExpression
(
BinaryOperationKind
.
IntegerLessThan
)
(
OperationKind
.
BinaryOperatorExpression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'num < 5')
Left
:
IParameterReferenceExpression
:
num
(
OperationKind
.
ParameterReferenceExpression
,
Type
:
System
.
Int32
)
(
Syntax
:
'num')
Right
:
ILiteralExpression
(
Text
:
5
)
(
OperationKind
.
LiteralExpression
,
Type
:
System
.
Int32
,
Constant
:
5
)
(
Syntax
:
'5')
ILabel
Statement
(
Label
:
exit
)
(
OperationKind
.
Label
Statement
)
(
Syntax
:
'Function(num) num < 5')
Labeled
Statement
:
null
ILabel
edStatement
(
Label
:
exit
)
(
OperationKind
.
Labeled
Statement
)
(
Syntax
:
'Function(num) num < 5')
Statement
:
null
IReturnStatement
(
OperationKind
.
ReturnStatement
)
(
Syntax
:
'Function(num) num < 5')
ReturnedValue
:
ILocalReferenceExpression
:
(
OperationKind
.
LocalReferenceExpression
,
Type
:
System
.
Boolean
)
(
Syntax
:
'Function(num) num < 5')
]]
>
.
Value
...
...
@@ -2144,8 +2144,8 @@ IVariableDeclarationStatement (1 declarations) (OperationKind.VariableDeclaratio
ReturnedValue
:
IConversionExpression
(
Implicit
,
TryCast
:
False
,
Unchecked
)
(
OperationKind
.
ConversionExpression
,
Type
:
System
.
Boolean
,
IsInvalid
)
(
Syntax
:
'num')
Conversion
:
CommonConversion
(
Exists
:
False
,
IsIdentity
:
False
,
IsNumeric
:
False
,
IsReference
:
False
,
IsUserDefined
:
False
)
(
MethodSymbol
:
null
)
Operand
:
IParameterReferenceExpression
:
num
(
OperationKind
.
ParameterReferenceExpression
,
Type
:
System
.
Int32
,
IsInvalid
)
(
Syntax
:
'num')
ILabel
Statement
(
Label
:
exit
)
(
OperationKind
.
Label
Statement
,
IsInvalid
)
(
Syntax
:
'Function(num) num')
Labeled
Statement
:
null
ILabel
edStatement
(
Label
:
exit
)
(
OperationKind
.
Labeled
Statement
,
IsInvalid
)
(
Syntax
:
'Function(num) num')
Statement
:
null
IReturnStatement
(
OperationKind
.
ReturnStatement
,
IsInvalid
)
(
Syntax
:
'Function(num) num')
ReturnedValue
:
ILocalReferenceExpression
:
(
OperationKind
.
LocalReferenceExpression
,
Type
:
System
.
Boolean
,
IsInvalid
)
(
Syntax
:
'Function(num) num')
]]
>
.
Value
...
...
src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IObjectCreationExpression.vb
浏览文件 @
01ba1e71
...
...
@@ -129,8 +129,8 @@ IBlockStatement (9 statements, 7 locals) (OperationKind.BlockStatement, IsInvali
IInvalidExpression
(
OperationKind
.
InvalidExpression
,
Type
:
?
,
IsInvalid
)
(
Syntax
:
'""')
Children
(
1
):
ILiteralExpression
(
OperationKind
.
LiteralExpression
,
Type
:
System
.
String
,
Constant
:
""
,
IsInvalid
)
(
Syntax
:
'""')
ILabel
Statement
(
Label
:
exit
)
(
OperationKind
.
Label
Statement
)
(
Syntax
:
'End Sub')
Labeled
Statement
:
null
ILabel
edStatement
(
Label
:
exit
)
(
OperationKind
.
Labeled
Statement
)
(
Syntax
:
'End Sub')
Statement
:
null
IReturnStatement
(
OperationKind
.
ReturnStatement
)
(
Syntax
:
'End Sub')
ReturnedValue
:
null
]]
>
.
Value
...
...
src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IParameterReferenceExpression.vb
浏览文件 @
01ba1e71
...
...
@@ -385,8 +385,8 @@ IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.Conve
Locals
:
Local_1
:
<
anonymous
local
>
As
System
.
Object
IReturnStatement
(
OperationKind
.
ReturnStatement
)
(
Syntax
:
'x')
ReturnedValue
:
IParameterReferenceExpression
:
x
(
OperationKind
.
ParameterReferenceExpression
,
Type
:
System
.
Object
)
(
Syntax
:
'x')
ILabel
Statement
(
Label
:
exit
)
(
OperationKind
.
Label
Statement
)
(
Syntax
:
'Function() x')
Labeled
Statement
:
null
ILabel
edStatement
(
Label
:
exit
)
(
OperationKind
.
Labeled
Statement
)
(
Syntax
:
'Function() x')
Statement
:
null
IReturnStatement
(
OperationKind
.
ReturnStatement
)
(
Syntax
:
'Function() x')
ReturnedValue
:
ILocalReferenceExpression
:
(
OperationKind
.
LocalReferenceExpression
,
Type
:
System
.
Object
)
(
Syntax
:
'Function() x')
]]
>
.
Value
...
...
src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_IWhileUntilLoopStatement.vb
浏览文件 @
01ba1e71
...
...
@@ -433,8 +433,8 @@ IWhileUntilLoopStatement (IsTopTest: True, IsWhile: True) (LoopKind.WhileUntil)
Expression
:
ICompoundAssignmentExpression
(
BinaryOperationKind
.
IntegerAdd
)
(
OperationKind
.
CompoundAssignmentExpression
,
Type
:
System
.
Int32
)
(
Syntax
:
'number += 1')
Left
:
IParameterReferenceExpression
:
number
(
OperationKind
.
ParameterReferenceExpression
,
Type
:
System
.
Int32
)
(
Syntax
:
'number')
Right
:
ILiteralExpression
(
Text
:
1
)
(
OperationKind
.
LiteralExpression
,
Type
:
System
.
Int32
,
Constant
:
1
)
(
Syntax
:
'1')
ILabel
Statement
(
Label
:
Even
)
(
OperationKind
.
Label
Statement
)
(
Syntax
:
'Even:')
Labeled
Statement
:
null
ILabel
edStatement
(
Label
:
Even
)
(
OperationKind
.
Labeled
Statement
)
(
Syntax
:
'Even:')
Statement
:
null
IReturnStatement
(
OperationKind
.
ReturnStatement
)
(
Syntax
:
'Return number')
ReturnedValue
:
IParameterReferenceExpression
:
number
(
OperationKind
.
ParameterReferenceExpression
,
Type
:
System
.
Int32
)
(
Syntax
:
'number')
]]
>
.
Value
...
...
src/Compilers/VisualBasic/Test/Semantic/IOperation/IOperationTests_InvalidExpression.vb
浏览文件 @
01ba1e71
...
...
@@ -287,8 +287,8 @@ IConversionExpression (Implicit, TryCast: False, Unchecked) (OperationKind.Conve
IInvocationExpression
(
Sub
Program
.
F
())
(
OperationKind
.
InvocationExpression
,
Type
:
System
.
Void
,
IsInvalid
)
(
Syntax
:
'F()')
Instance
Receiver
:
null
Arguments
(
0
)
ILabel
Statement
(
Label
:
exit
)
(
OperationKind
.
Label
Statement
,
IsInvalid
)
(
Syntax
:
'Function() F()')
Labeled
Statement
:
null
ILabel
edStatement
(
Label
:
exit
)
(
OperationKind
.
Labeled
Statement
,
IsInvalid
)
(
Syntax
:
'Function() F()')
Statement
:
null
IReturnStatement
(
OperationKind
.
ReturnStatement
,
IsInvalid
)
(
Syntax
:
'Function() F()')
ReturnedValue
:
ILocalReferenceExpression
:
(
OperationKind
.
LocalReferenceExpression
,
Type
:
?
,
IsInvalid
)
(
Syntax
:
'Function() F()')]]>.Value
...
...
src/Compilers/VisualBasic/Test/Semantic/Semantics/AnonymousTypesTests.vb
浏览文件 @
01ba1e71
...
...
@@ -126,8 +126,8 @@ IBlockStatement (4 statements, 2 locals) (OperationKind.BlockStatement, IsInvali
IArrayInitializer
(
1
elements
)
(
OperationKind
.
ArrayInitializer
,
IsInvalid
)
(
Syntax
:
'{tr}')
Element
Values
(
1
):
IParameterReferenceExpression
:
tr
(
OperationKind
.
ParameterReferenceExpression
,
Type
:
System
.
TypedReference
,
IsInvalid
)
(
Syntax
:
'tr')
ILabel
Statement
(
Label
:
exit
)
(
OperationKind
.
Label
Statement
)
(
Syntax
:
'End Sub')
Labeled
Statement
:
null
ILabel
edStatement
(
Label
:
exit
)
(
OperationKind
.
Labeled
Statement
)
(
Syntax
:
'End Sub')
Statement
:
null
IReturnStatement
(
OperationKind
.
ReturnStatement
)
(
Syntax
:
'End Sub')
ReturnedValue
:
null
]]
>
.
Value
...
...
@@ -628,8 +628,8 @@ IBlockStatement (4 statements, 2 locals) (OperationKind.BlockStatement, IsInvali
Initializer
:
IAnonymousObjectCreationExpression
(
OperationKind
.
AnonymousObjectCreationExpression
,
Type
:
<
anonymous
type
:
__
As
System
.
Collections
.
Generic
.
IEnumerable
(
Of
System
.
Xml
.
Linq
.
XElement
)
>
)
(
Syntax
:
'New With {<a/>.<__>}')
Initializers
(
1
):
IOperation
:
(
OperationKind
.
None
)
(
Syntax
:
'<a/>.<__>')
ILabel
Statement
(
Label
:
exit
)
(
OperationKind
.
Label
Statement
)
(
Syntax
:
'End Sub')
Labeled
Statement
:
null
ILabel
edStatement
(
Label
:
exit
)
(
OperationKind
.
Labeled
Statement
)
(
Syntax
:
'End Sub')
Statement
:
null
IReturnStatement
(
OperationKind
.
ReturnStatement
)
(
Syntax
:
'End Sub')
ReturnedValue
:
null
]]
>
.
Value
...
...
@@ -835,8 +835,8 @@ IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpress
Instance
Receiver
:
IPropertyReferenceExpression
:
ReadOnly
Property
<
anonymous
type
:
Key
x
As
System
.
String
,
Key
a
As
System
.
String
>
.
x
As
System
.
String
(
Static
)
(
OperationKind
.
PropertyReferenceExpression
,
Type
:
System
.
String
,
IsInvalid
)
(
Syntax
:
'.x')
Instance
Receiver
:
null
Arguments
(
0
)
ILabel
Statement
(
Label
:
exit
)
(
OperationKind
.
Label
Statement
)
(
Syntax
:
'End Function')
Labeled
Statement
:
null
ILabel
edStatement
(
Label
:
exit
)
(
OperationKind
.
Labeled
Statement
)
(
Syntax
:
'End Function')
Statement
:
null
IReturnStatement
(
OperationKind
.
ReturnStatement
)
(
Syntax
:
'End Function')
ReturnedValue
:
ILocalReferenceExpression
:
(
OperationKind
.
LocalReferenceExpression
,
Type
:
System
.
String
)
(
Syntax
:
'End Function')
Arguments
(
0
)
...
...
@@ -889,8 +889,8 @@ IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpress
Children
(
1
):
IInvalidExpression
(
OperationKind
.
InvalidExpression
,
Type
:
?
,
IsInvalid
)
(
Syntax
:
'.a')
Children
(
0
)
ILabel
Statement
(
Label
:
exit
)
(
OperationKind
.
Label
Statement
)
(
Syntax
:
'End Function')
Labeled
Statement
:
null
ILabel
edStatement
(
Label
:
exit
)
(
OperationKind
.
Labeled
Statement
)
(
Syntax
:
'End Function')
Statement
:
null
IReturnStatement
(
OperationKind
.
ReturnStatement
)
(
Syntax
:
'End Function')
ReturnedValue
:
ILocalReferenceExpression
:
(
OperationKind
.
LocalReferenceExpression
,
Type
:
System
.
String
)
(
Syntax
:
'End Function')
Arguments
(
0
)
...
...
@@ -943,8 +943,8 @@ IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpress
Children
(
1
):
IInvalidExpression
(
OperationKind
.
InvalidExpression
,
Type
:
?
,
IsInvalid
)
(
Syntax
:
'.x')
Children
(
0
)
ILabel
Statement
(
Label
:
exit
)
(
OperationKind
.
Label
Statement
)
(
Syntax
:
'End Function')
Labeled
Statement
:
null
ILabel
edStatement
(
Label
:
exit
)
(
OperationKind
.
Labeled
Statement
)
(
Syntax
:
'End Function')
Statement
:
null
IReturnStatement
(
OperationKind
.
ReturnStatement
)
(
Syntax
:
'End Function')
ReturnedValue
:
ILocalReferenceExpression
:
(
OperationKind
.
LocalReferenceExpression
,
Type
:
System
.
String
)
(
Syntax
:
'End Function')
Arguments
(
0
)
...
...
@@ -1006,13 +1006,13 @@ IAnonymousObjectCreationExpression (OperationKind.AnonymousObjectCreationExpress
Children
(
1
):
IInvalidExpression
(
OperationKind
.
InvalidExpression
,
Type
:
?
,
IsInvalid
)
(
Syntax
:
'.x')
Children
(
0
)
ILabel
Statement
(
Label
:
exit
)
(
OperationKind
.
Label
Statement
)
(
Syntax
:
'End Function')
Labeled
Statement
:
null
ILabel
edStatement
(
Label
:
exit
)
(
OperationKind
.
Labeled
Statement
)
(
Syntax
:
'End Function')
Statement
:
null
IReturnStatement
(
OperationKind
.
ReturnStatement
)
(
Syntax
:
'End Function')
ReturnedValue
:
ILocalReferenceExpression
:
(
OperationKind
.
LocalReferenceExpression
,
Type
:
System
.
String
)
(
Syntax
:
'End Function')
Arguments
(
0
)
ILabel
Statement
(
Label
:
exit
)
(
OperationKind
.
Label
Statement
)
(
Syntax
:
'End Function')
Labeled
Statement
:
null
ILabel
edStatement
(
Label
:
exit
)
(
OperationKind
.
Labeled
Statement
)
(
Syntax
:
'End Function')
Statement
:
null
IReturnStatement
(
OperationKind
.
ReturnStatement
)
(
Syntax
:
'End Function')
ReturnedValue
:
ILocalReferenceExpression
:
(
OperationKind
.
LocalReferenceExpression
,
Type
:
System
.
String
)
(
Syntax
:
'End Function')
Arguments
(
0
)
...
...
src/Compilers/VisualBasic/Test/Semantic/Semantics/SelectCaseTests.vb
浏览文件 @
01ba1e71
...
...
@@ -597,8 +597,8 @@ ISwitchStatement (2 cases) (OperationKind.SwitchStatement) (Syntax: 'Select Case
Locals
:
Local_1
:
<
anonymous
local
>
As
System
.
Int32
IReturnStatement
(
OperationKind
.
ReturnStatement
)
(
Syntax
:
'5')
ReturnedValue
:
ILiteralExpression
(
Text
:
5
)
(
OperationKind
.
LiteralExpression
,
Type
:
System
.
Int32
,
Constant
:
5
)
(
Syntax
:
'5')
ILabel
Statement
(
Label
:
exit
)
(
OperationKind
.
Label
Statement
)
(
Syntax
:
'Function() 5')
Labeled
Statement
:
null
ILabel
edStatement
(
Label
:
exit
)
(
OperationKind
.
Labeled
Statement
)
(
Syntax
:
'Function() 5')
Statement
:
null
IReturnStatement
(
OperationKind
.
ReturnStatement
)
(
Syntax
:
'Function() 5')
ReturnedValue
:
ILocalReferenceExpression
:
(
OperationKind
.
LocalReferenceExpression
,
Type
:
System
.
Int32
)
(
Syntax
:
'Function() 5')
Body
:
...
...
src/Test/Utilities/Portable/Compilation/OperationTreeVerifier.cs
浏览文件 @
01ba1e71
...
...
@@ -470,9 +470,9 @@ public override void VisitForEachLoopStatement(IForEachLoopStatement operation)
Visit
(
operation
.
Body
,
"Body"
);
}
public
override
void
VisitLabel
Statement
(
ILabel
Statement
operation
)
public
override
void
VisitLabel
edStatement
(
ILabeled
Statement
operation
)
{
LogString
(
nameof
(
ILabelStatement
));
LogString
(
nameof
(
ILabel
ed
Statement
));
// TODO: Put a better workaround to skip compiler generated labels.
if
(!
operation
.
Label
.
IsImplicitlyDeclared
)
...
...
@@ -482,7 +482,7 @@ public override void VisitLabelStatement(ILabelStatement operation)
LogCommonPropertiesAndNewLine
(
operation
);
Visit
(
operation
.
LabeledStatement
,
"Labeled
Statement"
);
Visit
(
operation
.
Statement
,
"
Statement"
);
}
public
override
void
VisitBranchStatement
(
IBranchStatement
operation
)
...
...
src/Test/Utilities/Portable/Compilation/TestOperationWalker.cs
浏览文件 @
01ba1e71
...
...
@@ -129,11 +129,11 @@ public override void VisitForEachLoopStatement(IForEachLoopStatement operation)
base
.
VisitForEachLoopStatement
(
operation
);
}
public
override
void
VisitLabel
Statement
(
ILabel
Statement
operation
)
public
override
void
VisitLabel
edStatement
(
ILabeled
Statement
operation
)
{
var
label
=
operation
.
Label
;
base
.
VisitLabelStatement
(
operation
);
base
.
VisitLabel
ed
Statement
(
operation
);
}
public
override
void
VisitBranchStatement
(
IBranchStatement
operation
)
...
...
src/Test/Utilities/Portable/Diagnostics/OperationTestAnalyzer.cs
浏览文件 @
01ba1e71
...
...
@@ -1468,13 +1468,13 @@ public sealed override void Initialize(AnalysisContext context)
context
.
RegisterOperationAction
(
(
operationContext
)
=>
{
ILabelSymbol
label
=
((
ILabelStatement
)
operationContext
.
Operation
).
Label
;
ILabelSymbol
label
=
((
ILabel
ed
Statement
)
operationContext
.
Operation
).
Label
;
if
(
label
.
Name
==
"Wilma"
||
label
.
Name
==
"Betty"
)
{
operationContext
.
ReportDiagnostic
(
Diagnostic
.
Create
(
LabelDescriptor
,
operationContext
.
Operation
.
Syntax
.
GetLocation
()));
}
},
OperationKind
.
LabelStatement
);
OperationKind
.
Label
ed
Statement
);
context
.
RegisterOperationAction
(
(
operationContext
)
=>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录