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

Class Specifier Does Not Include Semicolon #150

Open
berchn opened this issue Jan 31, 2022 · 0 comments
Open

Class Specifier Does Not Include Semicolon #150

berchn opened this issue Jan 31, 2022 · 0 comments

Comments

@berchn
Copy link

berchn commented Jan 31, 2022

The following is the code I'm using:

class Dummy {​​​​​​​​​​
public:
  int foo();
  int bar(int val);
}​​​​​​​​​​​;

class DummyTwo;
translation_unit [0, 0] - [7, 0]
  class_specifier [0, 0] - [4, 1]
    name: type_identifier [0, 6] - [0, 11]
    body: field_declaration_list [0, 12] - [4, 1]
      access_specifier [1, 0] - [1, 7]
      field_declaration [2, 2] - [2, 12]
        type: primitive_type [2, 2] - [2, 5]
        declarator: function_declarator [2, 6] - [2, 11]
          declarator: field_identifier [2, 6] - [2, 9]
          parameters: parameter_list [2, 9] - [2, 11]
      field_declaration [3, 2] - [3, 19]
        type: primitive_type [3, 2] - [3, 5]
        declarator: function_declarator [3, 6] - [3, 18]
          declarator: field_identifier [3, 6] - [3, 9]
          parameters: parameter_list [3, 9] - [3, 18]
            parameter_declaration [3, 10] - [3, 17]
              type: primitive_type [3, 10] - [3, 13]
              declarator: identifier [3, 14] - [3, 17]
  class_specifier [6, 0] - [6, 14]
    name: type_identifier [6, 6] - [6, 14]

Notice that neither class specifier includes the semicolon. The semicolon is instead a sibling of the class_specifier subtree. This is due to the usage of empty_declaration in _top_level_item.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant