Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SR-6571] Specialize ClassDeclSyntax in libSyntax Parsing #49121

Open
nkcsgexi opened this issue Dec 11, 2017 · 0 comments
Open

[SR-6571] Specialize ClassDeclSyntax in libSyntax Parsing #49121

nkcsgexi opened this issue Dec 11, 2017 · 0 comments
Labels
compiler The Swift compiler in itself task

Comments

@nkcsgexi
Copy link
Member

Previous ID SR-6571
Radar None
Original Reporter @nkcsgexi
Type Task
Status In Progress
Resolution
Additional Detail from JIRA
Votes 0
Component/s Compiler, Source Tooling
Labels Task
Assignee ftchirou (JIRA)
Priority Medium

md5: 3d9c5dcc06c021c023b1dbb17038a3b7

Issue Description:

Currently, libSyntax parsing doesn't specialize class declarations, meaning all class declarations are manifested as UnkownDecl. Since libSyntax clients will very likely interested in specialized analysis on classes. We need to teach the parser to specialize them.

To demo what we have now:

$cat ~/Desktop/test.swift
class C{}
func foo() {}
$../build/Ninja-DebugAssert/swift-macosx-x86_64/bin/swift-syntax-test -input-source-filename ~/Desktop/test.swift -parse-gen -print-node-kind -print-trivial-node-kind
<SourceFile><DeclList><TopLevelCodeDecl><StmtList><DeclarationStmt><UnknownDecl>class C{<DeclList></DeclList>}</UnknownDecl></DeclarationStmt><DeclarationStmt><FunctionDecl>
func foo<FunctionSignature>(<FunctionParameterList></FunctionParameterList>) </FunctionSignature><CodeBlock>{<StmtList></StmtList>}</CodeBlock></FunctionDecl></DeclarationStmt></StmtList></TopLevelCodeDecl></DeclList>
</SourceFile>

See that function decl is specialized however class decl is not. The desirable feature will be having class specialized as well. One can follow the patch we specialized struct declaration from: c4604d7

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler The Swift compiler in itself task
Projects
None yet
Development

No branches or pull requests

1 participant