Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
lwm1986
roslyn
提交
234ae5c8
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,发现更多精彩内容 >>
提交
234ae5c8
编写于
9月 09, 2015
作者:
B
Brett V. Forsgren
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
rename `ShebangCommentTrivia` to `ShebangTrivia`
上级
0a5af9d4
变更
12
隐藏空白更改
内联
并排
Showing
12 changed file
with
19 addition
and
19 deletion
+19
-19
src/Compilers/CSharp/Portable/PublicAPI.Unshipped.txt
src/Compilers/CSharp/Portable/PublicAPI.Unshipped.txt
+2
-2
src/Compilers/CSharp/Portable/Syntax/InternalSyntax/Syntax.cs
...Compilers/CSharp/Portable/Syntax/InternalSyntax/Syntax.cs
+1
-1
src/Compilers/CSharp/Portable/Syntax/InternalSyntax/SyntaxNode.cs
...ilers/CSharp/Portable/Syntax/InternalSyntax/SyntaxNode.cs
+1
-1
src/Compilers/CSharp/Portable/Syntax/SyntaxFactory.cs
src/Compilers/CSharp/Portable/Syntax/SyntaxFactory.cs
+2
-2
src/Compilers/CSharp/Portable/Syntax/SyntaxKind.cs
src/Compilers/CSharp/Portable/Syntax/SyntaxKind.cs
+1
-1
src/Compilers/CSharp/Portable/Syntax/SyntaxKindFacts.cs
src/Compilers/CSharp/Portable/Syntax/SyntaxKindFacts.cs
+1
-1
src/Compilers/CSharp/Portable/Syntax/SyntaxNodeRemover.cs
src/Compilers/CSharp/Portable/Syntax/SyntaxNodeRemover.cs
+2
-2
src/Compilers/CSharp/Portable/Syntax/SyntaxNormalizer.cs
src/Compilers/CSharp/Portable/Syntax/SyntaxNormalizer.cs
+1
-1
src/Compilers/CSharp/Test/Syntax/Parsing/InteractiveParsingTests.cs
...ers/CSharp/Test/Syntax/Parsing/InteractiveParsingTests.cs
+3
-3
src/Workspaces/CSharp/Portable/Extensions/SyntaxNodeExtensions.cs
...spaces/CSharp/Portable/Extensions/SyntaxNodeExtensions.cs
+1
-1
src/Workspaces/CSharp/Portable/Extensions/SyntaxTreeExtensions.cs
...spaces/CSharp/Portable/Extensions/SyntaxTreeExtensions.cs
+1
-1
src/Workspaces/CSharp/Portable/Extensions/SyntaxTriviaExtensions.cs
...aces/CSharp/Portable/Extensions/SyntaxTriviaExtensions.cs
+3
-3
未找到文件。
src/Compilers/CSharp/Portable/PublicAPI.Unshipped.txt
浏览文件 @
234ae5c8
...
...
@@ -13,7 +13,7 @@ Microsoft.CodeAnalysis.CSharp.Syntax.LoadDirectiveTriviaSyntax.WithIsActive(bool
Microsoft.CodeAnalysis.CSharp.Syntax.LoadDirectiveTriviaSyntax.WithLoadKeyword(Microsoft.CodeAnalysis.SyntaxToken loadKeyword) -> Microsoft.CodeAnalysis.CSharp.Syntax.LoadDirectiveTriviaSyntax
Microsoft.CodeAnalysis.CSharp.SyntaxKind.LoadDirectiveTrivia = 8923 -> Microsoft.CodeAnalysis.CSharp.SyntaxKind
Microsoft.CodeAnalysis.CSharp.SyntaxKind.LoadKeyword = 8485 -> Microsoft.CodeAnalysis.CSharp.SyntaxKind
Microsoft.CodeAnalysis.CSharp.SyntaxKind.Shebang
Comment
Trivia = 8922 -> Microsoft.CodeAnalysis.CSharp.SyntaxKind
Microsoft.CodeAnalysis.CSharp.SyntaxKind.ShebangTrivia = 8922 -> Microsoft.CodeAnalysis.CSharp.SyntaxKind
override Microsoft.CodeAnalysis.CSharp.CSharpParseOptions.CommonWithKind(Microsoft.CodeAnalysis.SourceCodeKind kind) -> Microsoft.CodeAnalysis.ParseOptions
override Microsoft.CodeAnalysis.CSharp.CSharpSyntaxRewriter.VisitLoadDirectiveTrivia(Microsoft.CodeAnalysis.CSharp.Syntax.LoadDirectiveTriviaSyntax node) -> Microsoft.CodeAnalysis.SyntaxNode
override Microsoft.CodeAnalysis.CSharp.Syntax.LoadDirectiveTriviaSyntax.Accept(Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor visitor) -> void
...
...
@@ -30,4 +30,4 @@ static Microsoft.CodeAnalysis.CSharp.SyntaxExtensions.NormalizeWhitespace(this M
static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.LoadDirectiveTrivia(Microsoft.CodeAnalysis.SyntaxToken file, bool isActive) -> Microsoft.CodeAnalysis.CSharp.Syntax.LoadDirectiveTriviaSyntax
static Microsoft.CodeAnalysis.CSharp.SyntaxFactory.LoadDirectiveTrivia(Microsoft.CodeAnalysis.SyntaxToken hashToken, Microsoft.CodeAnalysis.SyntaxToken loadKeyword, Microsoft.CodeAnalysis.SyntaxToken file, Microsoft.CodeAnalysis.SyntaxToken endOfDirectiveToken, bool isActive) -> Microsoft.CodeAnalysis.CSharp.Syntax.LoadDirectiveTriviaSyntax
virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor.VisitLoadDirectiveTrivia(Microsoft.CodeAnalysis.CSharp.Syntax.LoadDirectiveTriviaSyntax node) -> void
virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult>.VisitLoadDirectiveTrivia(Microsoft.CodeAnalysis.CSharp.Syntax.LoadDirectiveTriviaSyntax node) -> TResult
\ No newline at end of file
virtual Microsoft.CodeAnalysis.CSharp.CSharpSyntaxVisitor<TResult>.VisitLoadDirectiveTrivia(Microsoft.CodeAnalysis.CSharp.Syntax.LoadDirectiveTriviaSyntax node) -> TResult
src/Compilers/CSharp/Portable/Syntax/InternalSyntax/Syntax.cs
浏览文件 @
234ae5c8
...
...
@@ -94,7 +94,7 @@ internal static SyntaxTrivia Comment(string text)
}
else
if
(
text
.
StartsWith
(
"#"
,
StringComparison
.
Ordinal
))
{
return
SyntaxTrivia
.
Create
(
SyntaxKind
.
Shebang
Comment
Trivia
,
text
);
return
SyntaxTrivia
.
Create
(
SyntaxKind
.
ShebangTrivia
,
text
);
}
else
{
...
...
src/Compilers/CSharp/Portable/Syntax/InternalSyntax/SyntaxNode.cs
浏览文件 @
234ae5c8
...
...
@@ -346,7 +346,7 @@ public override bool IsTriviaWithEndOfLine()
{
return
this
.
Kind
==
SyntaxKind
.
EndOfLineTrivia
||
this
.
Kind
==
SyntaxKind
.
SingleLineCommentTrivia
||
this
.
Kind
==
SyntaxKind
.
Shebang
Comment
Trivia
;
||
this
.
Kind
==
SyntaxKind
.
ShebangTrivia
;
}
// Use conditional weak table so we always return same identity for structured trivia
...
...
src/Compilers/CSharp/Portable/Syntax/SyntaxFactory.cs
浏览文件 @
234ae5c8
...
...
@@ -176,7 +176,7 @@ public static SyntaxTrivia PreprocessingMessage(string text)
/// <see cref="SyntaxKind.WhitespaceTrivia"/>, <see cref="SyntaxKind.EndOfLineTrivia"/>,
/// <see cref="SyntaxKind.SingleLineCommentTrivia"/>, <see cref="SyntaxKind.MultiLineCommentTrivia"/>,
/// <see cref="SyntaxKind.DocumentationCommentExteriorTrivia"/>, <see cref="SyntaxKind.DisabledTextTrivia"/>,
/// <see cref="SyntaxKind.Shebang
Comment
Trivia"/>
/// <see cref="SyntaxKind.ShebangTrivia"/>
/// </param>
/// <param name="text">
/// The actual text of this token.
...
...
@@ -195,7 +195,7 @@ public static SyntaxTrivia SyntaxTrivia(SyntaxKind kind, string text)
case
SyntaxKind
.
EndOfLineTrivia
:
case
SyntaxKind
.
MultiLineCommentTrivia
:
case
SyntaxKind
.
SingleLineCommentTrivia
:
case
SyntaxKind
.
Shebang
Comment
Trivia
:
case
SyntaxKind
.
ShebangTrivia
:
case
SyntaxKind
.
WhitespaceTrivia
:
return
new
SyntaxTrivia
(
default
(
SyntaxToken
),
new
Syntax
.
InternalSyntax
.
SyntaxTrivia
(
kind
,
text
,
null
,
null
),
0
,
0
);
...
...
src/Compilers/CSharp/Portable/Syntax/SyntaxKind.cs
浏览文件 @
234ae5c8
...
...
@@ -530,7 +530,7 @@ public enum SyntaxKind : ushort
InterpolationAlignmentClause
=
8920
,
InterpolationFormatClause
=
8921
,
Shebang
Comment
Trivia
=
8922
,
ShebangTrivia
=
8922
,
LoadDirectiveTrivia
=
8923
,
}
}
src/Compilers/CSharp/Portable/Syntax/SyntaxKindFacts.cs
浏览文件 @
234ae5c8
...
...
@@ -209,7 +209,7 @@ public static bool IsTrivia(SyntaxKind kind)
case
SyntaxKind
.
WhitespaceTrivia
:
case
SyntaxKind
.
SingleLineCommentTrivia
:
case
SyntaxKind
.
MultiLineCommentTrivia
:
case
SyntaxKind
.
Shebang
Comment
Trivia
:
case
SyntaxKind
.
ShebangTrivia
:
case
SyntaxKind
.
SingleLineDocumentationCommentTrivia
:
case
SyntaxKind
.
MultiLineDocumentationCommentTrivia
:
case
SyntaxKind
.
DisabledTextTrivia
:
...
...
src/Compilers/CSharp/Portable/Syntax/SyntaxNodeRemover.cs
浏览文件 @
234ae5c8
...
...
@@ -113,13 +113,13 @@ private void AddEndOfLine()
/// <summary>
/// Returns whether the specified <see cref="SyntaxTrivia"/> token is also the end of the line. This will
/// be true for <see cref="SyntaxKind.EndOfLineTrivia"/>, <see cref="SyntaxKind.SingleLineCommentTrivia"/>,
/// <see cref="SyntaxKind.Shebang
Comment
Trivia"/>, and all preprocessor directives.
/// <see cref="SyntaxKind.ShebangTrivia"/>, and all preprocessor directives.
/// </summary>
private
static
bool
IsEndOfLine
(
SyntaxTrivia
trivia
)
{
return
trivia
.
Kind
()
==
SyntaxKind
.
EndOfLineTrivia
||
trivia
.
Kind
()
==
SyntaxKind
.
SingleLineCommentTrivia
||
trivia
.
Kind
()
==
SyntaxKind
.
Shebang
Comment
Trivia
||
trivia
.
Kind
()
==
SyntaxKind
.
ShebangTrivia
||
trivia
.
IsDirective
;
}
...
...
src/Compilers/CSharp/Portable/Syntax/SyntaxNormalizer.cs
浏览文件 @
234ae5c8
...
...
@@ -666,7 +666,7 @@ private static bool NeedsLineBreakAfter(SyntaxTrivia trivia, bool isTrailingTriv
switch
(
kind
)
{
case
SyntaxKind
.
SingleLineCommentTrivia
:
case
SyntaxKind
.
Shebang
Comment
Trivia
:
case
SyntaxKind
.
ShebangTrivia
:
return
true
;
case
SyntaxKind
.
MultiLineCommentTrivia
:
return
!
isTrailingTrivia
;
...
...
src/Compilers/CSharp/Test/Syntax/Parsing/InteractiveParsingTests.cs
浏览文件 @
234ae5c8
...
...
@@ -8446,7 +8446,7 @@ public void Shebang()
Assert
.
Empty
(
root
.
ChildNodes
());
var
eof
=
root
.
EndOfFileToken
;
Assert
.
Equal
(
SyntaxKind
.
EndOfFileToken
,
eof
.
Kind
());
Assert
.
Equal
(
SyntaxKind
.
Shebang
Comment
Trivia
,
eof
.
GetLeadingTrivia
().
Single
().
Kind
());
Assert
.
Equal
(
SyntaxKind
.
ShebangTrivia
,
eof
.
GetLeadingTrivia
().
Single
().
Kind
());
tree
=
ParseAndValidate
(
"#! /usr/bin/env scriptcs\r\n "
,
TestOptions
.
Script
);
root
=
tree
.
GetCompilationUnitRoot
();
...
...
@@ -8456,7 +8456,7 @@ public void Shebang()
Assert
.
Equal
(
SyntaxKind
.
EndOfFileToken
,
eof
.
Kind
());
var
leading
=
eof
.
GetLeadingTrivia
().
ToArray
();
Assert
.
Equal
(
3
,
leading
.
Length
);
Assert
.
Equal
(
SyntaxKind
.
Shebang
Comment
Trivia
,
leading
[
0
].
Kind
());
Assert
.
Equal
(
SyntaxKind
.
ShebangTrivia
,
leading
[
0
].
Kind
());
Assert
.
Equal
(
SyntaxKind
.
EndOfLineTrivia
,
leading
[
1
].
Kind
());
Assert
.
Equal
(
SyntaxKind
.
WhitespaceTrivia
,
leading
[
2
].
Kind
());
...
...
@@ -8469,7 +8469,7 @@ public void Shebang()
Assert
.
Equal
(
SyntaxKind
.
GlobalStatement
,
statement
.
Kind
());
leading
=
statement
.
GetLeadingTrivia
().
ToArray
();
Assert
.
Equal
(
2
,
leading
.
Length
);
Assert
.
Equal
(
SyntaxKind
.
Shebang
Comment
Trivia
,
leading
[
0
].
Kind
());
Assert
.
Equal
(
SyntaxKind
.
ShebangTrivia
,
leading
[
0
].
Kind
());
Assert
.
Equal
(
SyntaxKind
.
EndOfLineTrivia
,
leading
[
1
].
Kind
());
}
...
...
src/Workspaces/CSharp/Portable/Extensions/SyntaxNodeExtensions.cs
浏览文件 @
234ae5c8
...
...
@@ -175,7 +175,7 @@ static SyntaxNodeExtensions()
var
endOfLine
=
Match
(
SyntaxKind
.
EndOfLineTrivia
,
"\\n"
);
var
singleBlankLine
=
Matcher
.
Sequence
(
whitespace
,
endOfLine
);
var
shebangComment
=
Match
(
SyntaxKind
.
Shebang
Comment
Trivia
,
"#!"
);
var
shebangComment
=
Match
(
SyntaxKind
.
ShebangTrivia
,
"#!"
);
var
singleLineComment
=
Match
(
SyntaxKind
.
SingleLineCommentTrivia
,
"//"
);
var
multiLineComment
=
Match
(
SyntaxKind
.
MultiLineCommentTrivia
,
"/**/"
);
var
anyCommentMatcher
=
Matcher
.
Choice
(
shebangComment
,
singleLineComment
,
multiLineComment
);
...
...
src/Workspaces/CSharp/Portable/Extensions/SyntaxTreeExtensions.cs
浏览文件 @
234ae5c8
...
...
@@ -348,7 +348,7 @@ public static bool IsEntirelyWithinCrefSyntax(this SyntaxTree syntaxTree, int po
trivia
=
trivia
.
GetPreviousTrivia
(
syntaxTree
,
cancellationToken
);
}
if
(
trivia
.
IsSingleLineComment
()
||
trivia
.
IsShebang
Comment
())
if
(
trivia
.
IsSingleLineComment
()
||
trivia
.
IsShebang
())
{
var
span
=
trivia
.
FullSpan
;
...
...
src/Workspaces/CSharp/Portable/Extensions/SyntaxTriviaExtensions.cs
浏览文件 @
234ae5c8
...
...
@@ -32,7 +32,7 @@ public static bool MatchesKind(this SyntaxTrivia trivia, params SyntaxKind[] kin
public
static
bool
IsRegularComment
(
this
SyntaxTrivia
trivia
)
{
return
trivia
.
IsSingleLineComment
()
||
trivia
.
IsMultiLineComment
()
||
trivia
.
IsShebang
Comment
();
return
trivia
.
IsSingleLineComment
()
||
trivia
.
IsMultiLineComment
()
||
trivia
.
IsShebang
();
}
public
static
bool
IsRegularOrDocComment
(
this
SyntaxTrivia
trivia
)
...
...
@@ -50,9 +50,9 @@ public static bool IsMultiLineComment(this SyntaxTrivia trivia)
return
trivia
.
Kind
()
==
SyntaxKind
.
MultiLineCommentTrivia
;
}
public
static
bool
IsShebang
Comment
(
this
SyntaxTrivia
trivia
)
public
static
bool
IsShebang
(
this
SyntaxTrivia
trivia
)
{
return
trivia
.
Kind
()
==
SyntaxKind
.
Shebang
Comment
Trivia
;
return
trivia
.
Kind
()
==
SyntaxKind
.
ShebangTrivia
;
}
public
static
bool
IsCompleteMultiLineComment
(
this
SyntaxTrivia
trivia
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录