just icon indicating copy to clipboard operation
just copied to clipboard

Docs for working-directory attribute have incorrect syntax

Open nk9 opened this issue 7 months ago • 2 comments

In 1.38, the working-directory attribute was added. The documentation page includes this example:

[working-directory: 'bar']
@foo:
  pwd

But attributes (at least as of 1.40) take arguments using parentheses, not this colon syntax. The docs should be updated.

nk9 avatar May 05 '25 14:05 nk9

But attributes (at least as of 1.40) take arguments using parentheses, not this colon syntax.

Both ways are valid. The colon syntax is an alternative way to specify only a single argument, the parentheses form also works with multiple arguments (e.g. [script] attribute).

laniakea64 avatar May 05 '25 14:05 laniakea64

In that case, the GRAMMAR.md needs to be updated:

attribute     : NAME ( '(' string ')' )?

It sounds like this needs to define both the colon-separated style, and also the case where multiple comma-separated strings are passed. And while we're at it, the grammar should make clear that backticks aren't valid here.

nk9 avatar May 05 '25 15:05 nk9

Fixed! The grammar was very out of date.

string is defined as:

string        : 'x'? STRING
              | 'x'? INDENTED_STRING
              | 'x'? RAW_STRING
              | 'x'? INDENTED_RAW_STRING

So it doesn't include backticks.

casey avatar Jun 24 '25 08:06 casey

Great, thank you!

nk9 avatar Jun 24 '25 13:06 nk9