Commit b5aaf1f Andy C
committed
1 parent ff6db71 commit b5aaf1f Copy full SHA for b5aaf1f
File tree 1 file changed +32
-17
lines changed
1 file changed +32
-17
lines changed Original file line number Diff line number Diff line change @@ -821,38 +821,53 @@ echo '
821
821
Package cpython {
822
822
version = "3.12"
823
823
url = "https://python.org/"
824
- if (false) {
825
824
proc build {
825
+ echo "hi from build proc"
826
826
echo $version
827
827
}
828
828
}
829
- }
830
829
' > def.hay
831
830
832
831
# TODO:
833
- # - nullify_fields=true - well some of them aren't fields
834
- # - nullify=true
835
- # - errors='null'
836
- # - on_error=null
837
- # - drop_with='error' drop_with='null'
838
- # - degrade_to_null=true
839
- # - replace_with_null=true
840
- # - null_replace=true
841
- # - null_replacer=true # replacer can be a function?
842
- # - errors=false # too vague?
843
- #
832
+ # null_replacer=true
844
833
# JavaScript has a second "replacer" arg, which can be a function, or an array
845
834
# I guess you can specify replacer=null
835
+ #
836
+ # Invert it: Or maybe type_errors=true
837
+ #
838
+ # When type_errors=false (default), any unserializable value becomes null
839
+
840
+ echo ' json write (_hay())' > stage-1.ysh
841
+
842
+ # Stage 1
843
+
844
+ ... $[ENV.SH] -o ysh:all
845
+ --eval-pure pre.ysh
846
+ --eval-pure def.hay
847
+ --eval-pure stage-1.ysh
848
+ -c ' '
849
+ || true
850
+ ;
846
851
847
- echo ' json write (_hay())' > post.ysh
852
+ # Stage 2
853
+
854
+ echo '
855
+ var pkg = _hay().children[0]
856
+ var build_proc = pkg.attrs.build
857
+ build_proc
858
+ ' > stage-2.ysh
859
+
860
+ # Stage 1
848
861
849
862
... $[ENV.SH] -o ysh:all
850
- --eval pre.ysh
851
- --eval def.hay
852
- --eval post .ysh
863
+ --eval-pure pre.ysh
864
+ --eval-pure def.hay
865
+ --eval stage-2 .ysh # This one isn't pure
853
866
-c ' '
854
867
;
855
868
869
+
870
+
856
871
# # STDOUT:
857
872
a
858
873
# # END
You can’t perform that action at this time.
0 commit comments