- Combine and simplify string and backtick lexing.
- Allow newlines in strings and backticks.
- Add triple-delimited indented strings and backticks. Common indented literal non-blank line leading whitespace is stripped.
- If a literal newline is escaped, it will be suppressed.
- Backticks starting with `#!` are reserved for a future upgrade.
Unify lexing of backticks, cooked strings, and raw strings. Also allow
newlines in backticks and cooked strings, since I can't think of a reason
not to.
It's been around two and a half years, and many versions, since this
warning was first introduced, so it feels reasonable to finally turn it
into a hard error. It will remain a special-cased error for a little
while.
Add a setting that exports all variables by default, regardless of
whether they use the `export` keyword. This includes assignments as well
as parameters.
Just does dependency analysis of variable uses, allowing variables to be
used out of order in assignments, as long as there are no circular
dependencies.
However, use of environment variable is not known to Just, so exported
variables are only exported to child scopes, to avoid ordering dependencies,
since dependency analysis cannot be done.
Add the `--list-heading` option, to override the heading text printed
before a list, defaulting to `Available recipes:\n`, and
`--list-prefix`, to override the indentation before each list item.
Modify the lexer to keep track of opening `({[` and closing `]})` delimiters.
When the lexer would emit an eol or indent outside of a recipe when there
is at least one open delimiter, emit a whitespace token instead.
This allows expressions to be split on multiple lines, like so:
x := if 'a' == 'b' {
'x'
} else {
'y'
}
This does not work inside of recipe body interpolations, although this
restriction might relaxed in the future.
Add conditional expressions of the form:
foo := if lhs == rhs { then } else { otherwise }
`lhs`, `rhs`, `then`, and `otherwise` are all arbitrary expressions, and
can recursively include other conditionals. Conditionals short-circuit,
so the branch not taken isn't evaluated.
It is also possible to test for inequality with `==`.
Remove all manual tracking of which tokens would have been accepted by
the parser in favor of having the parser add tokens that it checks for
to a set of expected tokens, clearing them when it accepts a token, and
using the current contents of the set in error messages.
This is a massive improvement, and will make the parser easier to
modify going forward.
And, this actually solves my sole issue with hand-written parsers.
Thanks to matklad on reddit for suggesting this!
The `--choose` subcommand runs a chooser to select a recipe to run. The
chooser should read lines containing recipe names from standard input,
and write one of those names to standard output.
The chooser defaults to `fzf`, a popular fuzzy finder, but can be
overridden by setting $JUST_CHOOSER or passing `--chooser <CHOOSER>`.
Combine all integration test binaries into a single binary with the root
in `tests/lib.rs`. This also turns of automatic test discovery, so
when adding another set of integration tests, a mod statement will need
to be added to `tests/lib.rs`.
If an environment variable exists with the same key as a variable from a
`.env` file, skip the variable from the `.env` file in favor fo the key
from the environment.
On Windows, skip conversion if a shebang path does not include `/`. In
this case it is not a Unix path, and does not need to be converted to a
Windows path before running.
Make line continuations strip leading spaces on the next line.
This changes what is passed to the shell, so this is a breaking change.
However, I don't think that this will break any recipes.