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

Add way to style identifiers. #148

Merged
merged 3 commits into from
Oct 24, 2023

Commits on Oct 4, 2023

  1. feat: add way to style identifiers

    Replace "default" segment with "whitespace" and "identifier" segments,
    with fallback to "unknown" segment.
    
    Also, classify backticked identifiers like `foo` as "identifier" rather than "string".
    
    This allows for identifiers to be styled independently from strings and whitespace.
    
    It also simplifies getSegments() from 30 lines down to 5, by removing the special-case
    code for the "default" segment.
    
    BREAKING CHANGE: The `default` segment has been split into `identifier` and `whitespace`
    segments.  There's also a new `unknown` segment that will only show up for malformed
    SQL such as an unclosed string.
    
    However, the highlight() function works largely the same as before, both normal mode and HTML mode,
    except for the bug fix to stop classifying identifiers as strings.  In other words, SQL like
    
    select * from EMP where NAME="John Smith"
    
    will get highlighted the same as before, i.e. no syntax highlighting for EMP or NAME.
    
    Fixes scriptcoded#147.
    wkeese committed Oct 4, 2023
    Configuration menu
    Copy the full SHA
    d6fb836 View commit details
    Browse the repository at this point in the history

Commits on Oct 24, 2023

  1. Configuration menu
    Copy the full SHA
    a5dd7d6 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    2ea8ef1 View commit details
    Browse the repository at this point in the history