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

[Close #22] Lines are lexically aware of keywords #24

Merged
merged 2 commits into from
Dec 4, 2020
Merged

Commits on Dec 4, 2020

  1. Make debugging easier

    schneems committed Dec 4, 2020
    Configuration menu
    Copy the full SHA
    149a7e5 View commit details
    Browse the repository at this point in the history
  2. [Close #22] Lines are lexically aware of keywords

    CodeLines are now lexically aware of keywords. This is used by the AroundBlockScan to allow stopping after a keyword has been hit.
    
    In addition to stripping heredocs before searching, the CodeSearch now also strips lines that contain only comments. The combination of stripping heredocs and comments prevents false positives from lexing individual lines (since a comment might contain valid code i.e. `# def foo; end`. 
    
    New APIs:
    
    - CodeLine#is_comment?
    - CodeLine#is_kw?
    - CodeLine#is_end?
    - AroundBlockScan.stop_after_kw
    - AroundBlockScan.scan_neighbors
    schneems committed Dec 4, 2020
    Configuration menu
    Copy the full SHA
    bb9f7cc View commit details
    Browse the repository at this point in the history