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

UnclosedParam error for "${source[@]}" #410

Open
kpcyrd opened this issue Aug 27, 2024 · 1 comment
Open

UnclosedParam error for "${source[@]}" #410

kpcyrd opened this issue Aug 27, 2024 · 1 comment

Comments

@kpcyrd
Copy link
Contributor

kpcyrd commented Aug 27, 2024

hello, I noticed this shell script:

pkgname=sed
pkgver=4.9
source=("https://ftp.gnu.org/pub/gnu/sed/$pkgname-$pkgver.tar.xz"{,.sig})

for src in "${source[@]}"; do
  echo "$src"
done

Currently fails to parse with this error:

Error {
    cause: Syntax(
        UnclosedParam {
            opening_location: Location {
                code: Code {
                    value: RefCell {
                        value: "pkgname=sed\npkgver=4.9\nsource=(\"https://ftp.gnu.org/pub/gnu/sed/$pkgname-$pkgver.tar.xz\"{,.sig})\n\nfor src in \"${source[@]}\"; do\n",
                    },
                    start_line_number: 1,
                    source: Unknown,
                },
                range: 110..112,
            },
        },
    ),
    location: Location {
        code: Code {
            value: RefCell {
                value: "pkgname=sed\npkgver=4.9\nsource=(\"https://ftp.gnu.org/pub/gnu/sed/$pkgname-$pkgver.tar.xz\"{,.sig})\n\nfor src in \"${source[@]}\"; do\n",
            },
            start_line_number: 1,
            source: Unknown,
        },
        range: 118..119,
    },
}

I think this is due to "${source[@]}" which yash-syntax doesn't understand. When executing the script it's expected to print this output:

https://ftp.gnu.org/pub/gnu/sed/sed-4.9.tar.xz
https://ftp.gnu.org/pub/gnu/sed/sed-4.9.tar.xz.sig

Thanks for providing this library!

@magicant
Copy link
Owner

This syntax is not implemented yet. I intend to implement it, but am not sure exactly when.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants