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-5847] Nested declarations are not represented as nodes #48417

Closed
ankitspd opened this issue Sep 6, 2017 · 2 comments
Closed

[SR-5847] Nested declarations are not represented as nodes #48417

ankitspd opened this issue Sep 6, 2017 · 2 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself declarations Feature: declarations † libswiftSyntax † Area → compiler: the once-integrated C++ Syntax library succeeded by SwiftSyntax nested functions Features → declarations: nested functions stale Resolution: No longer relevant, stale

Comments

@ankitspd
Copy link
Member

ankitspd commented Sep 6, 2017

Previous ID SR-5847
Radar None
Original Reporter @aciidb0mb3r
Type Bug
Additional Detail from JIRA
Votes 0
Component/s Compiler, Source Tooling
Labels Bug, Syntax
Assignee None
Priority Medium

md5: 122da96f49f1a7f4bd534a980f1cf3da

Issue Description:

The syntax emitted for nested declarations is represented as tokens and not nodes. Is that intended?

Example:

func foo(){ func bar(){} }
[
  {
    "kind": "UnknownDecl",
    "layout": [
      {
        "tokenKind": {
          "kind": "kw_func"
        },
        "leadingTrivia": [

        ],
        "trailingTrivia": [
          {
            "kind": "Space",
            "value": 1
          }
        ],
        "presence": "Present"
      },
      {
        "tokenKind": {
          "kind": "identifier",
          "text": "foo"
        },
        "leadingTrivia": [

        ],
        "trailingTrivia": [

        ],
        "presence": "Present"
      },
      {
        "tokenKind": {
          "kind": "l_paren"
        },
        "leadingTrivia": [

        ],
        "trailingTrivia": [

        ],
        "presence": "Present"
      },
      {
        "tokenKind": {
          "kind": "r_paren"
        },
        "leadingTrivia": [

        ],
        "trailingTrivia": [

        ],
        "presence": "Present"
      },
      {
        "tokenKind": {
          "kind": "l_brace"
        },
        "leadingTrivia": [

        ],
        "trailingTrivia": [
          {
            "kind": "Space",
            "value": 1
          }
        ],
        "presence": "Present"
      },
      {
        "tokenKind": {
          "kind": "kw_func"
        },
        "leadingTrivia": [

        ],
        "trailingTrivia": [
          {
            "kind": "Space",
            "value": 1
          }
        ],
        "presence": "Present"
      },
      {
        "tokenKind": {
          "kind": "identifier",
          "text": "bar"
        },
        "leadingTrivia": [

        ],
        "trailingTrivia": [

        ],
        "presence": "Present"
      },
      {
        "tokenKind": {
          "kind": "l_paren"
        },
        "leadingTrivia": [

        ],
        "trailingTrivia": [

        ],
        "presence": "Present"
      },
      {
        "tokenKind": {
          "kind": "r_paren"
        },
        "leadingTrivia": [

        ],
        "trailingTrivia": [

        ],
        "presence": "Present"
      },
      {
        "tokenKind": {
          "kind": "l_brace"
        },
        "leadingTrivia": [

        ],
        "trailingTrivia": [

        ],
        "presence": "Present"
      },
      {
        "tokenKind": {
          "kind": "r_brace"
        },
        "leadingTrivia": [

        ],
        "trailingTrivia": [
          {
            "kind": "Space",
            "value": 1
          }
        ],
        "presence": "Present"
      },
      {
        "tokenKind": {
          "kind": "r_brace"
        },
        "leadingTrivia": [

        ],
        "trailingTrivia": [

        ],
        "presence": "Present"
      }
    ],
    "presence": "Present"
  },
  {
    "tokenKind": {
      "kind": "eof"
    },
    "leadingTrivia": [
      {
        "kind": "Newline",
        "value": 1
      }
    ],
    "trailingTrivia": [

    ],
    "presence": "Present"
  }
]
@belkadan
Copy link
Contributor

belkadan commented Sep 6, 2017

@nkcsgexi, who's the best person to look at this?

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@AnthonyLatsis AnthonyLatsis added nested functions Features → declarations: nested functions declarations Feature: declarations stale Resolution: No longer relevant, stale labels Apr 5, 2023
@AnthonyLatsis
Copy link
Collaborator

libSyntax was removed in #62145 and succeeded by swift-syntax.

@AnthonyLatsis AnthonyLatsis closed this as not planned Won't fix, can't repro, duplicate, stale Apr 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself declarations Feature: declarations † libswiftSyntax † Area → compiler: the once-integrated C++ Syntax library succeeded by SwiftSyntax nested functions Features → declarations: nested functions stale Resolution: No longer relevant, stale
Projects
None yet
Development

No branches or pull requests

3 participants