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 a bunch of holes in external command args #632

Merged
merged 3 commits into from Sep 10, 2019

Commits on Sep 9, 2019

  1. Close a bunch of holes in external command args

    Previously, there was a single parsing rule for "bare words" that
    applied to both internal and external commands.
    
    This meant that, because `cargo +nightly` needed to work, we needed to
    add `+` as a valid character in bare words.
    
    The number of characters continued to grow, and the situation was
    becoming untenable. The current strategy would eventually eat up all
    syntax and make it impossible to add syntax like `@foo` to internal
    commands.
    
    This patch significantly restricts bare words and introduces a new token
    type (`ExternalWord`). An `ExternalWord` expands to an error in the
    internal syntax, but expands to a bare word in the external syntax.
    
    `ExternalWords` are highlighted in grey in the shell.
    wycats committed Sep 9, 2019
    Copy the full SHA
    4d3e7ef View commit details
    Browse the repository at this point in the history

Commits on Sep 10, 2019

  1. Added glob patterns to the syntax shapes

    Bare words now represent literal file names, and globs are a different
    syntax shape called "Pattern". This allows commands like `cp` to ask for
    a pattern as a source and a literal file as a target.
    
    This also means that attempting to pass a glob to a command that expects
    a literal path will produce an error.
    wycats committed Sep 10, 2019
    Copy the full SHA
    b15bb2c View commit details
    Browse the repository at this point in the history
  2. Copy the full SHA
    540e93a View commit details
    Browse the repository at this point in the history