---
byo run-tests: yaks/TEST.sh

	test-hello
(nvalue.List
  items:[
    (nvalue.Symbol s:module)
    (nvalue.Symbol s:hello)
    (nvalue.List
      items:[
        (nvalue.Symbol s:func)
        (nvalue.Symbol s:main)
        (nvalue.List
          items:[
            (nvalue.Symbol s:"=>")
            (nvalue.List
              items:[
                (nvalue.List
                  items:[
                    (nvalue.Symbol s:argv)
                    (nvalue.List
                      items:[(nvalue.Symbol s:List) (nvalue.Symbol s:Str)]
                    )
                  ]
                )
              ]
            )
            (nvalue.Symbol s:Int)
          ]
        )
        (nvalue.List
          items:[
            (nvalue.Symbol s:call)
            (nvalue.Symbol s:print)
            (nvalue.Str s:hello)
          ]
        )
        (nvalue.List items:[(nvalue.Symbol s:return) (nvalue.Int i:42)])
      ]
    )
  ]
)
(Program
  main_module:foo
  modules:[
    (Module
      name:hello
      defs:[
        (mod_def.Func
          name:main
          sig:(Signature
            params:[(NameType name:argv typ:(ktype.List T:(ktype.Str)))]
            return_type:(ktype.Int)
          )
          statements:[
            (stmt.Return
              e:(Int i:42 loc:(Token path:path chunk:chunk start:0 length:3))
            )
          ]
        )
      ]
    )
  ]
)
#include "mycpp/runtime.h"
namespace hello {
int main(List<BigStr*>* argv) {
  return 42;
}
}  // namespace hello
	OK
	test-hello-cpp
[1/50] make-pystub _bin/shwrap/optview_gen core/optview_gen.py frontend/option_def.py
[2/50] make-pystub _bin/shwrap/consts_gen frontend/consts_gen.py _devbuild/gen/hnode_asdl.py _devbuild/gen/types_asdl.py asdl/ast.py asdl/gen_cpp.py asdl/pybase.py asdl/runtime.py asdl/util.py asdl/visitor.py frontend/builtin_def.py frontend/id_kind_def.py frontend/option_def.py mycpp/mops.py mycpp/mylib.py pylib/collections_.py
[3/50] make-pystub _bin/shwrap/asdl_main asdl/asdl_main.py asdl/ast.py asdl/front_end.py asdl/gen_cpp.py asdl/gen_python.py asdl/util.py asdl/visitor.py
[4/50] make-pystub _bin/shwrap/option_gen frontend/option_gen.py asdl/ast.py frontend/builtin_def.py frontend/option_def.py
[5/50] make-pystub _bin/shwrap/mycpp_main mycpp/mycpp_main.py mycpp/const_pass.py mycpp/control_flow_pass.py mycpp/conversion_pass.py mycpp/cppgen_pass.py mycpp/crash.py mycpp/format_strings.py mycpp/pass_state.py mycpp/translate.py mycpp/util.py mycpp/visitor.py
[6/50] consts_gen cpp _gen/frontend/id_kind.asdl
[7/50] asdl_main cpp  core/value.asdl _gen/core/value.asdl _gen/core/value.asdl_debug.py
[8/50] optview_gen > _gen/core/optview.h
[9/50] cxx opt '' mycpp/bump_leak_heap.cc _build/obj/cxx-opt/mycpp/bump_leak_heap.o
[10/50] asdl_main cpp --no-pretty-print-methods asdl/hnode.asdl _gen/asdl/hnode.asdl _gen/asdl/hnode.asdl_debug.py
[11/50] asdl_main cpp  core/runtime.asdl _gen/core/runtime.asdl _gen/core/runtime.asdl_debug.py
[12/50] asdl_main cpp  data_lang/nil8.asdl _gen/data_lang/nil8.asdl _gen/data_lang/nil8.asdl_debug.py
[13/50] consts_gen cpp _gen/frontend/option.asdl
[14/50] asdl_main cpp  display/pretty.asdl _gen/display/pretty.asdl _gen/display/pretty.asdl_debug.py
[15/50] consts_gen cpp-consts _gen/frontend/consts
[16/50] asdl_main cpp --no-pretty-print-methods frontend/types.asdl _gen/frontend/types.asdl _gen/frontend/types.asdl_debug.py
[17/50] asdl_main cpp  yaks/yaks.asdl _gen/yaks/yaks.asdl _gen/yaks/yaks.asdl_debug.py
[18/50] asdl_main cpp --abbrev-module=frontend.syntax_abbrev frontend/syntax.asdl _gen/frontend/syntax.asdl _gen/frontend/syntax.asdl_debug.py
[19/50] cxx opt '' mycpp/gc_iolib.cc _build/obj/cxx-opt/mycpp/gc_iolib.o
[20/50] cxx opt '' _gen/frontend/id_kind.asdl.cc _build/obj/cxx-opt/_gen/frontend/id_kind.asdl.o
[21/50] cxx opt '' _gen/display/pretty.asdl.cc _build/obj/cxx-opt/_gen/display/pretty.asdl.o
[22/50] cxx opt '' mycpp/gc_builtins.cc _build/obj/cxx-opt/mycpp/gc_builtins.o
[23/50] cxx opt '' mycpp/gc_mops.cc _build/obj/cxx-opt/mycpp/gc_mops.o
[24/50] cxx opt '' cpp/data_lang.cc _build/obj/cxx-opt/cpp/data_lang.o
[25/50] cxx opt '' mycpp/gc_mylib.cc _build/obj/cxx-opt/mycpp/gc_mylib.o
[26/50] cxx opt '' mycpp/hash.cc _build/obj/cxx-opt/mycpp/hash.o
[27/50] cxx opt '' _gen/core/runtime.asdl.cc _build/obj/cxx-opt/_gen/core/runtime.asdl.o
[28/50] cxx asan '' mycpp/bump_leak_heap.cc _build/obj/cxx-asan/mycpp/bump_leak_heap.o
[29/50] cxx opt '' mycpp/mark_sweep_heap.cc _build/obj/cxx-opt/mycpp/mark_sweep_heap.o
[30/50] cxx opt '' _gen/core/value.asdl.cc _build/obj/cxx-opt/_gen/core/value.asdl.o
[31/50] cxx asan '' mycpp/gc_mops.cc _build/obj/cxx-asan/mycpp/gc_mops.o
[32/50] cxx asan '' mycpp/gc_builtins.cc _build/obj/cxx-asan/mycpp/gc_builtins.o
[33/50] cxx asan '' mycpp/gc_iolib.cc _build/obj/cxx-asan/mycpp/gc_iolib.o
[34/50] cxx asan '' mycpp/hash.cc _build/obj/cxx-asan/mycpp/hash.o
[35/50] cxx asan '' mycpp/gc_mylib.cc _build/obj/cxx-asan/mycpp/gc_mylib.o
[36/50] cxx asan '' mycpp/mark_sweep_heap.cc _build/obj/cxx-asan/mycpp/mark_sweep_heap.o
[37/50] cxx opt '' _gen/data_lang/nil8.asdl.cc _build/obj/cxx-opt/_gen/data_lang/nil8.asdl.o
[38/50] cxx opt '' _gen/frontend/syntax.asdl.cc _build/obj/cxx-opt/_gen/frontend/syntax.asdl.o
[39/50] cxx opt '' cpp/frontend_match.cc _build/obj/cxx-opt/cpp/frontend_match.o
[40/50] cxx opt '' _gen/frontend/consts.cc _build/obj/cxx-opt/_gen/frontend/consts.o
[41/50] cxx asan '' mycpp/gc_str.cc _build/obj/cxx-asan/mycpp/gc_str.o
[42/50] cxx opt '' _gen/yaks/yaks.asdl.cc _build/obj/cxx-opt/_gen/yaks/yaks.asdl.o
[43/50] cxx opt '' mycpp/gc_str.cc _build/obj/cxx-opt/mycpp/gc_str.o
[44/50] gen-oils-for-unix yaks_main  _gen/yaks/yaks_main.mycpp yaks/preamble.h asdl/format.py asdl/runtime.py core/bash_impl.py core/error.py core/num.py data_lang/j8.py data_lang/j8_lite.py display/ansi.py display/pp_hnode.py display/pretty.py frontend/syntax_abbrev.py yaks/gen_cpp.py yaks/transform.py yaks/yaks_main.py
	mycpp: LOADING asdl/format.py asdl/runtime.py core/bash_impl.py core/error.py core/num.py data_lang/j8.py data_lang/j8_lite.py display/ansi.py display/pp_hnode.py display/pretty.py frontend/syntax_abbrev.py yaks/gen_cpp.py yaks/transform.py yaks/yaks_main.py
	mycpp pass: CONVERT
	mycpp pass: CONTROL FLOW
	mycpp: dumping control flow graph to _tmp/mycpp-facts
	mycpp pass: CONST
	mycpp pass: DECL
	mycpp pass: IMPL
	mycpp DONE
[45/50] cxx opt '' _gen/yaks/yaks_main.mycpp.cc _build/obj/cxx-opt/_gen/yaks/yaks_main.mycpp.o
_gen/yaks/yaks_main.mycpp.cc: In member function 'void j8::InstancePrinter::_PrintBashArray(value_asdl::value::BashArray*, int)':
_gen/yaks/yaks_main.mycpp.cc:2407:30: warning: variable 'error_code' set but not used [-Wunused-but-set-variable]
   runtime_asdl::error_code_t error_code;
                              ^~~~~~~~~~
[46/50] LINK cxx opt '' _bin/cxx-opt/yaks/yaks_main.mycpp _build/obj/cxx-opt/_gen/yaks/yaks_main.mycpp.o _build/obj/cxx-opt/_gen/core/runtime.asdl.o _build/obj/cxx-opt/_gen/core/value.asdl.o _build/obj/cxx-opt/cpp/data_lang.o _build/obj/cxx-opt/cpp/frontend_match.o _build/obj/cxx-opt/_gen/data_lang/nil8.asdl.o _build/obj/cxx-opt/_gen/display/pretty.asdl.o _build/obj/cxx-opt/_gen/frontend/consts.o _build/obj/cxx-opt/_gen/frontend/id_kind.asdl.o _build/obj/cxx-opt/_gen/frontend/syntax.asdl.o _build/obj/cxx-opt/mycpp/bump_leak_heap.o _build/obj/cxx-opt/mycpp/gc_builtins.o _build/obj/cxx-opt/mycpp/gc_iolib.o _build/obj/cxx-opt/mycpp/gc_mops.o _build/obj/cxx-opt/mycpp/gc_mylib.o _build/obj/cxx-opt/mycpp/gc_str.o _build/obj/cxx-opt/mycpp/hash.o _build/obj/cxx-opt/mycpp/mark_sweep_heap.o _build/obj/cxx-opt/_gen/yaks/yaks.asdl.o
[47/50] yaks cpp yaks/examples/hello.yaks > _gen/yaks/examples/hello_raw.yaks.cc
(nvalue.List
  items:[
    (nvalue.Symbol s:module)
    (nvalue.Symbol s:hello)
    (nvalue.List
      items:[
        (nvalue.Symbol s:func)
        (nvalue.Symbol s:main)
        (nvalue.List
          items:[
            (nvalue.Symbol s:"=>")
            (nvalue.List
              items:[
                (nvalue.List
                  items:[
                    (nvalue.Symbol s:argv)
                    (nvalue.List
                      items:[(nvalue.Symbol s:List) (nvalue.Symbol s:Str)]
                    )
                  ]
                )
              ]
            )
            (nvalue.Symbol s:Int)
          ]
        )
        (nvalue.List
          items:[
            (nvalue.Symbol s:call)
            (nvalue.Symbol s:print)
            (nvalue.Str s:hello)
          ]
        )
        (nvalue.List items:[(nvalue.Symbol s:return) (nvalue.Int i:42)])
      ]
    )
  ]
)
(Program
  main_module:foo
  modules:[
    (Module
      name:hello
      defs:[
        (mod_def.Func
          name:main
          sig:(Signature
            params:[(NameType name:argv typ:(ktype.List T:(ktype.Str)))]
            return_type:...0x3ffffffc
          )
          statements:[
            (stmt.Return
              e:(Int i:42 loc:(Token path:path chunk:chunk start:0 length:3))
            )
          ]
        )
      ]
    )
  ]
)
[48/50] wrap-cc _gen/yaks/examples/hello.yaks.cc yaks_main hello _gen/yaks/examples/hello_raw.yaks.cc "" _gen/yaks/examples/hello.yaks.cc
[49/50] cxx asan '' _gen/yaks/examples/hello.yaks.cc _build/obj/cxx-asan/_gen/yaks/examples/hello.yaks.o
[50/50] LINK cxx asan '' _bin/cxx-asan/yaks/examples/hello.yaks _build/obj/cxx-asan/_gen/yaks/examples/hello.yaks.o _build/obj/cxx-asan/mycpp/bump_leak_heap.o _build/obj/cxx-asan/mycpp/gc_builtins.o _build/obj/cxx-asan/mycpp/gc_iolib.o _build/obj/cxx-asan/mycpp/gc_mops.o _build/obj/cxx-asan/mycpp/gc_mylib.o _build/obj/cxx-asan/mycpp/gc_str.o _build/obj/cxx-asan/mycpp/hash.o _build/obj/cxx-asan/mycpp/mark_sweep_heap.o
+ nq-run status _bin/cxx-asan/yaks/examples/hello.yaks
+ local -n out_status=status
+ shift
+ local __status
+ set +o errexit
+ set -o errexit
+ _bin/cxx-asan/yaks/examples/hello.yaks
+ __status=42
+ set -o errexit
+ out_status=42
+ set -o errexit
+ nq-assert 42 = 42
+ test 42 = 42
+ exit 0
	OK
	test-syntax-errors
(print "hi")
(nvalue.List items:[(nvalue.Symbol s:print) (nvalue.Str s:hi)])
Traceback (most recent call last):
  File "yaks/yaks_main.py", line 148, in <module>
    main(sys.argv)
  File "yaks/yaks_main.py", line 122, in main
    prog = transform.Transform(nval)
  File "/home/uke/oil/yaks/transform.py", line 248, in Transform
    module = TransformModule(mod_n)
  File "/home/uke/oil/yaks/transform.py", line 208, in TransformModule
    mod_name = MustBeSymbol(mod_n[1])
  File "/home/uke/oil/yaks/transform.py", line 22, in MustBeSymbol
    raise AssertionError('Expected Symbol, got %s' % nval)
AssertionError: Expected Symbol, got (nvalue.Str s:hi)


+
(nvalue.Symbol s:"+")
Traceback (most recent call last):
  File "yaks/yaks_main.py", line 148, in <module>
    main(sys.argv)
  File "yaks/yaks_main.py", line 122, in main
    prog = transform.Transform(nval)
  File "/home/uke/oil/yaks/transform.py", line 247, in Transform
    mod_n = MustBeList(nval)
  File "/home/uke/oil/yaks/transform.py", line 29, in MustBeList
    raise AssertionError('Expected List, got %s' % nval)
AssertionError: Expected List, got (nvalue.Symbol s:"+")


(print
Unexpected EOF while parsing J8 (line 2, offset 7-7: 'int\n')

(print)oops
Unexpected trailing input (line 1, offset 7-11: 'int)oops\n')

	OK

devtools/byo.sh: 3 tests passed.
yaks/yaks.asdl -> (asdl_main) -> _devbuild/gen/yaks_asdl.py
Success: no issues found in 1 source file