Open PossiblyAShrub opened 3 months ago
Hm is that an old version? 0.20.0 ?
I was not able to reproduce on HEAD
$ cat foo.sh
hay define Package
hay define Package/INSTALL
Package {
name = "osh"
INSTALL {
cd dist {
./install
}
}
}
= _hay()
andy@hoover:~/git/oilshell/oil$ ysh foo.sh
(Dict) {source: null, children: [{type: "Package", args: [], children: [{type: "INSTALL", args: [], location_str: "foo.sh", location_start_line: 6, code_str: " "}], attrs: {name: "osh"}}]
If so, not sure when it got fixed ...
I'm not sure if the current HEAD
is right either. That code_str
is just whitespace.
OK interesting
This area needs another pass, to reflect all the YSH work since Hay was written
value.Command
, which didn't existvalue.Command
might need c.toJson()
, and then maybe json write (x)
can serialize value.Command
nodes -- with an option???BTW I remembered that we want to get rid of this CODE node convention
Instead of INSTALL { ... }
it should just be proc install { }
, which is a clearer sign that it's code in the block!
Reproduction (on HEAD):