Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
fd307891
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,发现更多精彩内容 >>
提交
fd307891
编写于
3月 11, 2015
作者:
C
Charles Stoner
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Address PR feedback
上级
cb6de686
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
10 addition
and
10 deletion
+10
-10
src/Compilers/CSharp/Portable/SymbolDisplay/ObjectDisplay.cs
src/Compilers/CSharp/Portable/SymbolDisplay/ObjectDisplay.cs
+6
-6
src/Compilers/CSharp/Test/Symbol/SymbolDisplay/ObjectDisplayTests.cs
...rs/CSharp/Test/Symbol/SymbolDisplay/ObjectDisplayTests.cs
+2
-0
src/Compilers/CSharp/Test/Syntax/Syntax/SyntaxFactoryTests.cs
...Compilers/CSharp/Test/Syntax/Syntax/SyntaxFactoryTests.cs
+2
-1
src/ExpressionEvaluator/VisualBasic/Test/ResultProvider/BasicResultProviderTest.vbproj
...lBasic/Test/ResultProvider/BasicResultProviderTest.vbproj
+0
-3
未找到文件。
src/Compilers/CSharp/Portable/SymbolDisplay/ObjectDisplay.cs
浏览文件 @
fd307891
...
@@ -133,7 +133,7 @@ internal static string FormatLiteral(bool value)
...
@@ -133,7 +133,7 @@ internal static string FormatLiteral(bool value)
return
value
?
"true"
:
"false"
;
return
value
?
"true"
:
"false"
;
}
}
private
static
void
FormatChar
(
private
static
void
Format
String
Char
(
ref
PooledStringBuilder
pooledBuilder
,
ref
PooledStringBuilder
pooledBuilder
,
string
str
,
string
str
,
int
index
,
int
index
,
...
@@ -273,7 +273,7 @@ public static string FormatLiteral(string value, ObjectDisplayOptions options)
...
@@ -273,7 +273,7 @@ public static string FormatLiteral(string value, ObjectDisplayOptions options)
}
}
for
(
int
i
=
0
;
i
<
value
.
Length
;
i
++)
for
(
int
i
=
0
;
i
<
value
.
Length
;
i
++)
{
{
FormatChar
(
ref
pooledBuilder
,
value
,
i
,
value
[
i
],
quote
,
useLanguageSpecificEscapes
:
true
,
useUnicodeEscapes
:
true
);
Format
String
Char
(
ref
pooledBuilder
,
value
,
i
,
value
[
i
],
quote
,
useLanguageSpecificEscapes
:
true
,
useUnicodeEscapes
:
true
);
}
}
if
(
quote
!=
0
)
if
(
quote
!=
0
)
{
{
...
@@ -295,7 +295,7 @@ internal static string FormatString(string str, bool useQuotes)
...
@@ -295,7 +295,7 @@ internal static string FormatString(string str, bool useQuotes)
builder
.
Append
(
quote
);
builder
.
Append
(
quote
);
for
(
int
i
=
0
;
i
<
str
.
Length
;
i
++)
for
(
int
i
=
0
;
i
<
str
.
Length
;
i
++)
{
{
FormatChar
(
ref
pooledBuilder
,
str
,
i
,
str
[
i
],
quote
,
useLanguageSpecificEscapes
:
useQuotes
,
useUnicodeEscapes
:
false
);
Format
String
Char
(
ref
pooledBuilder
,
str
,
i
,
str
[
i
],
quote
,
useLanguageSpecificEscapes
:
useQuotes
,
useUnicodeEscapes
:
false
);
}
}
builder
.
Append
(
quote
);
builder
.
Append
(
quote
);
return
pooledBuilder
.
ToStringAndFree
();
return
pooledBuilder
.
ToStringAndFree
();
...
@@ -320,13 +320,13 @@ internal static string FormatLiteral(char c, ObjectDisplayOptions options)
...
@@ -320,13 +320,13 @@ internal static string FormatLiteral(char c, ObjectDisplayOptions options)
builder
.
Append
(
options
.
IncludesOption
(
ObjectDisplayOptions
.
UseHexadecimalNumbers
)
?
"0x"
+
((
int
)
c
).
ToString
(
"x4"
)
:
((
int
)
c
).
ToString
());
builder
.
Append
(
options
.
IncludesOption
(
ObjectDisplayOptions
.
UseHexadecimalNumbers
)
?
"0x"
+
((
int
)
c
).
ToString
(
"x4"
)
:
((
int
)
c
).
ToString
());
builder
.
Append
(
" "
);
builder
.
Append
(
" "
);
}
}
if
(
quote
!=
0
)
if
(
useQuotes
)
{
{
builder
.
Append
(
quote
);
builder
.
Append
(
quote
);
}
}
var
escapeNonPrintable
=
!
includeCodePoints
;
var
escapeNonPrintable
=
!
includeCodePoints
;
FormatChar
(
ref
pooledBuilder
,
null
,
0
,
c
,
quote
,
useLanguageSpecificEscapes
:
useQuotes
,
useUnicodeEscapes
:
!
includeCodePoints
);
Format
String
Char
(
ref
pooledBuilder
,
null
,
0
,
c
,
quote
,
useLanguageSpecificEscapes
:
useQuotes
,
useUnicodeEscapes
:
!
includeCodePoints
);
if
(
quote
!=
0
)
if
(
useQuotes
)
{
{
builder
.
Append
(
quote
);
builder
.
Append
(
quote
);
}
}
...
...
src/Compilers/CSharp/Test/Symbol/SymbolDisplay/ObjectDisplayTests.cs
浏览文件 @
fd307891
...
@@ -155,6 +155,7 @@ public void Strings()
...
@@ -155,6 +155,7 @@ public void Strings()
}
}
var
s
=
sb
.
ToString
();
var
s
=
sb
.
ToString
();
// Formatting with quotes should escape specific control characters.
var
expected
=
var
expected
=
"\"\\0\u0001\u0002\u0003\u0004\u0005\u0006\\a\\b\\t\\n\\v\\f\\r\u000e\u000f\u0010"
+
"\"\\0\u0001\u0002\u0003\u0004\u0005\u0006\\a\\b\\t\\n\\v\\f\\r\u000e\u000f\u0010"
+
"\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d"
+
"\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d"
+
...
@@ -168,6 +169,7 @@ public void Strings()
...
@@ -168,6 +169,7 @@ public void Strings()
expected
,
expected
,
ObjectDisplay
.
FormatString
(
s
,
useQuotes
:
true
));
ObjectDisplay
.
FormatString
(
s
,
useQuotes
:
true
));
// Formatting without quotes should not escape any characters.
expected
=
expected
=
"\0\u0001\u0002\u0003\u0004\u0005\u0006\a\u0008\u0009\u000a\u000b\f\u000d\u000e\u000f\u0010"
+
"\0\u0001\u0002\u0003\u0004\u0005\u0006\a\u0008\u0009\u000a\u000b\f\u000d\u000e\u000f\u0010"
+
"\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d"
+
"\u0011\u0012\u0013\u0014\u0015\u0016\u0017\u0018\u0019\u001a\u001b\u001c\u001d"
+
...
...
src/Compilers/CSharp/Test/Syntax/Syntax/SyntaxFactoryTests.cs
浏览文件 @
fd307891
...
@@ -228,15 +228,16 @@ public void TestLiteralDefaultStringValues()
...
@@ -228,15 +228,16 @@ public void TestLiteralDefaultStringValues()
CheckLiteralToString
(
"A"
,
@"""A"""
);
CheckLiteralToString
(
"A"
,
@"""A"""
);
CheckLiteralToString
(
"\r"
,
@"""\r"""
);
CheckLiteralToString
(
"\r"
,
@"""\r"""
);
CheckLiteralToString
(
"\u0007"
,
@"""\a"""
);
CheckLiteralToString
(
"\u0007"
,
@"""\a"""
);
CheckLiteralToString
(
"\u000c"
,
@"""\f"""
);
CheckLiteralToString
(
"\u001f"
,
@"""\u001f"""
);
CheckLiteralToString
(
"\u001f"
,
@"""\u001f"""
);
// char
// char
CheckLiteralToString
(
'A'
,
@"'A'"
);
CheckLiteralToString
(
'A'
,
@"'A'"
);
CheckLiteralToString
(
'\r'
,
@"'\r'"
);
CheckLiteralToString
(
'\r'
,
@"'\r'"
);
CheckLiteralToString
(
'\
u0007
'
,
@"'\a'"
);
CheckLiteralToString
(
'\
u000c
'
,
@"'\f'"
);
CheckLiteralToString
(
'\
u000c
'
,
@"'\f'"
);
CheckLiteralToString
(
'\
u001f
'
,
@"'\u001f'"
);
CheckLiteralToString
(
'\
u001f
'
,
@"'\u001f'"
);
// byte
// byte
CheckLiteralToString
(
byte
.
MinValue
,
@"0"
);
CheckLiteralToString
(
byte
.
MinValue
,
@"0"
);
CheckLiteralToString
(
byte
.
MaxValue
,
@"255"
);
CheckLiteralToString
(
byte
.
MaxValue
,
@"255"
);
...
...
src/ExpressionEvaluator/VisualBasic/Test/ResultProvider/BasicResultProviderTest.vbproj
浏览文件 @
fd307891
...
@@ -107,9 +107,6 @@
...
@@ -107,9 +107,6 @@
<ItemGroup>
<ItemGroup>
<None
Include=
"packages.config"
/>
<None
Include=
"packages.config"
/>
</ItemGroup>
</ItemGroup>
<ItemGroup>
<Folder
Include=
"My Project\"
/>
</ItemGroup>
<Import
Project=
"..\..\Source\ResultProvider\BasicResultProvider.projitems"
Label=
"Shared"
/>
<Import
Project=
"..\..\Source\ResultProvider\BasicResultProvider.projitems"
Label=
"Shared"
/>
<ImportGroup
Label=
"Targets"
>
<ImportGroup
Label=
"Targets"
>
<Import
Project=
"..\..\..\..\Tools\Microsoft.CodeAnalysis.Toolset.Open\Targets\VSL.Imports.targets"
/>
<Import
Project=
"..\..\..\..\Tools\Microsoft.CodeAnalysis.Toolset.Open\Targets\VSL.Imports.targets"
/>
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录