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

Allow trailing semi-colon after typedef #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

lizard-boy
Copy link

This is not exactly in the spec, but most Thrift parsers allow trailing semi-colon after typedef.

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

Added support for trailing semicolons after typedef and const definitions, improving compatibility with other Thrift parsers.

  • Modified parseTypedef in src/main/parser.ts to consume optional trailing semicolons
  • Added new test fixtures and solutions in src/tests/parser and src/tests/scanner to verify the new behavior
  • Updated src/tests/parser/parser.spec.ts and src/tests/scanner/scanner.spec.ts with new test cases for trailing semicolons
  • Implemented changes consistently across parser and scanner components

7 file(s) reviewed, 4 comment(s)
Edit PR Review Bot Settings

Comment on lines +1 to +2
const string test = 'asdf';
typedef i32 MyInteger;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Duplicate const declaration on line 3

@@ -0,0 +1,4 @@
const string test = 'asdf';
typedef i32 MyInteger;
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Duplicate typedef declaration on line 4

Comment on lines +3 to +4
const string test = 'asdf'
typedef i32 MyInteger
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: Inconsistent use of semicolons

}
}
},
{
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

logic: Missing semicolon after const definition

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

Successfully merging this pull request may close these issues.

1 participant