colis-anr / morbig

A static parser for POSIX Shell
Other
190 stars 8 forks source link

<you should not see this> #117

Open Niols opened 4 years ago

Niols commented 4 years ago

Morbig parses:

for a in $(b | c <<$d)
do
    e
done

as

[
    "IoHere_DLess_HereEnd",
    [
        "HereEnd_Word",
        [
            "Word",
            "$d",
            [
                [
                    "WordVariable",
                    [
                        "VariableAtom",
                        "d",
                        [
                            "NoAttribute"
                        ]
                    ]
                ]
            ]
        ]
    ],
    [
        "Word",
        "<you should not see this>",
        []
    ]
]
Niols commented 4 years ago

It is to be noted that dash also has a pretty weird behaviour on such a script.