Skip to content

Fix parsing bugs that caused symbol visibility to be incorrect.#154

Merged
dlang-bot merged 2 commits intomasterfrom
fix-SimpleParser
Jul 30, 2020
Merged

Fix parsing bugs that caused symbol visibility to be incorrect.#154
dlang-bot merged 2 commits intomasterfrom
fix-SimpleParser

Conversation

@Hackerpilot
Copy link
Copy Markdown
Collaborator

@Hackerpilot Hackerpilot commented Jul 25, 2020

This fixes a few bugs in the specialized parser that is run on code that is imported (i.e. the function bodies and unit test bodies are skipped). Returning null from these functions caused the parser to go into error recovery mode and skip ahead to the nearest semicolon or closing brace. This causes dsymbol to actually fail to correctly parse well-formed code, leading to problems like dlang-community/DCD#620.

In addition to not returning null from the unittest parser, this change also fixes a problem where some forms of functions with contracts were skipped incorrectly, which also caused them to be missing in autocomplete lists in DCD. There are test cases in the linked DCD draft pull request. dsymbol's unit test coverage is pretty bad and I don't intend to fix that with this pull.

Related:

Copy link
Copy Markdown

@AndrejMitrovic AndrejMitrovic left a comment

Choose a reason for hiding this comment

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

LGTM.

@dlang-bot dlang-bot merged commit f9a3d30 into master Jul 30, 2020
@Hackerpilot Hackerpilot deleted the fix-SimpleParser branch July 30, 2020 05:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants