1 | shopt --set oil:upgrade
|
2 |
|
3 | hay define Foo/TASK
|
4 |
|
5 |
|
6 | Foo {
|
7 | a = 'x'
|
8 |
|
9 | # aliases not allowed oil:upgrade
|
10 | # alias ll='ls -l'
|
11 | # ll _test
|
12 |
|
13 | # Dynamic parsing allowed in OSH, not Oil
|
14 | b[1]=1
|
15 |
|
16 | echo `echo backticks`
|
17 | eval 'echo eval'
|
18 |
|
19 | # At parse time, all the lines must be contiguous
|
20 |
|
21 | TASK {
|
22 | echo `echo task backticks`
|
23 | eval 'echo task eval'
|
24 | }
|
25 | }
|
26 |
|
27 | const children = _hay()->children[0]->children
|
28 |
|
29 | for child in (children) {
|
30 | echo "TYPE $[child->type]"
|
31 | if (child->type === 'TASK') {
|
32 | echo "CODE $[child->code_str]___"
|
33 | }
|
34 | }
|