Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
a8251626
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,发现更多精彩内容 >>
提交
a8251626
编写于
9月 20, 2017
作者:
H
Heejae Chang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
addressed PR feedbacks
上级
4154db45
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
19 addition
and
31 deletion
+19
-31
src/Compilers/CSharp/Portable/BoundTree/Expression.cs
src/Compilers/CSharp/Portable/BoundTree/Expression.cs
+2
-8
src/Compilers/CSharp/Portable/Compilation/MemberSemanticModel.cs
...pilers/CSharp/Portable/Compilation/MemberSemanticModel.cs
+10
-17
src/Compilers/CSharp/Portable/Operations/CSharpOperationFactory.cs
...lers/CSharp/Portable/Operations/CSharpOperationFactory.cs
+4
-3
src/Compilers/CSharp/Portable/Operations/CSharpOperationFactory_Methods.cs
...arp/Portable/Operations/CSharpOperationFactory_Methods.cs
+3
-3
未找到文件。
src/Compilers/CSharp/Portable/BoundTree/Expression.cs
浏览文件 @
a8251626
...
...
@@ -141,13 +141,7 @@ internal partial class BoundSequence
internal
partial
class
BoundStatementList
{
protected
override
ImmutableArray
<
BoundNode
>
Children
{
get
{
System
.
Diagnostics
.
Debug
.
Assert
(
this
.
Kind
==
BoundKind
.
StatementList
||
this
.
Kind
==
BoundKind
.
Scope
);
return
StaticCast
<
BoundNode
>.
From
(
this
.
Statements
);
}
}
protected
override
ImmutableArray
<
BoundNode
>
Children
=>
(
this
.
Kind
==
BoundKind
.
StatementList
||
this
.
Kind
==
BoundKind
.
Scope
)
?
StaticCast
<
BoundNode
>.
From
(
this
.
Statements
)
:
ImmutableArray
<
BoundNode
>.
Empty
;
}
}
src/Compilers/CSharp/Portable/Compilation/MemberSemanticModel.cs
浏览文件 @
a8251626
...
...
@@ -980,38 +980,34 @@ private CSharpSyntaxNode GetBindingRootOrInitializer(CSharpSyntaxNode node)
// if binding root is parameter, make it equal value
// we need to do this since node map doesn't contain bound node for parameter
var
parameter
=
bindingRoot
as
ParameterSyntax
;
if
(
parameter
!=
null
&&
parameter
.
Default
?.
FullSpan
.
Contains
(
node
.
Span
)
==
true
)
if
(
bindingRoot
is
ParameterSyntax
parameter
&&
parameter
.
Default
?.
FullSpan
.
Contains
(
node
.
Span
)
==
true
)
{
bindingRoot
=
parameter
.
Default
;
return
parameter
.
Default
;
}
// if binding root is field variable declarator, make it initializer
// we need to do this since node map doesn't contain bound node for field/event variable declarator
var
variableDeclarator
=
bindingRoot
as
VariableDeclaratorSyntax
;
if
(
variableDeclarator
!=
null
&&
variableDeclarator
.
Initializer
?.
FullSpan
.
Contains
(
node
.
Span
)
==
true
)
if
(
bindingRoot
is
VariableDeclaratorSyntax
variableDeclarator
&&
variableDeclarator
.
Initializer
?.
FullSpan
.
Contains
(
node
.
Span
)
==
true
)
{
if
(
variableDeclarator
.
Parent
?.
Parent
.
IsKind
(
SyntaxKind
.
FieldDeclaration
)
==
true
||
variableDeclarator
.
Parent
?.
Parent
.
IsKind
(
SyntaxKind
.
EventFieldDeclaration
)
==
true
)
{
bindingRoot
=
variableDeclarator
.
Initializer
;
return
variableDeclarator
.
Initializer
;
}
}
// if binding root is enum member decleration, make it equal value
// we need to do this since node map doesn't contain bound node for enum member decl
var
enumMember
=
bindingRoot
as
EnumMemberDeclarationSyntax
;
if
(
enumMember
!=
null
&&
enumMember
.
EqualsValue
?.
FullSpan
.
Contains
(
node
.
Span
)
==
true
)
if
(
bindingRoot
is
EnumMemberDeclarationSyntax
enumMember
&&
enumMember
.
EqualsValue
?.
FullSpan
.
Contains
(
node
.
Span
)
==
true
)
{
bindingRoot
=
enumMember
.
EqualsValue
;
return
enumMember
.
EqualsValue
;
}
// if binding root is property member decleration, make it equal value
// we need to do this since node map doesn't contain bound node for property initializer
var
propertyMember
=
bindingRoot
as
PropertyDeclarationSyntax
;
if
(
propertyMember
!=
null
&&
propertyMember
.
Initializer
?.
FullSpan
.
Contains
(
node
.
Span
)
==
true
)
if
(
bindingRoot
is
PropertyDeclarationSyntax
propertyMember
&&
propertyMember
.
Initializer
?.
FullSpan
.
Contains
(
node
.
Span
)
==
true
)
{
bindingRoot
=
propertyMember
.
Initializer
;
return
propertyMember
.
Initializer
;
}
return
bindingRoot
;
...
...
@@ -1336,8 +1332,6 @@ private CSharpSyntaxNode GetBindingRoot(CSharpSyntaxNode node)
{
Debug
.
Assert
(
node
!=
null
);
StatementSyntax
enclosingStatement
=
null
;
#if DEBUG
for
(
CSharpSyntaxNode
current
=
node
;
current
!=
this
.
Root
;
current
=
current
.
ParentOrStructuredTriviaParent
)
{
...
...
@@ -1348,10 +1342,9 @@ private CSharpSyntaxNode GetBindingRoot(CSharpSyntaxNode node)
for
(
CSharpSyntaxNode
current
=
node
;
current
!=
this
.
Root
;
current
=
current
.
ParentOrStructuredTriviaParent
)
{
enclosingStatement
=
current
as
StatementSyntax
;
if
(
enclosingStatement
!=
null
)
if
(
current
is
StatementSyntax
)
{
return
enclosingStatem
ent
;
return
curr
ent
;
}
}
...
...
src/Compilers/CSharp/Portable/Operations/CSharpOperationFactory.cs
浏览文件 @
a8251626
...
...
@@ -241,13 +241,14 @@ private IOperation CreateInternal(BoundNode boundNode)
private
ImmutableArray
<
IOperation
>
GetIOperationChildren
(
BoundNode
boundNode
)
{
var
boundNodeWithChildren
=
(
IBoundNodeWithIOperationChildren
)
boundNode
;
if
(
boundNodeWithChildren
.
Children
.
IsDefaultOrEmpty
)
var
children
=
boundNodeWithChildren
.
Children
;
if
(
children
.
IsDefaultOrEmpty
)
{
return
ImmutableArray
<
IOperation
>.
Empty
;
}
var
builder
=
ArrayBuilder
<
IOperation
>.
GetInstance
(
boundNodeWithChildren
.
C
hildren
.
Length
);
foreach
(
BoundNode
childNode
in
boundNodeWithChildren
.
C
hildren
)
var
builder
=
ArrayBuilder
<
IOperation
>.
GetInstance
(
c
hildren
.
Length
);
foreach
(
BoundNode
childNode
in
c
hildren
)
{
IOperation
operation
=
Create
(
childNode
);
if
(
operation
==
null
)
...
...
src/Compilers/CSharp/Portable/Operations/CSharpOperationFactory_Methods.cs
浏览文件 @
a8251626
...
...
@@ -38,17 +38,17 @@ internal IArgument CreateArgumentOperation(ArgumentKind kind, IParameterSymbol p
var
value
=
Create
(
expression
);
// put argument syntax to argument operation
var
argument
Exist
=
value
.
Syntax
?.
Parent
i
s
ArgumentSyntax
;
var
argument
=
value
.
Syntax
?.
Parent
a
s
ArgumentSyntax
;
// if argument syntax doesn't exist, this operation is implicit
return
new
CSharpArgument
(
kind
,
parameter
,
value
,
semanticModel
:
_semanticModel
,
syntax
:
argument
Exist
?
value
.
Syntax
.
Parent
:
value
.
Syntax
,
syntax
:
argument
??
value
.
Syntax
,
type
:
value
.
Type
,
constantValue
:
default
,
isImplicit
:
expression
.
WasCompilerGenerated
||
!
argumentExist
);
isImplicit
:
expression
.
WasCompilerGenerated
||
argument
==
null
);
}
private
IVariableDeclaration
CreateVariableDeclaration
(
BoundLocalDeclaration
boundLocalDeclaration
,
SyntaxNode
syntax
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录