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

Substantially reduce wrongly highlighted stuff for Bash #793

Merged
merged 3 commits into from
Oct 6, 2015

Commits on Oct 6, 2015

  1. Fix built-in commands and functions for the Bash language

    Keywords and functions should not start with a boundary character,
    because this leads to lots of false matches. Bash actually only
    allows a few boundary characters for commands and functions. This
    patch replaces the \b with an explicit list of allowed characters.
    This improves the highlighting of pathnames enourmously.
    
    Some examples of invalid highlighting this patch fixes:
    
    cat /etc/passwd
    cat ./if/else/something-file.txt
    
    This patch also adds the built-in commands ":" and ".".
    
    : NOOP-command
    . Source command
    zeitgeist87 committed Oct 6, 2015
    Configuration menu
    Copy the full SHA
    0eeaff3 View commit details
    Browse the repository at this point in the history
  2. Add support for arithmetic environments for the Bash language

    Currently arithmetic operators are wrongly matched all over the
    place. For example the dash in `ls -la` is highlighted as
    a minus operator, but for Bash it is only a string. Another
    example would be a simple path like this `cat 801-file.txt`. Here
    `801` is wrongly highlighted as a number and `-` is highlighted as
    an operator.
    
    Bash only supports numbers and arithmetic operators inside of a so called
    arithemtic environment `$((3 + 4))`. By supporting this and
    limiting numbers and arithmetic operators to arithemtic
    environments, a lot of wrongly highlighted stuff can be avoided.
    zeitgeist87 committed Oct 6, 2015
    Configuration menu
    Copy the full SHA
    e83dcff View commit details
    Browse the repository at this point in the history
  3. Support for command substitution for the Bash language

    Command substitution is a very important part of the Bash
    language. Every non trivial script uses it in one way or another.
    This patch adds support for it.
    zeitgeist87 committed Oct 6, 2015
    Configuration menu
    Copy the full SHA
    c628ce2 View commit details
    Browse the repository at this point in the history