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

Chore: Clean up inline directive parsing #12375

Merged
merged 3 commits into from Oct 8, 2019

Commits on Oct 4, 2019

  1. Give variable name to matched text

    This simply makes the code a bit easier to read by giving a name to `match[1]`.
    captbaritone committed Oct 4, 2019
    Copy the full SHA
    8a37587 View commit details
    Browse the repository at this point in the history
  2. Refactor: Untangle logic for parsing directives

    There are a few thing going on in this function which were getting
    conflated:
    
    1. Parsing a `directiveType` out of the comment.
    2. Ignoring directives that are in line comments but only support block
       comments.
    3. Warning on and ignoring line comments that span multiple lines.
    
    Previously these three pieces of functionality were tightly coupled
    which made the code harder to read. After this change each task is
    handled independently of the other.
    captbaritone committed Oct 4, 2019
    Copy the full SHA
    7c2674d View commit details
    Browse the repository at this point in the history

Commits on Oct 5, 2019

  1. Core: Consolidate handling disable directives

    Rather than conditionally set a mutable value and check for it at the end of the switch statement, we can actually just handle it inline by using a fallthrough.
    captbaritone committed Oct 5, 2019
    Copy the full SHA
    2542f3a View commit details
    Browse the repository at this point in the history