├── .classpath ├── .gitignore ├── .project ├── AUTHORS ├── COPYRIGHT ├── README.md ├── build.xml ├── common.gypi ├── core ├── README ├── core.mag ├── io.mag ├── magpie │ ├── lexer.mag │ └── token.mag └── net.mag ├── dep ├── gyp │ ├── .gitignore │ ├── AUTHORS │ ├── DEPS │ ├── LICENSE │ ├── MANIFEST │ ├── OWNERS │ ├── PRESUBMIT.py │ ├── buildbot │ │ └── buildbot_run.py │ ├── codereview.settings │ ├── gyp │ ├── gyp.bat │ ├── gyp_dummy.c │ ├── gyptest.py │ ├── pylib │ │ └── gyp │ │ │ ├── MSVSNew.py │ │ │ ├── MSVSProject.py │ │ │ ├── MSVSSettings.py │ │ │ ├── MSVSSettings_test.py │ │ │ ├── MSVSToolFile.py │ │ │ ├── MSVSUserFile.py │ │ │ ├── MSVSVersion.py │ │ │ ├── SCons.py │ │ │ ├── __init__.py │ │ │ ├── common.py │ │ │ ├── common_test.py │ │ │ ├── easy_xml.py │ │ │ ├── easy_xml_test.py │ │ │ ├── generator │ │ │ ├── __init__.py │ │ │ ├── android.py │ │ │ ├── dump_dependency_json.py │ │ │ ├── eclipse.py │ │ │ ├── gypd.py │ │ │ ├── gypsh.py │ │ │ ├── make.py │ │ │ ├── msvs.py │ │ │ ├── msvs_test.py │ │ │ ├── ninja.py │ │ │ ├── ninja_test.py │ │ │ ├── scons.py │ │ │ └── xcode.py │ │ │ ├── input.py │ │ │ ├── mac_tool.py │ │ │ ├── msvs_emulation.py │ │ │ ├── ninja_syntax.py │ │ │ ├── sun_tool.py │ │ │ ├── win_tool.py │ │ │ ├── xcode_emulation.py │ │ │ ├── xcodeproj_file.py │ │ │ └── xml_fix.py │ ├── pylintrc │ ├── samples │ │ ├── samples │ │ └── samples.bat │ ├── setup.py │ ├── test │ │ ├── actions-bare │ │ │ ├── gyptest-bare.py │ │ │ └── src │ │ │ │ ├── bare.gyp │ │ │ │ └── bare.py │ │ ├── actions-multiple │ │ │ ├── gyptest-all.py │ │ │ └── src │ │ │ │ ├── actions.gyp │ │ │ │ ├── copy.py │ │ │ │ ├── filter.py │ │ │ │ ├── foo.c │ │ │ │ ├── input.txt │ │ │ │ └── main.c │ │ ├── actions-none │ │ │ ├── gyptest-none.py │ │ │ └── src │ │ │ │ ├── fake_cross.py │ │ │ │ ├── foo.cc │ │ │ │ └── none_with_source_files.gyp │ │ ├── actions-subdir │ │ │ ├── gyptest-action.py │ │ │ └── src │ │ │ │ ├── make-file.py │ │ │ │ ├── none.gyp │ │ │ │ └── subdir │ │ │ │ ├── make-subdir-file.py │ │ │ │ └── subdir.gyp │ │ ├── actions │ │ │ ├── gyptest-all.py │ │ │ ├── gyptest-default.py │ │ │ ├── gyptest-errors.py │ │ │ └── src │ │ │ │ ├── action_missing_name.gyp │ │ │ │ ├── actions.gyp │ │ │ │ ├── confirm-dep-files.py │ │ │ │ ├── subdir1 │ │ │ │ ├── counter.py │ │ │ │ ├── executable.gyp │ │ │ │ ├── make-prog1.py │ │ │ │ ├── make-prog2.py │ │ │ │ └── program.c │ │ │ │ ├── subdir2 │ │ │ │ ├── make-file.py │ │ │ │ └── none.gyp │ │ │ │ └── subdir3 │ │ │ │ ├── generate_main.py │ │ │ │ └── null_input.gyp │ │ ├── additional-targets │ │ │ ├── gyptest-additional.py │ │ │ └── src │ │ │ │ ├── all.gyp │ │ │ │ └── dir1 │ │ │ │ ├── actions.gyp │ │ │ │ ├── emit.py │ │ │ │ └── lib1.c │ │ ├── assembly │ │ │ ├── gyptest-assembly.py │ │ │ ├── gyptest-override.py │ │ │ └── src │ │ │ │ ├── as.bat │ │ │ │ ├── assembly.gyp │ │ │ │ ├── lib1.S │ │ │ │ ├── lib1.c │ │ │ │ ├── override.gyp │ │ │ │ ├── override_asm.asm │ │ │ │ └── program.c │ │ ├── build-option │ │ │ ├── gyptest-build.py │ │ │ ├── hello.c │ │ │ └── hello.gyp │ │ ├── builddir │ │ │ ├── gyptest-all.py │ │ │ ├── gyptest-default.py │ │ │ └── src │ │ │ │ ├── builddir.gypi │ │ │ │ ├── func1.c │ │ │ │ ├── func2.c │ │ │ │ ├── func3.c │ │ │ │ ├── func4.c │ │ │ │ ├── func5.c │ │ │ │ ├── prog1.c │ │ │ │ ├── prog1.gyp │ │ │ │ └── subdir2 │ │ │ │ ├── prog2.c │ │ │ │ ├── prog2.gyp │ │ │ │ └── subdir3 │ │ │ │ ├── prog3.c │ │ │ │ ├── prog3.gyp │ │ │ │ └── subdir4 │ │ │ │ ├── prog4.c │ │ │ │ ├── prog4.gyp │ │ │ │ └── subdir5 │ │ │ │ ├── prog5.c │ │ │ │ └── prog5.gyp │ │ ├── cflags │ │ │ ├── cflags.c │ │ │ ├── cflags.gyp │ │ │ └── gyptest-cflags.py │ │ ├── compilable │ │ │ ├── gyptest-headers.py │ │ │ └── src │ │ │ │ ├── headers.gyp │ │ │ │ ├── lib1.cpp │ │ │ │ ├── lib1.hpp │ │ │ │ └── program.cpp │ │ ├── compiler-override │ │ │ ├── compiler-global-settings.gyp.in │ │ │ ├── compiler-host.gyp │ │ │ ├── compiler.gyp │ │ │ ├── cxxtest.cc │ │ │ ├── gyptest-compiler-env.py │ │ │ ├── gyptest-compiler-global-settings.py │ │ │ ├── my_cc.py │ │ │ ├── my_cxx.py │ │ │ ├── my_ld.py │ │ │ └── test.c │ │ ├── configurations │ │ │ ├── basics │ │ │ │ ├── configurations.c │ │ │ │ ├── configurations.gyp │ │ │ │ └── gyptest-configurations.py │ │ │ ├── inheritance │ │ │ │ ├── configurations.c │ │ │ │ ├── configurations.gyp │ │ │ │ └── gyptest-inheritance.py │ │ │ ├── invalid │ │ │ │ ├── actions.gyp │ │ │ │ ├── all_dependent_settings.gyp │ │ │ │ ├── configurations.gyp │ │ │ │ ├── dependencies.gyp │ │ │ │ ├── direct_dependent_settings.gyp │ │ │ │ ├── gyptest-configurations.py │ │ │ │ ├── libraries.gyp │ │ │ │ ├── link_settings.gyp │ │ │ │ ├── sources.gyp │ │ │ │ ├── standalone_static_library.gyp │ │ │ │ ├── target_name.gyp │ │ │ │ └── type.gyp │ │ │ ├── target_platform │ │ │ │ ├── configurations.gyp │ │ │ │ ├── front.c │ │ │ │ ├── gyptest-target_platform.py │ │ │ │ ├── left.c │ │ │ │ └── right.c │ │ │ └── x64 │ │ │ │ ├── configurations.c │ │ │ │ ├── configurations.gyp │ │ │ │ └── gyptest-x86.py │ │ ├── copies │ │ │ ├── gyptest-all.py │ │ │ ├── gyptest-default.py │ │ │ ├── gyptest-slash.py │ │ │ ├── gyptest-updir.py │ │ │ └── src │ │ │ │ ├── copies-slash.gyp │ │ │ │ ├── copies-updir.gyp │ │ │ │ ├── copies.gyp │ │ │ │ ├── directory │ │ │ │ ├── file3 │ │ │ │ ├── file4 │ │ │ │ └── subdir │ │ │ │ │ └── file5 │ │ │ │ ├── file1 │ │ │ │ ├── file2 │ │ │ │ └── parentdir │ │ │ │ └── subdir │ │ │ │ └── file6 │ │ ├── custom-generator │ │ │ ├── gyptest-custom-generator.py │ │ │ ├── mygenerator.py │ │ │ └── test.gyp │ │ ├── cxxflags │ │ │ ├── cxxflags.cc │ │ │ ├── cxxflags.gyp │ │ │ └── gyptest-cxxflags.py │ │ ├── defines-escaping │ │ │ ├── defines-escaping.c │ │ │ ├── defines-escaping.gyp │ │ │ └── gyptest-defines-escaping.py │ │ ├── defines │ │ │ ├── defines-env.gyp │ │ │ ├── defines.c │ │ │ ├── defines.gyp │ │ │ ├── gyptest-define-override.py │ │ │ ├── gyptest-defines-env-regyp.py │ │ │ ├── gyptest-defines-env.py │ │ │ └── gyptest-defines.py │ │ ├── dependencies │ │ │ ├── a.c │ │ │ ├── b │ │ │ │ ├── b.c │ │ │ │ ├── b.gyp │ │ │ │ └── b3.c │ │ │ ├── c │ │ │ │ ├── c.c │ │ │ │ ├── c.gyp │ │ │ │ └── d.c │ │ │ ├── double_dependency.gyp │ │ │ ├── double_dependent.gyp │ │ │ ├── extra_targets.gyp │ │ │ ├── gyptest-double-dependency.py │ │ │ ├── gyptest-extra-targets.py │ │ │ ├── gyptest-lib-only.py │ │ │ ├── gyptest-none-traversal.py │ │ │ ├── lib_only.gyp │ │ │ ├── main.c │ │ │ └── none_traversal.gyp │ │ ├── dependency-copy │ │ │ ├── gyptest-copy.py │ │ │ └── src │ │ │ │ ├── copies.gyp │ │ │ │ ├── file1.c │ │ │ │ └── file2.c │ │ ├── errors │ │ │ ├── duplicate_basenames.gyp │ │ │ ├── duplicate_node.gyp │ │ │ ├── duplicate_rule.gyp │ │ │ ├── duplicate_targets.gyp │ │ │ ├── gyptest-errors.py │ │ │ ├── missing_dep.gyp │ │ │ └── missing_targets.gyp │ │ ├── escaping │ │ │ ├── colon │ │ │ │ └── test.gyp │ │ │ └── gyptest-colon.py │ │ ├── exclusion │ │ │ ├── exclusion.gyp │ │ │ ├── gyptest-exclusion.py │ │ │ └── hello.c │ │ ├── external-cross-compile │ │ │ ├── gyptest-cross.py │ │ │ └── src │ │ │ │ ├── bogus1.cc │ │ │ │ ├── bogus2.c │ │ │ │ ├── cross.gyp │ │ │ │ ├── cross_compile.gypi │ │ │ │ ├── fake_cross.py │ │ │ │ ├── program.cc │ │ │ │ ├── test1.cc │ │ │ │ ├── test2.c │ │ │ │ ├── test3.cc │ │ │ │ ├── test4.c │ │ │ │ └── tochar.py │ │ ├── generator-output │ │ │ ├── actions │ │ │ │ ├── actions.gyp │ │ │ │ ├── subdir1 │ │ │ │ │ ├── actions-out │ │ │ │ │ │ └── README.txt │ │ │ │ │ ├── executable.gyp │ │ │ │ │ ├── make-prog1.py │ │ │ │ │ ├── make-prog2.py │ │ │ │ │ └── program.c │ │ │ │ └── subdir2 │ │ │ │ │ ├── actions-out │ │ │ │ │ └── README.txt │ │ │ │ │ ├── make-file.py │ │ │ │ │ └── none.gyp │ │ │ ├── copies │ │ │ │ ├── copies-out │ │ │ │ │ └── README.txt │ │ │ │ ├── copies.gyp │ │ │ │ ├── file1 │ │ │ │ ├── file2 │ │ │ │ └── subdir │ │ │ │ │ ├── copies-out │ │ │ │ │ └── README.txt │ │ │ │ │ ├── file3 │ │ │ │ │ ├── file4 │ │ │ │ │ └── subdir.gyp │ │ │ ├── gyptest-actions.py │ │ │ ├── gyptest-copies.py │ │ │ ├── gyptest-mac-bundle.py │ │ │ ├── gyptest-relocate.py │ │ │ ├── gyptest-rules.py │ │ │ ├── gyptest-subdir2-deep.py │ │ │ ├── gyptest-symlink.py │ │ │ ├── gyptest-top-all.py │ │ │ ├── mac-bundle │ │ │ │ ├── Info.plist │ │ │ │ ├── app.order │ │ │ │ ├── header.h │ │ │ │ ├── main.c │ │ │ │ ├── resource.sb │ │ │ │ └── test.gyp │ │ │ ├── rules │ │ │ │ ├── copy-file.py │ │ │ │ ├── rules.gyp │ │ │ │ ├── subdir1 │ │ │ │ │ ├── define3.in0 │ │ │ │ │ ├── define4.in0 │ │ │ │ │ ├── executable.gyp │ │ │ │ │ ├── function1.in1 │ │ │ │ │ ├── function2.in1 │ │ │ │ │ └── program.c │ │ │ │ └── subdir2 │ │ │ │ │ ├── file1.in0 │ │ │ │ │ ├── file2.in0 │ │ │ │ │ ├── file3.in1 │ │ │ │ │ ├── file4.in1 │ │ │ │ │ ├── none.gyp │ │ │ │ │ └── rules-out │ │ │ │ │ └── README.txt │ │ │ └── src │ │ │ │ ├── inc.h │ │ │ │ ├── inc1 │ │ │ │ └── include1.h │ │ │ │ ├── prog1.c │ │ │ │ ├── prog1.gyp │ │ │ │ ├── subdir2 │ │ │ │ ├── deeper │ │ │ │ │ ├── deeper.c │ │ │ │ │ ├── deeper.gyp │ │ │ │ │ └── deeper.h │ │ │ │ ├── inc2 │ │ │ │ │ └── include2.h │ │ │ │ ├── prog2.c │ │ │ │ └── prog2.gyp │ │ │ │ ├── subdir3 │ │ │ │ ├── inc3 │ │ │ │ │ └── include3.h │ │ │ │ ├── prog3.c │ │ │ │ └── prog3.gyp │ │ │ │ └── symroot.gypi │ │ ├── gyp-defines │ │ │ ├── defines.gyp │ │ │ ├── echo.py │ │ │ ├── gyptest-multiple-values.py │ │ │ └── gyptest-regyp.py │ │ ├── hard_dependency │ │ │ ├── gyptest-exported-hard-dependency.py │ │ │ ├── gyptest-no-exported-hard-dependency.py │ │ │ └── src │ │ │ │ ├── a.c │ │ │ │ ├── a.h │ │ │ │ ├── b.c │ │ │ │ ├── b.h │ │ │ │ ├── c.c │ │ │ │ ├── c.h │ │ │ │ ├── d.c │ │ │ │ ├── emit.py │ │ │ │ └── hard_dependency.gyp │ │ ├── hello │ │ │ ├── gyptest-all.py │ │ │ ├── gyptest-default.py │ │ │ ├── gyptest-disable-regyp.py │ │ │ ├── gyptest-regyp.py │ │ │ ├── gyptest-target.py │ │ │ ├── hello.c │ │ │ ├── hello.gyp │ │ │ ├── hello2.c │ │ │ └── hello2.gyp │ │ ├── home_dot_gyp │ │ │ ├── gyptest-home-includes-regyp.py │ │ │ ├── gyptest-home-includes.py │ │ │ ├── home │ │ │ │ └── .gyp │ │ │ │ │ └── include.gypi │ │ │ ├── home2 │ │ │ │ └── .gyp │ │ │ │ │ └── include.gypi │ │ │ └── src │ │ │ │ ├── all.gyp │ │ │ │ └── printfoo.c │ │ ├── include_dirs │ │ │ ├── gyptest-all.py │ │ │ ├── gyptest-default.py │ │ │ └── src │ │ │ │ ├── inc.h │ │ │ │ ├── inc1 │ │ │ │ └── include1.h │ │ │ │ ├── includes.c │ │ │ │ ├── includes.gyp │ │ │ │ ├── shadow1 │ │ │ │ └── shadow.h │ │ │ │ ├── shadow2 │ │ │ │ └── shadow.h │ │ │ │ └── subdir │ │ │ │ ├── inc.h │ │ │ │ ├── inc2 │ │ │ │ └── include2.h │ │ │ │ ├── subdir_includes.c │ │ │ │ └── subdir_includes.gyp │ │ ├── intermediate_dir │ │ │ ├── gyptest-intermediate-dir.py │ │ │ └── src │ │ │ │ ├── script.py │ │ │ │ ├── shared_infile.txt │ │ │ │ ├── test.gyp │ │ │ │ └── test2.gyp │ │ ├── lib │ │ │ ├── README.txt │ │ │ ├── TestCmd.py │ │ │ ├── TestCommon.py │ │ │ └── TestGyp.py │ │ ├── library │ │ │ ├── gyptest-shared-obj-install-path.py │ │ │ ├── gyptest-shared.py │ │ │ ├── gyptest-static.py │ │ │ └── src │ │ │ │ ├── lib1.c │ │ │ │ ├── lib1_moveable.c │ │ │ │ ├── lib2.c │ │ │ │ ├── lib2_moveable.c │ │ │ │ ├── library.gyp │ │ │ │ ├── program.c │ │ │ │ └── shared_dependency.gyp │ │ ├── link-objects │ │ │ ├── base.c │ │ │ ├── extra.c │ │ │ ├── gyptest-all.py │ │ │ └── link-objects.gyp │ │ ├── mac │ │ │ ├── action-envvars │ │ │ │ └── action │ │ │ │ │ ├── action.gyp │ │ │ │ │ └── action.sh │ │ │ ├── app-bundle │ │ │ │ ├── TestApp │ │ │ │ │ ├── English.lproj │ │ │ │ │ │ ├── InfoPlist.strings │ │ │ │ │ │ └── MainMenu.xib │ │ │ │ │ ├── TestApp-Info.plist │ │ │ │ │ ├── TestAppAppDelegate.h │ │ │ │ │ ├── TestAppAppDelegate.m │ │ │ │ │ └── main.m │ │ │ │ ├── empty.c │ │ │ │ └── test.gyp │ │ │ ├── archs │ │ │ │ ├── my_file.cc │ │ │ │ ├── my_main_file.cc │ │ │ │ ├── test-archs-x86_64.gyp │ │ │ │ └── test-no-archs.gyp │ │ │ ├── cflags │ │ │ │ ├── ccfile.cc │ │ │ │ ├── ccfile_withcflags.cc │ │ │ │ ├── cfile.c │ │ │ │ ├── cppfile.cpp │ │ │ │ ├── cppfile_withcflags.cpp │ │ │ │ ├── cxxfile.cxx │ │ │ │ ├── cxxfile_withcflags.cxx │ │ │ │ ├── mfile.m │ │ │ │ ├── mmfile.mm │ │ │ │ ├── mmfile_withcflags.mm │ │ │ │ └── test.gyp │ │ │ ├── copy-dylib │ │ │ │ ├── empty.c │ │ │ │ └── test.gyp │ │ │ ├── debuginfo │ │ │ │ ├── file.c │ │ │ │ └── test.gyp │ │ │ ├── depend-on-bundle │ │ │ │ ├── English.lproj │ │ │ │ │ └── InfoPlist.strings │ │ │ │ ├── Info.plist │ │ │ │ ├── bundle.c │ │ │ │ ├── executable.c │ │ │ │ └── test.gyp │ │ │ ├── framework-dirs │ │ │ │ ├── calculate.c │ │ │ │ └── framework-dirs.gyp │ │ │ ├── framework-headers │ │ │ │ ├── myframework.h │ │ │ │ ├── myframework.m │ │ │ │ └── test.gyp │ │ │ ├── framework │ │ │ │ ├── TestFramework │ │ │ │ │ ├── English.lproj │ │ │ │ │ │ └── InfoPlist.strings │ │ │ │ │ ├── Info.plist │ │ │ │ │ ├── ObjCVector.h │ │ │ │ │ ├── ObjCVector.mm │ │ │ │ │ ├── ObjCVectorInternal.h │ │ │ │ │ └── TestFramework_Prefix.pch │ │ │ │ ├── empty.c │ │ │ │ └── framework.gyp │ │ │ ├── global-settings │ │ │ │ └── src │ │ │ │ │ ├── dir1 │ │ │ │ │ └── dir1.gyp │ │ │ │ │ └── dir2 │ │ │ │ │ ├── dir2.gyp │ │ │ │ │ └── file.txt │ │ │ ├── gyptest-action-envvars.py │ │ │ ├── gyptest-app.py │ │ │ ├── gyptest-archs.py │ │ │ ├── gyptest-cflags.py │ │ │ ├── gyptest-copies.py │ │ │ ├── gyptest-copy-dylib.py │ │ │ ├── gyptest-debuginfo.py │ │ │ ├── gyptest-depend-on-bundle.py │ │ │ ├── gyptest-framework-dirs.py │ │ │ ├── gyptest-framework-headers.py │ │ │ ├── gyptest-framework.py │ │ │ ├── gyptest-global-settings.py │ │ │ ├── gyptest-infoplist-process.py │ │ │ ├── gyptest-installname.py │ │ │ ├── gyptest-ldflags-passed-to-libtool.py │ │ │ ├── gyptest-ldflags.py │ │ │ ├── gyptest-libraries.py │ │ │ ├── gyptest-loadable-module.py │ │ │ ├── gyptest-missing-cfbundlesignature.py │ │ │ ├── gyptest-non-strs-flattened-to-env.py │ │ │ ├── gyptest-objc-gc.py │ │ │ ├── gyptest-postbuild-copy-bundle.py │ │ │ ├── gyptest-postbuild-defaults.py │ │ │ ├── gyptest-postbuild-fail.py │ │ │ ├── gyptest-postbuild-multiple-configurations.py │ │ │ ├── gyptest-postbuild-static-library.gyp │ │ │ ├── gyptest-postbuild.py │ │ │ ├── gyptest-prefixheader.py │ │ │ ├── gyptest-rebuild.py │ │ │ ├── gyptest-rpath.py │ │ │ ├── gyptest-sdkroot.py │ │ │ ├── gyptest-sourceless-module.gyp │ │ │ ├── gyptest-strip.py │ │ │ ├── gyptest-type-envvars.py │ │ │ ├── gyptest-xcode-env-order.py │ │ │ ├── gyptest-xcode-gcc.py │ │ │ ├── infoplist-process │ │ │ │ ├── Info.plist │ │ │ │ ├── main.c │ │ │ │ ├── test1.gyp │ │ │ │ ├── test2.gyp │ │ │ │ └── test3.gyp │ │ │ ├── installname │ │ │ │ ├── Info.plist │ │ │ │ ├── file.c │ │ │ │ ├── main.c │ │ │ │ └── test.gyp │ │ │ ├── ldflags-libtool │ │ │ │ ├── file.c │ │ │ │ └── test.gyp │ │ │ ├── ldflags │ │ │ │ └── subdirectory │ │ │ │ │ ├── Info.plist │ │ │ │ │ ├── file.c │ │ │ │ │ ├── symbol_list.def │ │ │ │ │ └── test.gyp │ │ │ ├── libraries │ │ │ │ └── subdir │ │ │ │ │ ├── README.txt │ │ │ │ │ ├── hello.cc │ │ │ │ │ ├── mylib.c │ │ │ │ │ └── test.gyp │ │ │ ├── loadable-module │ │ │ │ ├── Info.plist │ │ │ │ ├── module.c │ │ │ │ └── test.gyp │ │ │ ├── missing-cfbundlesignature │ │ │ │ ├── Info.plist │ │ │ │ ├── Other-Info.plist │ │ │ │ ├── Third-Info.plist │ │ │ │ ├── file.c │ │ │ │ └── test.gyp │ │ │ ├── non-strs-flattened-to-env │ │ │ │ ├── Info.plist │ │ │ │ ├── main.c │ │ │ │ └── test.gyp │ │ │ ├── objc-gc │ │ │ │ ├── c-file.c │ │ │ │ ├── cc-file.cc │ │ │ │ ├── main.m │ │ │ │ ├── needs-gc-mm.mm │ │ │ │ ├── needs-gc.m │ │ │ │ └── test.gyp │ │ │ ├── postbuild-copy-bundle │ │ │ │ ├── Framework-Info.plist │ │ │ │ ├── TestApp-Info.plist │ │ │ │ ├── copied.txt │ │ │ │ ├── empty.c │ │ │ │ ├── main.c │ │ │ │ ├── postbuild-copy-framework.sh │ │ │ │ ├── resource_file.sb │ │ │ │ └── test.gyp │ │ │ ├── postbuild-defaults │ │ │ │ ├── Info.plist │ │ │ │ ├── main.c │ │ │ │ ├── postbuild-defaults.sh │ │ │ │ └── test.gyp │ │ │ ├── postbuild-fail │ │ │ │ ├── file.c │ │ │ │ ├── postbuild-fail.sh │ │ │ │ ├── test.gyp │ │ │ │ ├── touch-dynamic.sh │ │ │ │ └── touch-static.sh │ │ │ ├── postbuild-multiple-configurations │ │ │ │ ├── main.c │ │ │ │ ├── postbuild-touch-file.sh │ │ │ │ └── test.gyp │ │ │ ├── postbuild-static-library │ │ │ │ ├── empty.c │ │ │ │ ├── postbuild-touch-file.sh │ │ │ │ └── test.gyp │ │ │ ├── postbuilds │ │ │ │ ├── copy.sh │ │ │ │ ├── file.c │ │ │ │ ├── file_g.c │ │ │ │ ├── file_h.c │ │ │ │ ├── script │ │ │ │ │ ├── shared_library_postbuild.sh │ │ │ │ │ └── static_library_postbuild.sh │ │ │ │ ├── subdirectory │ │ │ │ │ ├── copied_file.txt │ │ │ │ │ └── nested_target.gyp │ │ │ │ └── test.gyp │ │ │ ├── prefixheader │ │ │ │ ├── file.c │ │ │ │ ├── file.cc │ │ │ │ ├── file.m │ │ │ │ ├── file.mm │ │ │ │ ├── header.h │ │ │ │ └── test.gyp │ │ │ ├── rebuild │ │ │ │ ├── TestApp-Info.plist │ │ │ │ ├── delay-touch.sh │ │ │ │ ├── empty.c │ │ │ │ ├── main.c │ │ │ │ └── test.gyp │ │ │ ├── rpath │ │ │ │ ├── file.c │ │ │ │ ├── main.c │ │ │ │ └── test.gyp │ │ │ ├── sdkroot │ │ │ │ ├── file.cc │ │ │ │ ├── test.gyp │ │ │ │ └── test_shorthand.sh │ │ │ ├── sourceless-module │ │ │ │ ├── empty.c │ │ │ │ └── test.gyp │ │ │ ├── strip │ │ │ │ ├── file.c │ │ │ │ ├── strip.saves │ │ │ │ ├── subdirectory │ │ │ │ │ ├── nested_file.c │ │ │ │ │ ├── nested_strip.saves │ │ │ │ │ ├── subdirectory.gyp │ │ │ │ │ └── test_reading_save_file_from_postbuild.sh │ │ │ │ └── test.gyp │ │ │ ├── type_envvars │ │ │ │ ├── file.c │ │ │ │ ├── test.gyp │ │ │ │ ├── test_bundle_executable.sh │ │ │ │ ├── test_bundle_loadable_module.sh │ │ │ │ ├── test_bundle_shared_library.sh │ │ │ │ ├── test_nonbundle_executable.sh │ │ │ │ ├── test_nonbundle_loadable_module.sh │ │ │ │ ├── test_nonbundle_none.sh │ │ │ │ ├── test_nonbundle_shared_library.sh │ │ │ │ └── test_nonbundle_static_library.sh │ │ │ ├── xcode-env-order │ │ │ │ ├── Info.plist │ │ │ │ ├── file.ext1 │ │ │ │ ├── file.ext2 │ │ │ │ ├── file.ext3 │ │ │ │ ├── main.c │ │ │ │ └── test.gyp │ │ │ └── xcode-gcc │ │ │ │ ├── test.gyp │ │ │ │ ├── valid_c.c │ │ │ │ ├── valid_cc.cc │ │ │ │ ├── valid_m.m │ │ │ │ ├── valid_mm.mm │ │ │ │ ├── warn_about_invalid_offsetof_macro.cc │ │ │ │ └── warn_about_missing_newline.c │ │ ├── make │ │ │ ├── dependencies.gyp │ │ │ ├── gyptest-dependencies.py │ │ │ ├── gyptest-noload.py │ │ │ ├── main.cc │ │ │ ├── main.h │ │ │ └── noload │ │ │ │ ├── all.gyp │ │ │ │ ├── lib │ │ │ │ ├── shared.c │ │ │ │ ├── shared.gyp │ │ │ │ └── shared.h │ │ │ │ └── main.c │ │ ├── many-actions │ │ │ ├── file0 │ │ │ ├── file1 │ │ │ ├── file2 │ │ │ ├── file3 │ │ │ ├── file4 │ │ │ ├── gyptest-many-actions-unsorted.py │ │ │ ├── gyptest-many-actions.py │ │ │ ├── many-actions-unsorted.gyp │ │ │ └── many-actions.gyp │ │ ├── module │ │ │ ├── gyptest-default.py │ │ │ └── src │ │ │ │ ├── lib1.c │ │ │ │ ├── lib2.c │ │ │ │ ├── module.gyp │ │ │ │ └── program.c │ │ ├── msvs │ │ │ ├── config_attrs │ │ │ │ ├── gyptest-config_attrs.py │ │ │ │ ├── hello.c │ │ │ │ └── hello.gyp │ │ │ ├── express │ │ │ │ ├── base │ │ │ │ │ └── base.gyp │ │ │ │ ├── express.gyp │ │ │ │ └── gyptest-express.py │ │ │ ├── list_excluded │ │ │ │ ├── gyptest-all.py │ │ │ │ ├── hello.cpp │ │ │ │ ├── hello_exclude.gyp │ │ │ │ └── hello_mac.cpp │ │ │ ├── missing_sources │ │ │ │ ├── gyptest-missing.py │ │ │ │ └── hello_missing.gyp │ │ │ ├── props │ │ │ │ ├── AppName.props │ │ │ │ ├── AppName.vsprops │ │ │ │ ├── gyptest-props.py │ │ │ │ ├── hello.c │ │ │ │ └── hello.gyp │ │ │ ├── shared_output │ │ │ │ ├── common.gypi │ │ │ │ ├── gyptest-shared_output.py │ │ │ │ ├── hello.c │ │ │ │ ├── hello.gyp │ │ │ │ └── there │ │ │ │ │ ├── there.c │ │ │ │ │ └── there.gyp │ │ │ └── uldi2010 │ │ │ │ ├── gyptest-all.py │ │ │ │ ├── hello.c │ │ │ │ ├── hello.gyp │ │ │ │ └── hello2.c │ │ ├── multiple-targets │ │ │ ├── gyptest-all.py │ │ │ ├── gyptest-default.py │ │ │ └── src │ │ │ │ ├── common.c │ │ │ │ ├── multiple.gyp │ │ │ │ ├── prog1.c │ │ │ │ └── prog2.c │ │ ├── ninja │ │ │ ├── action_dependencies │ │ │ │ ├── gyptest-action-dependencies.py │ │ │ │ └── src │ │ │ │ │ ├── a.c │ │ │ │ │ ├── a.h │ │ │ │ │ ├── action_dependencies.gyp │ │ │ │ │ ├── b.c │ │ │ │ │ ├── b.h │ │ │ │ │ ├── c.c │ │ │ │ │ ├── c.h │ │ │ │ │ └── emit.py │ │ │ ├── chained-dependency │ │ │ │ ├── chained-dependency.gyp │ │ │ │ ├── chained.c │ │ │ │ └── gyptest-chained-dependency.py │ │ │ ├── normalize-paths-win │ │ │ │ ├── gyptest-normalize-paths.py │ │ │ │ ├── hello.cc │ │ │ │ └── normalize-paths.gyp │ │ │ ├── s-needs-no-depfiles │ │ │ │ ├── empty.s │ │ │ │ ├── gyptest-s-needs-no-depfiles.py │ │ │ │ └── s-needs-no-depfiles.gyp │ │ │ ├── solibs_avoid_relinking │ │ │ │ ├── gyptest-solibs-avoid-relinking.py │ │ │ │ ├── main.cc │ │ │ │ ├── solib.cc │ │ │ │ └── solibs_avoid_relinking.gyp │ │ │ └── use-custom-environment-files │ │ │ │ ├── gyptest-use-custom-environment-files.py │ │ │ │ ├── use-custom-environment-files.cc │ │ │ │ └── use-custom-environment-files.gyp │ │ ├── no-output │ │ │ ├── gyptest-no-output.py │ │ │ └── src │ │ │ │ └── nooutput.gyp │ │ ├── product │ │ │ ├── gyptest-product.py │ │ │ ├── hello.c │ │ │ └── product.gyp │ │ ├── relative │ │ │ ├── foo │ │ │ │ ├── a │ │ │ │ │ ├── a.cc │ │ │ │ │ ├── a.gyp │ │ │ │ │ └── c │ │ │ │ │ │ ├── c.cc │ │ │ │ │ │ └── c.gyp │ │ │ │ └── b │ │ │ │ │ ├── b.cc │ │ │ │ │ └── b.gyp │ │ │ └── gyptest-default.py │ │ ├── rename │ │ │ ├── filecase │ │ │ │ ├── file.c │ │ │ │ ├── test-casesensitive.gyp │ │ │ │ └── test.gyp │ │ │ └── gyptest-filecase.py │ │ ├── restat │ │ │ ├── gyptest-restat.py │ │ │ └── src │ │ │ │ ├── create_intermediate.py │ │ │ │ ├── restat.gyp │ │ │ │ └── touch.py │ │ ├── rules-dirname │ │ │ ├── gyptest-dirname.py │ │ │ └── src │ │ │ │ ├── actions.gyp │ │ │ │ ├── copy-file.py │ │ │ │ └── subdir │ │ │ │ ├── a │ │ │ │ └── b │ │ │ │ │ ├── c.gencc │ │ │ │ │ └── c.printvars │ │ │ │ ├── foo │ │ │ │ └── bar │ │ │ │ │ ├── baz.gencc │ │ │ │ │ └── baz.printvars │ │ │ │ ├── input-rule-dirname.gyp │ │ │ │ ├── main.cc │ │ │ │ └── printvars.py │ │ ├── rules-rebuild │ │ │ ├── gyptest-all.py │ │ │ ├── gyptest-default.py │ │ │ └── src │ │ │ │ ├── main.c │ │ │ │ ├── make-sources.py │ │ │ │ ├── prog1.in │ │ │ │ ├── prog2.in │ │ │ │ └── same_target.gyp │ │ ├── rules-variables │ │ │ ├── gyptest-rules-variables.py │ │ │ └── src │ │ │ │ ├── input_ext.c │ │ │ │ ├── input_name │ │ │ │ └── test.c │ │ │ │ ├── input_path │ │ │ │ └── subdir │ │ │ │ │ └── test.c │ │ │ │ ├── subdir │ │ │ │ ├── input_dirname.c │ │ │ │ └── test.c │ │ │ │ ├── test.input_root.c │ │ │ │ └── variables.gyp │ │ ├── rules │ │ │ ├── gyptest-all.py │ │ │ ├── gyptest-default.py │ │ │ ├── gyptest-input-root.py │ │ │ ├── gyptest-special-variables.py │ │ │ └── src │ │ │ │ ├── actions.gyp │ │ │ │ ├── an_asm.S │ │ │ │ ├── as.bat │ │ │ │ ├── copy-file.py │ │ │ │ ├── external │ │ │ │ ├── external.gyp │ │ │ │ ├── file1.in │ │ │ │ └── file2.in │ │ │ │ ├── input-root.gyp │ │ │ │ ├── noaction │ │ │ │ ├── file1.in │ │ │ │ └── no_action_with_rules_fails.gyp │ │ │ │ ├── rule.py │ │ │ │ ├── somefile.ext │ │ │ │ ├── special-variables.gyp │ │ │ │ ├── subdir1 │ │ │ │ ├── executable.gyp │ │ │ │ ├── function1.in │ │ │ │ ├── function2.in │ │ │ │ └── program.c │ │ │ │ ├── subdir2 │ │ │ │ ├── file1.in │ │ │ │ ├── file2.in │ │ │ │ ├── never_used.gyp │ │ │ │ ├── no_action.gyp │ │ │ │ ├── no_inputs.gyp │ │ │ │ └── none.gyp │ │ │ │ ├── subdir3 │ │ │ │ ├── executable2.gyp │ │ │ │ ├── function3.in │ │ │ │ └── program.c │ │ │ │ └── subdir4 │ │ │ │ ├── asm-function.assem │ │ │ │ ├── build-asm.gyp │ │ │ │ └── program.c │ │ ├── same-gyp-name │ │ │ ├── gyptest-all.py │ │ │ ├── gyptest-default.py │ │ │ ├── gyptest-library.py │ │ │ ├── library │ │ │ │ ├── one │ │ │ │ │ └── sub.gyp │ │ │ │ ├── test.gyp │ │ │ │ └── two │ │ │ │ │ └── sub.gyp │ │ │ └── src │ │ │ │ ├── all.gyp │ │ │ │ ├── subdir1 │ │ │ │ ├── executable.gyp │ │ │ │ └── main1.cc │ │ │ │ └── subdir2 │ │ │ │ ├── executable.gyp │ │ │ │ └── main2.cc │ │ ├── same-rule-output-file-name │ │ │ ├── gyptest-all.py │ │ │ └── src │ │ │ │ ├── subdir1 │ │ │ │ └── subdir1.gyp │ │ │ │ ├── subdir2 │ │ │ │ └── subdir2.gyp │ │ │ │ ├── subdirs.gyp │ │ │ │ └── touch.py │ │ ├── same-source-file-name │ │ │ ├── gyptest-all.py │ │ │ ├── gyptest-default.py │ │ │ ├── gyptest-fail-shared.py │ │ │ ├── gyptest-fail-static.py │ │ │ ├── gyptest-pass-executable.py │ │ │ └── src │ │ │ │ ├── all.gyp │ │ │ │ ├── double-executable.gyp │ │ │ │ ├── double-shared.gyp │ │ │ │ ├── double-static.gyp │ │ │ │ ├── func.c │ │ │ │ ├── prog1.c │ │ │ │ ├── prog2.c │ │ │ │ ├── prog3.c │ │ │ │ ├── subdir1 │ │ │ │ └── func.c │ │ │ │ └── subdir2 │ │ │ │ └── func.c │ │ ├── same-target-name-different-directory │ │ │ ├── gyptest-all.py │ │ │ └── src │ │ │ │ ├── subdir1 │ │ │ │ └── subdir1.gyp │ │ │ │ ├── subdir2 │ │ │ │ └── subdir2.gyp │ │ │ │ ├── subdirs.gyp │ │ │ │ └── touch.py │ │ ├── same-target-name │ │ │ ├── gyptest-same-target-name.py │ │ │ └── src │ │ │ │ ├── all.gyp │ │ │ │ ├── executable1.gyp │ │ │ │ └── executable2.gyp │ │ ├── sanitize-rule-names │ │ │ ├── blah.S │ │ │ ├── gyptest-sanitize-rule-names.py │ │ │ ├── hello.cc │ │ │ ├── sanitize-rule-names.gyp │ │ │ └── script.py │ │ ├── scons_tools │ │ │ ├── gyptest-tools.py │ │ │ ├── site_scons │ │ │ │ └── site_tools │ │ │ │ │ └── this_tool.py │ │ │ ├── tools.c │ │ │ └── tools.gyp │ │ ├── sibling │ │ │ ├── gyptest-all.py │ │ │ ├── gyptest-relocate.py │ │ │ └── src │ │ │ │ ├── prog1 │ │ │ │ ├── prog1.c │ │ │ │ └── prog1.gyp │ │ │ │ └── prog2 │ │ │ │ ├── prog2.c │ │ │ │ └── prog2.gyp │ │ ├── small │ │ │ └── gyptest-small.py │ │ ├── standalone-static-library │ │ │ ├── gyptest-standalone-static-library.py │ │ │ ├── invalid.gyp │ │ │ ├── mylib.c │ │ │ ├── mylib.gyp │ │ │ └── prog.c │ │ ├── standalone │ │ │ ├── gyptest-standalone.py │ │ │ └── standalone.gyp │ │ ├── subdirectory │ │ │ ├── gyptest-SYMROOT-all.py │ │ │ ├── gyptest-SYMROOT-default.py │ │ │ ├── gyptest-subdir-all.py │ │ │ ├── gyptest-subdir-default.py │ │ │ ├── gyptest-subdir2-deep.py │ │ │ ├── gyptest-top-all.py │ │ │ ├── gyptest-top-default.py │ │ │ └── src │ │ │ │ ├── prog1.c │ │ │ │ ├── prog1.gyp │ │ │ │ ├── subdir │ │ │ │ ├── prog2.c │ │ │ │ ├── prog2.gyp │ │ │ │ └── subdir2 │ │ │ │ │ ├── prog3.c │ │ │ │ │ └── prog3.gyp │ │ │ │ └── symroot.gypi │ │ ├── toolsets │ │ │ ├── gyptest-toolsets.py │ │ │ ├── main.cc │ │ │ ├── toolsets.cc │ │ │ └── toolsets.gyp │ │ ├── toplevel-dir │ │ │ ├── gyptest-toplevel-dir.py │ │ │ └── src │ │ │ │ ├── sub1 │ │ │ │ ├── main.gyp │ │ │ │ └── prog1.c │ │ │ │ └── sub2 │ │ │ │ ├── prog2.c │ │ │ │ └── prog2.gyp │ │ ├── variables │ │ │ ├── commands │ │ │ │ ├── commands-repeated.gyp │ │ │ │ ├── commands-repeated.gyp.stdout │ │ │ │ ├── commands-repeated.gypd.golden │ │ │ │ ├── commands.gyp │ │ │ │ ├── commands.gyp.ignore-env.stdout │ │ │ │ ├── commands.gyp.stdout │ │ │ │ ├── commands.gypd.golden │ │ │ │ ├── commands.gypi │ │ │ │ ├── gyptest-commands-ignore-env.py │ │ │ │ ├── gyptest-commands-repeated.py │ │ │ │ ├── gyptest-commands.py │ │ │ │ ├── test.py │ │ │ │ └── update_golden │ │ │ ├── filelist │ │ │ │ ├── filelist.gyp.stdout │ │ │ │ ├── filelist.gypd.golden │ │ │ │ ├── gyptest-filelist.py │ │ │ │ ├── src │ │ │ │ │ └── filelist.gyp │ │ │ │ └── update_golden │ │ │ ├── latelate │ │ │ │ ├── gyptest-latelate.py │ │ │ │ └── src │ │ │ │ │ ├── latelate.gyp │ │ │ │ │ └── program.cc │ │ │ └── variable-in-path │ │ │ │ ├── C1 │ │ │ │ └── hello.cc │ │ │ │ ├── gyptest-variable-in-path.py │ │ │ │ └── variable-in-path.gyp │ │ ├── variants │ │ │ ├── gyptest-variants.py │ │ │ └── src │ │ │ │ ├── variants.c │ │ │ │ └── variants.gyp │ │ └── win │ │ │ ├── asm-files │ │ │ ├── asm-files.gyp │ │ │ ├── b.s │ │ │ ├── c.S │ │ │ └── hello.cc │ │ │ ├── batch-file-action │ │ │ ├── batch-file-action.gyp │ │ │ ├── infile │ │ │ └── somecmd.bat │ │ │ ├── command-quote │ │ │ ├── a.S │ │ │ ├── bat with spaces.bat │ │ │ ├── command-quote.gyp │ │ │ ├── go.bat │ │ │ └── subdir │ │ │ │ └── and │ │ │ │ └── another │ │ │ │ └── in-subdir.gyp │ │ │ ├── compiler-flags │ │ │ ├── additional-include-dirs.cc │ │ │ ├── additional-include-dirs.gyp │ │ │ ├── additional-options.cc │ │ │ ├── additional-options.gyp │ │ │ ├── analysis.gyp │ │ │ ├── buffer-security-check.gyp │ │ │ ├── buffer-security.cc │ │ │ ├── character-set-mbcs.cc │ │ │ ├── character-set-unicode.cc │ │ │ ├── character-set.gyp │ │ │ ├── debug-format.gyp │ │ │ ├── default-char-is-unsigned.cc │ │ │ ├── default-char-is-unsigned.gyp │ │ │ ├── exception-handling-on.cc │ │ │ ├── exception-handling.gyp │ │ │ ├── force-include-files.cc │ │ │ ├── force-include-files.gyp │ │ │ ├── function-level-linking.cc │ │ │ ├── function-level-linking.gyp │ │ │ ├── hello.cc │ │ │ ├── optimizations.gyp │ │ │ ├── pdbname.cc │ │ │ ├── pdbname.gyp │ │ │ ├── rtti-on.cc │ │ │ ├── rtti.gyp │ │ │ ├── runtime-checks.cc │ │ │ ├── runtime-checks.gyp │ │ │ ├── runtime-library-md.cc │ │ │ ├── runtime-library-mdd.cc │ │ │ ├── runtime-library-mt.cc │ │ │ ├── runtime-library-mtd.cc │ │ │ ├── runtime-library.gyp │ │ │ ├── subdir │ │ │ │ └── header.h │ │ │ ├── treat-wchar-t-as-built-in-type.gyp │ │ │ ├── treat-wchar-t-as-built-in-type1.cc │ │ │ ├── treat-wchar-t-as-built-in-type2.cc │ │ │ ├── uninit.cc │ │ │ ├── warning-as-error.cc │ │ │ ├── warning-as-error.gyp │ │ │ ├── warning-level.gyp │ │ │ ├── warning-level1.cc │ │ │ ├── warning-level2.cc │ │ │ ├── warning-level3.cc │ │ │ └── warning-level4.cc │ │ │ ├── gyptest-asm-files.py │ │ │ ├── gyptest-cl-additional-include-dirs.py │ │ │ ├── gyptest-cl-additional-options.py │ │ │ ├── gyptest-cl-analysis.py │ │ │ ├── gyptest-cl-buffer-security-check.py │ │ │ ├── gyptest-cl-character-set.py │ │ │ ├── gyptest-cl-debug-format.py │ │ │ ├── gyptest-cl-default-char-is-unsigned.py │ │ │ ├── gyptest-cl-exception-handling.py │ │ │ ├── gyptest-cl-force-include-files.py │ │ │ ├── gyptest-cl-function-level-linking.py │ │ │ ├── gyptest-cl-optimizations.py │ │ │ ├── gyptest-cl-pdbname.py │ │ │ ├── gyptest-cl-rtti.py │ │ │ ├── gyptest-cl-runtime-checks.py │ │ │ ├── gyptest-cl-runtime-library.py │ │ │ ├── gyptest-cl-treat-wchar-t-as-built-in-type.py │ │ │ ├── gyptest-cl-warning-as-error.py │ │ │ ├── gyptest-cl-warning-level.py │ │ │ ├── gyptest-command-quote.py │ │ │ ├── gyptest-lib-ltcg.py │ │ │ ├── gyptest-link-additional-deps.py │ │ │ ├── gyptest-link-additional-options.py │ │ │ ├── gyptest-link-aslr.py │ │ │ ├── gyptest-link-debug-info.py │ │ │ ├── gyptest-link-default-libs.py │ │ │ ├── gyptest-link-deffile.py │ │ │ ├── gyptest-link-delay-load-dlls.py │ │ │ ├── gyptest-link-entrypointsymbol.py │ │ │ ├── gyptest-link-fixed-base.py │ │ │ ├── gyptest-link-generate-manifest.py │ │ │ ├── gyptest-link-incremental.py │ │ │ ├── gyptest-link-large-address-aware.py │ │ │ ├── gyptest-link-library-adjust.py │ │ │ ├── gyptest-link-library-directories.py │ │ │ ├── gyptest-link-nodefaultlib.py │ │ │ ├── gyptest-link-nxcompat.py │ │ │ ├── gyptest-link-opt-icf.py │ │ │ ├── gyptest-link-opt-ref.py │ │ │ ├── gyptest-link-outputfile.py │ │ │ ├── gyptest-link-pdb.py │ │ │ ├── gyptest-link-profile.py │ │ │ ├── gyptest-link-restat-importlib.py │ │ │ ├── gyptest-link-subsystem.py │ │ │ ├── gyptest-link-tsaware.py │ │ │ ├── gyptest-link-uldi.py │ │ │ ├── gyptest-long-command-line.py │ │ │ ├── gyptest-macro-projectname.py │ │ │ ├── gyptest-macro-vcinstalldir.py │ │ │ ├── gyptest-macros-containing-gyp.py │ │ │ ├── gyptest-macros-in-inputs-and-outputs.py │ │ │ ├── gyptest-midl-rules.py │ │ │ ├── gyptest-quoting-commands.py │ │ │ ├── gyptest-rc-build.py │ │ │ ├── idl-rules │ │ │ ├── basic-idl.gyp │ │ │ ├── history_indexer.idl │ │ │ └── history_indexer_user.cc │ │ │ ├── importlib │ │ │ ├── has-exports.cc │ │ │ ├── hello.cc │ │ │ └── importlib.gyp │ │ │ ├── lib-flags │ │ │ ├── answer.cc │ │ │ ├── answer.h │ │ │ └── ltcg.gyp │ │ │ ├── linker-flags │ │ │ ├── additional-deps.cc │ │ │ ├── additional-deps.gyp │ │ │ ├── additional-options.gyp │ │ │ ├── aslr.gyp │ │ │ ├── debug-info.gyp │ │ │ ├── default-libs.cc │ │ │ ├── default-libs.gyp │ │ │ ├── deffile-multiple.gyp │ │ │ ├── deffile.cc │ │ │ ├── deffile.def │ │ │ ├── deffile.gyp │ │ │ ├── delay-load-dlls.gyp │ │ │ ├── delay-load.cc │ │ │ ├── entrypointsymbol.cc │ │ │ ├── entrypointsymbol.gyp │ │ │ ├── extra.manifest │ │ │ ├── extra2.manifest │ │ │ ├── fixed-base.gyp │ │ │ ├── generate-manifest.gyp │ │ │ ├── hello.cc │ │ │ ├── incremental.gyp │ │ │ ├── large-address-aware.gyp │ │ │ ├── library-adjust.cc │ │ │ ├── library-adjust.gyp │ │ │ ├── library-directories-define.cc │ │ │ ├── library-directories-reference.cc │ │ │ ├── library-directories.gyp │ │ │ ├── nodefaultlib.cc │ │ │ ├── nodefaultlib.gyp │ │ │ ├── nxcompat.gyp │ │ │ ├── opt-icf.cc │ │ │ ├── opt-icf.gyp │ │ │ ├── opt-ref.cc │ │ │ ├── opt-ref.gyp │ │ │ ├── outputfile.gyp │ │ │ ├── profile.gyp │ │ │ ├── program-database.gyp │ │ │ ├── subdir │ │ │ │ └── library.gyp │ │ │ ├── subsystem-windows.cc │ │ │ ├── subsystem.gyp │ │ │ └── tsaware.gyp │ │ │ ├── long-command-line │ │ │ ├── function.cc │ │ │ ├── hello.cc │ │ │ └── long-command-line.gyp │ │ │ ├── precompiled │ │ │ ├── gyptest-all.py │ │ │ ├── hello.c │ │ │ ├── hello.gyp │ │ │ ├── hello2.c │ │ │ └── precomp.c │ │ │ ├── rc-build │ │ │ ├── Resource.h │ │ │ ├── hello.cpp │ │ │ ├── hello.gyp │ │ │ ├── hello.h │ │ │ ├── hello.ico │ │ │ ├── hello.rc │ │ │ ├── small.ico │ │ │ ├── subdir │ │ │ │ ├── hello2.rc │ │ │ │ └── include.h │ │ │ └── targetver.h │ │ │ ├── uldi │ │ │ ├── a.cc │ │ │ ├── b.cc │ │ │ ├── main.cc │ │ │ └── uldi.gyp │ │ │ └── vs-macros │ │ │ ├── as.py │ │ │ ├── containing-gyp.gyp │ │ │ ├── do_stuff.py │ │ │ ├── hello.cc │ │ │ ├── input-output-macros.gyp │ │ │ ├── input.S │ │ │ ├── projectname.gyp │ │ │ ├── stuff.blah │ │ │ ├── test_exists.py │ │ │ └── vcinstalldir.gyp │ └── tools │ │ ├── README │ │ ├── Xcode │ │ ├── README │ │ └── Specifications │ │ │ ├── gyp.pbfilespec │ │ │ └── gyp.xclangspec │ │ ├── emacs │ │ ├── README │ │ ├── gyp-tests.el │ │ ├── gyp.el │ │ ├── run-unit-tests.sh │ │ └── testdata │ │ │ ├── media.gyp │ │ │ └── media.gyp.fontified │ │ ├── graphviz.py │ │ ├── pretty_gyp.py │ │ ├── pretty_sln.py │ │ └── pretty_vcproj.py └── libuv │ ├── .gitignore │ ├── .mailmap │ ├── .travis.yml │ ├── AUTHORS │ ├── LICENSE │ ├── Makefile │ ├── README.md │ ├── checksparse.sh │ ├── common.gypi │ ├── config-mingw.mk │ ├── config-unix.mk │ ├── gyp_uv │ ├── include │ ├── uv-private │ │ ├── ngx-queue.h │ │ ├── stdint-msvc2008.h │ │ ├── tree.h │ │ ├── uv-bsd.h │ │ ├── uv-darwin.h │ │ ├── uv-linux.h │ │ ├── uv-sunos.h │ │ ├── uv-unix.h │ │ └── uv-win.h │ └── uv.h │ ├── src │ ├── fs-poll.c │ ├── inet.c │ ├── unix │ │ ├── aix.c │ │ ├── async.c │ │ ├── core.c │ │ ├── cygwin.c │ │ ├── darwin.c │ │ ├── dl.c │ │ ├── error.c │ │ ├── freebsd.c │ │ ├── fs.c │ │ ├── fsevents.c │ │ ├── getaddrinfo.c │ │ ├── internal.h │ │ ├── kqueue.c │ │ ├── linux │ │ │ ├── inotify.c │ │ │ ├── linux-core.c │ │ │ ├── syscalls.c │ │ │ └── syscalls.h │ │ ├── loop-watcher.c │ │ ├── loop.c │ │ ├── netbsd.c │ │ ├── openbsd.c │ │ ├── pipe.c │ │ ├── poll.c │ │ ├── process.c │ │ ├── signal.c │ │ ├── stream.c │ │ ├── sunos.c │ │ ├── tcp.c │ │ ├── thread.c │ │ ├── threadpool.c │ │ ├── timer.c │ │ ├── tty.c │ │ └── udp.c │ ├── uv-common.c │ ├── uv-common.h │ └── win │ │ ├── async.c │ │ ├── atomicops-inl.h │ │ ├── core.c │ │ ├── dl.c │ │ ├── error.c │ │ ├── fs-event.c │ │ ├── fs.c │ │ ├── getaddrinfo.c │ │ ├── handle-inl.h │ │ ├── handle.c │ │ ├── internal.h │ │ ├── loop-watcher.c │ │ ├── pipe.c │ │ ├── poll.c │ │ ├── process-stdio.c │ │ ├── process.c │ │ ├── req-inl.h │ │ ├── req.c │ │ ├── signal.c │ │ ├── stream-inl.h │ │ ├── stream.c │ │ ├── tcp.c │ │ ├── thread.c │ │ ├── threadpool.c │ │ ├── timer.c │ │ ├── tty.c │ │ ├── udp.c │ │ ├── util.c │ │ ├── winapi.c │ │ ├── winapi.h │ │ ├── winsock.c │ │ └── winsock.h │ ├── test │ ├── benchmark-async-pummel.c │ ├── benchmark-async.c │ ├── benchmark-fs-stat.c │ ├── benchmark-getaddrinfo.c │ ├── benchmark-list.h │ ├── benchmark-loop-count.c │ ├── benchmark-million-async.c │ ├── benchmark-million-timers.c │ ├── benchmark-multi-accept.c │ ├── benchmark-ping-pongs.c │ ├── benchmark-pound.c │ ├── benchmark-pump.c │ ├── benchmark-sizes.c │ ├── benchmark-spawn.c │ ├── benchmark-tcp-write-batch.c │ ├── benchmark-thread.c │ ├── benchmark-udp-pummel.c │ ├── blackhole-server.c │ ├── dns-server.c │ ├── echo-server.c │ ├── fixtures │ │ ├── empty_file │ │ └── load_error.node │ ├── run-benchmarks.c │ ├── run-tests.c │ ├── runner-unix.c │ ├── runner-unix.h │ ├── runner-win.c │ ├── runner-win.h │ ├── runner.c │ ├── runner.h │ ├── task.h │ ├── test-active.c │ ├── test-async.c │ ├── test-barrier.c │ ├── test-callback-order.c │ ├── test-callback-stack.c │ ├── test-condvar.c │ ├── test-connection-fail.c │ ├── test-cwd-and-chdir.c │ ├── test-delayed-accept.c │ ├── test-dlerror.c │ ├── test-embed.c │ ├── test-error.c │ ├── test-fail-always.c │ ├── test-fs-event.c │ ├── test-fs-poll.c │ ├── test-fs.c │ ├── test-get-currentexe.c │ ├── test-get-loadavg.c │ ├── test-get-memory.c │ ├── test-getaddrinfo.c │ ├── test-getsockname.c │ ├── test-guess-handle.c │ ├── test-hrtime.c │ ├── test-idle.c │ ├── test-ipc-send-recv.c │ ├── test-ipc.c │ ├── test-list.h │ ├── test-loop-handles.c │ ├── test-multiple-listen.c │ ├── test-mutexes.c │ ├── test-pass-always.c │ ├── test-ping-pong.c │ ├── test-pipe-bind-error.c │ ├── test-pipe-connect-error.c │ ├── test-platform-output.c │ ├── test-poll-close.c │ ├── test-poll.c │ ├── test-process-title.c │ ├── test-ref.c │ ├── test-run-nowait.c │ ├── test-run-once.c │ ├── test-semaphore.c │ ├── test-shutdown-close.c │ ├── test-shutdown-eof.c │ ├── test-signal-multiple-loops.c │ ├── test-signal.c │ ├── test-spawn.c │ ├── test-stdio-over-pipes.c │ ├── test-tcp-bind-error.c │ ├── test-tcp-bind6-error.c │ ├── test-tcp-close-while-connecting.c │ ├── test-tcp-close.c │ ├── test-tcp-connect-error-after-write.c │ ├── test-tcp-connect-error.c │ ├── test-tcp-connect-timeout.c │ ├── test-tcp-connect6-error.c │ ├── test-tcp-flags.c │ ├── test-tcp-open.c │ ├── test-tcp-read-stop.c │ ├── test-tcp-shutdown-after-write.c │ ├── test-tcp-unexpected-read.c │ ├── test-tcp-write-error.c │ ├── test-tcp-write-to-half-open-connection.c │ ├── test-tcp-writealot.c │ ├── test-thread.c │ ├── test-threadpool-cancel.c │ ├── test-threadpool.c │ ├── test-timer-again.c │ ├── test-timer.c │ ├── test-tty.c │ ├── test-udp-dgram-too-big.c │ ├── test-udp-ipv6.c │ ├── test-udp-multicast-join.c │ ├── test-udp-multicast-ttl.c │ ├── test-udp-open.c │ ├── test-udp-options.c │ ├── test-udp-send-and-recv.c │ ├── test-util.c │ └── test-walk-handles.c │ ├── uv.gyp │ └── vcbuild.bat ├── doc ├── magpie v2.txt ├── manifesto.txt ├── namespaces.mag ├── objects and types.txt ├── old │ ├── classes 2.txt │ ├── classes 3.txt │ ├── classes.mag │ ├── definitions.mag │ ├── fn literals.mag │ ├── members.mag │ ├── members2.mag │ ├── scopes.txt │ ├── separate types.txt │ ├── templates.mag │ ├── type checking.txt │ ├── type evaluation.txt │ └── types.txt ├── redux.txt ├── scratchpad │ ├── block-sugar.mag │ ├── compiling definitions.txt │ ├── double.mag │ ├── generics.mag │ ├── generics2.mag │ ├── import.mag │ ├── inferring-type-args.mag │ ├── inheritance-qa.txt │ ├── inheritance.txt │ ├── multi 1.txt │ ├── multimethod semantics.txt │ ├── multimethods.txt │ ├── multiple inheritance.txt │ ├── patterns.txt │ ├── patterns2.txt │ ├── precedence.txt │ ├── private.txt │ ├── scope.mag │ ├── specialization.txt │ ├── structural types.txt │ ├── syntax.txt │ ├── top-level scope.mag │ ├── top-level-scope2.mag │ └── top-level-scope3.md ├── site │ ├── README │ ├── design │ │ └── Comp 7.psd │ ├── generate-docs.py │ ├── magpie │ │ ├── Magpie.egg-info │ │ │ ├── PKG-INFO │ │ │ ├── SOURCES.txt │ │ │ ├── dependency_links.txt │ │ │ ├── entry_points.txt │ │ │ └── top_level.txt │ │ ├── magpie │ │ │ └── __init__.py │ │ └── setup.py │ ├── markdown │ │ ├── blocks.md │ │ ├── calls.md │ │ ├── classes.md │ │ ├── concurrency.md │ │ ├── core-concepts.md │ │ ├── design-questions.md │ │ ├── design-questions │ │ │ ├── are-all-types-first-class.md │ │ │ ├── are-types-in-java-or-magpie.md │ │ │ ├── can-all-generic-arguments-be-inferred.md │ │ │ ├── dynamic-scope-and-implicit-state.md │ │ │ ├── how-are-bare-names-interpreted.md │ │ │ ├── how-are-classes-declared.md │ │ │ ├── how-are-generic-functions-checked.md │ │ │ ├── how-are-methods-defined.md │ │ │ ├── how-are-multimethods-compiled.md │ │ │ ├── how-are-syntax-extensions-imported.md │ │ │ ├── how-do-abstract-members-work.md │ │ │ ├── how-do-callable-fields-work.md │ │ │ ├── how-do-callables-work-with-multimethods.md │ │ │ ├── how-do-fields-work.md │ │ │ ├── how-do-multimethods-interact-with-modules.md │ │ │ ├── how-do-multimethods-work.md │ │ │ ├── how-do-operators-work.md │ │ │ ├── how-does-inheritance-work.md │ │ │ ├── how-static-is-the-top-level.md │ │ │ ├── interfaces-or-abstract-classes.md │ │ │ ├── what-conversions-are-needed.md │ │ │ ├── what-is-a-multimethods-identity.md │ │ │ ├── what-is-the-type-of-a-generic.md │ │ │ └── where-do-type-expressions-appear.md │ │ ├── error-handling.md │ │ ├── expressions.md │ │ ├── flow-control.md │ │ ├── functions.md │ │ ├── hacking-on-magpie.md │ │ ├── index.md │ │ ├── internals.md │ │ ├── lists.md │ │ ├── looping.md │ │ ├── modules.md │ │ ├── multimethods.md │ │ ├── objects.md │ │ ├── pattern-matching.md │ │ ├── patterns.md │ │ ├── pragmatics.md │ │ ├── primitives.md │ │ ├── program-structure.md │ │ ├── records.md │ │ ├── the-heart-of-magpie.md │ │ ├── top-level-definitions.md │ │ ├── tutorial.md │ │ └── variables.md │ ├── static │ │ ├── background.gif │ │ └── style.css │ ├── style.scss │ └── template.html ├── string interpolation.mag └── to do.txt ├── example ├── Calculator.mag ├── Channel.mag ├── File.mag ├── FileWriter.mag ├── LexerTest.mag ├── OrNothingAndLet.mag ├── ParserTest.mag ├── PriorityQueue.mag ├── Web.mag ├── fib.mag ├── fibers.mag ├── files.mag ├── fringe.mag ├── hello.mag ├── point.mag ├── primes.mag ├── tcp.mag └── temp.mag ├── lib ├── README ├── async.mag ├── io.mag ├── io │ └── path.mag ├── magpie │ ├── core.mag │ ├── core │ │ ├── comparable.mag │ │ ├── indexable.mag │ │ ├── range.mag │ │ └── usable.mag │ ├── syntax.mag │ └── syntax │ │ ├── lexer.mag │ │ └── parser.mag ├── net.mag ├── process.mag ├── reflection.mag └── regex.mag ├── magpie ├── magpie.gyp ├── magpie.xcodeproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── magpie.xcworkspace └── contents.xcworkspacedata ├── run_gyp ├── run_gyp.bat ├── script ├── generate_ast.py └── test.py ├── spec ├── README ├── _init.mag ├── language │ ├── _init.mag │ ├── and_.mag │ ├── array.mag │ ├── assign.mag │ ├── break_.mag │ ├── catch_.mag │ ├── def_.mag │ ├── defclass_.mag │ ├── do_.mag │ ├── fn_.mag │ ├── for_.mag │ ├── if_.mag │ ├── import_.mag │ ├── import_test.mag │ ├── import_test_a.mag │ ├── import_test_b.mag │ ├── import_test_c.mag │ ├── import_test_d.mag │ ├── let_.mag │ ├── match_.mag │ ├── newline.mag │ ├── or_.mag │ ├── pattern.mag │ ├── quote.mag │ ├── record.mag │ ├── return_.mag │ ├── string.mag │ ├── val_.mag │ ├── var_.mag │ └── with_.mag ├── lib │ ├── _init.mag │ ├── async │ │ ├── Channel.mag │ │ └── isAsyncSafe.mag │ ├── io │ │ ├── Directory.mag │ │ ├── File.mag │ │ ├── path.mag │ │ ├── test_dir │ │ │ ├── a.txt │ │ │ ├── b.txt │ │ │ └── test_subdir │ │ │ │ └── a.txt │ │ └── test_file.txt │ ├── magpie │ │ ├── core │ │ │ ├── Array.mag │ │ │ ├── Bool.mag │ │ │ ├── Class.mag │ │ │ ├── Comparable.mag │ │ │ ├── Indexable.mag │ │ │ ├── IndexableIterator.mag │ │ │ ├── Int.mag │ │ │ ├── Iterable.mag │ │ │ ├── List.mag │ │ │ ├── Range.mag │ │ │ ├── Record.mag │ │ │ ├── String.mag │ │ │ ├── toString.mag │ │ │ └── use.mag │ │ └── syntax │ │ │ ├── lexer.mag │ │ │ └── parser.mag │ ├── process.mag │ └── regex.mag ├── specify.mag └── truth_test.mag ├── src ├── .classpath ├── .project ├── Common.h ├── Compiler │ ├── Bytecode.h │ ├── Compiler.cpp │ ├── Compiler.h │ ├── ExprCompiler.cpp │ ├── ExprCompiler.h │ ├── Resolver.cpp │ └── Resolver.h ├── Data │ ├── Array.h │ ├── FixedQueue.h │ ├── Queue.h │ ├── Stack.h │ ├── String.cpp │ └── String.h ├── Memory │ ├── ForwardingAddress.h │ ├── Managed.cpp │ ├── Managed.h │ ├── Memory.cpp │ ├── Memory.h │ ├── RootSource.h │ ├── Semispace.cpp │ └── Semispace.h ├── Native │ ├── Core.cpp │ ├── Core.h │ ├── IO.cpp │ ├── IO.h │ ├── Net.cpp │ └── Net.h ├── Platform │ ├── Environment.cpp │ ├── Environment.h │ ├── Environment_linux.cpp │ ├── Environment_mac.cpp │ ├── Environment_win.cpp │ ├── Path.cpp │ ├── Path.h │ ├── Path_posix.cpp │ └── Path_win.cpp ├── Syntax │ ├── Ast.cpp │ ├── Ast.generated.h │ ├── Ast.h │ ├── ErrorReporter.cpp │ ├── ErrorReporter.h │ ├── Lexer.cpp │ ├── Lexer.h │ ├── Parser.cpp │ ├── Parser.h │ ├── Token.cpp │ └── Token.h ├── Test │ ├── ArrayTests.cpp │ ├── ArrayTests.h │ ├── FixedQueueTests.cpp │ ├── FixedQueueTests.h │ ├── LexerTests.cpp │ ├── LexerTests.h │ ├── MemoryTests.cpp │ ├── MemoryTests.h │ ├── ParserTests.cpp │ ├── ParserTests.h │ ├── StringTests.cpp │ ├── StringTests.h │ ├── Test.cpp │ ├── Test.h │ ├── TestMain.cpp │ ├── TokenTests.cpp │ └── TokenTests.h ├── VM │ ├── Fiber.cpp │ ├── Fiber.h │ ├── Method.cpp │ ├── Method.h │ ├── Module.cpp │ ├── Module.h │ ├── Object.cpp │ ├── Object.h │ ├── Scheduler.cpp │ ├── Scheduler.h │ ├── VM.cpp │ └── VM.h ├── com │ └── stuffwithstuff │ │ └── magpie │ │ ├── Def.java │ │ ├── Doc.java │ │ ├── Magpie.java │ │ ├── MagpieHost.java │ │ ├── Method.java │ │ ├── Repl.java │ │ ├── ReplResult.java │ │ ├── SourceFile.java │ │ ├── SourceReader.java │ │ ├── app │ │ ├── ColorRepl.java │ │ ├── ConsoleRepl.java │ │ ├── MagpieApp.java │ │ ├── MagpieAppHost.java │ │ ├── NiceReplCharacterReader.java │ │ ├── QuitException.java │ │ ├── ReplMethods.java │ │ ├── ReplReader.java │ │ └── Term.java │ │ ├── ast │ │ ├── ArrayExpr.java │ │ ├── AssignExpr.java │ │ ├── BoolExpr.java │ │ ├── BreakExpr.java │ │ ├── CallExpr.java │ │ ├── ClassExpr.java │ │ ├── Expr.java │ │ ├── ExprVisitor.java │ │ ├── Field.java │ │ ├── FnExpr.java │ │ ├── ImportDeclaration.java │ │ ├── ImportExpr.java │ │ ├── IntExpr.java │ │ ├── LoopExpr.java │ │ ├── MatchExpr.java │ │ ├── MethodExpr.java │ │ ├── NameExpr.java │ │ ├── NothingExpr.java │ │ ├── QuoteExpr.java │ │ ├── RecordExpr.java │ │ ├── ReturnExpr.java │ │ ├── ScopeExpr.java │ │ ├── SequenceExpr.java │ │ ├── StringExpr.java │ │ ├── ThrowExpr.java │ │ ├── UnquoteExpr.java │ │ ├── VarExpr.java │ │ └── pattern │ │ │ ├── MatchCase.java │ │ │ ├── Pattern.java │ │ │ ├── PatternVisitor.java │ │ │ ├── RecordPattern.java │ │ │ ├── TypePattern.java │ │ │ ├── ValuePattern.java │ │ │ ├── VariablePattern.java │ │ │ └── WildcardPattern.java │ │ ├── interpreter │ │ ├── BreakException.java │ │ ├── Callable.java │ │ ├── Channel.java │ │ ├── ClassObj.java │ │ ├── Context.java │ │ ├── DocBuilder.java │ │ ├── EnvironmentBuilder.java │ │ ├── ErrorException.java │ │ ├── ExprEvaluator.java │ │ ├── FieldObj.java │ │ ├── FnObj.java │ │ ├── Function.java │ │ ├── Interpreter.java │ │ ├── InterpreterException.java │ │ ├── JavaToMagpie.java │ │ ├── MagpieToJava.java │ │ ├── MethodGraph.java │ │ ├── Module.java │ │ ├── Multimethod.java │ │ ├── Name.java │ │ ├── NullInterpreterHost.java │ │ ├── Obj.java │ │ ├── PatternBinder.java │ │ ├── PatternComparer.java │ │ ├── PatternTester.java │ │ ├── Profiler.java │ │ ├── ReturnException.java │ │ ├── Routine.java │ │ └── Scope.java │ │ ├── intrinsic │ │ ├── ArrayMethods.java │ │ ├── AsyncMethods.java │ │ ├── ClassInit.java │ │ ├── ClassNew.java │ │ ├── FieldGetter.java │ │ ├── FieldSetter.java │ │ ├── IOMethods.java │ │ ├── Indexable.java │ │ ├── IntMethods.java │ │ ├── Intrinsic.java │ │ ├── IntrinsicCallable.java │ │ ├── IntrinsicLoader.java │ │ ├── IntrinsicMethods.java │ │ ├── ListMethods.java │ │ ├── MethodWrapper.java │ │ ├── NetMethods.java │ │ ├── PathMethods.java │ │ ├── ProcessMethods.java │ │ ├── ReflectionMethods.java │ │ ├── RegexMethods.java │ │ └── StringMethods.java │ │ ├── parser │ │ ├── AndParser.java │ │ ├── Annotator.java │ │ ├── BacktickParser.java │ │ ├── BracePrefixParser.java │ │ ├── BracketInfixParser.java │ │ ├── BracketPrefixParser.java │ │ ├── CommaParser.java │ │ ├── ConvertAssignmentExpr.java │ │ ├── EqualsParser.java │ │ ├── FieldParser.java │ │ ├── FnParser.java │ │ ├── Grammar.java │ │ ├── InfixOperatorParser.java │ │ ├── InfixParser.java │ │ ├── Lexer.java │ │ ├── LiteralParser.java │ │ ├── MagpieParser.java │ │ ├── Morpher.java │ │ ├── NameParser.java │ │ ├── OrParser.java │ │ ├── ParenthesisPrefixParser.java │ │ ├── ParseException.java │ │ ├── Parser.java │ │ ├── PatternParser.java │ │ ├── Position.java │ │ ├── PositionSpan.java │ │ ├── Precedence.java │ │ ├── PrefixParser.java │ │ ├── StringReader.java │ │ ├── Token.java │ │ ├── TokenReader.java │ │ └── TokenType.java │ │ └── util │ │ ├── Expect.java │ │ ├── FileReader.java │ │ ├── FileWriter.java │ │ ├── IO.java │ │ ├── NotImplementedException.java │ │ ├── Pair.java │ │ └── Ref.java ├── magpie.1 └── main.cpp ├── support ├── Sublime Text 2 │ └── Magpie │ │ ├── Syntaxes │ │ └── Magpie.tmLanguage │ │ └── info.plist └── TextMate │ └── Magpie.tmbundle │ ├── Syntaxes │ └── Magpie.tmLanguage │ └── info.plist └── test ├── and ├── and.mag ├── eof.mag └── eof_with_newline.mag ├── async ├── closure.mag ├── closure_in_method.mag ├── end_when_main_fiber_ends.mag ├── return.mag ├── wait_to_receive.mag └── wait_to_send.mag ├── bools ├── class.mag └── to_string.mag ├── calls ├── infix.mag ├── left_argument.mag ├── nested_param.mag ├── no_arguments.mag ├── record_arguments.mag ├── right_argument.mag ├── unknown_method.mag └── unknown_signature.mag ├── channel ├── close.mag ├── iteration.mag ├── new.mag ├── queued_receives.mag ├── queued_sends.mag ├── two_blocked_receivers.mag └── two_blocked_senders.mag ├── char ├── class.mag ├── literal.mag └── to_string.mag ├── classes ├── class_with_no_fields.mag ├── classes_are_first_class.mag ├── field │ ├── no_literal_pattern.mag │ ├── no_value_pattern.mag │ └── no_variable_pattern.mag ├── field_getters.mag ├── field_setter_modifies_object.mag ├── field_setter_returns_value.mag ├── field_setter_uses_pattern.mag ├── immutable_fields_cannot_be_set.mag ├── is_inherited_class.mag ├── new.mag ├── new_requires_all_fields.mag ├── new_requires_fields_in_order.mag ├── new_uses_field_patterns.mag ├── new_with_fields.mag └── superclass │ ├── no_literal.mag │ └── no_method_call.mag ├── comments ├── block.mag ├── block_at_end_of_file.mag └── line_at_end_of_file.mag ├── definition_order ├── field_initializer │ ├── class │ │ ├── construct_defclass_field.mag │ │ ├── construct_field_defclass.mag │ │ ├── defclass_construct_field.mag │ │ ├── defclass_field_construct.mag │ │ ├── field_construct_defclass.mag │ │ └── field_defclass_construct.mag │ ├── class_constructor │ │ ├── construct_defclass_field.mag │ │ ├── construct_field_defclass.mag │ │ ├── defclass_construct_field.mag │ │ ├── defclass_field_construct.mag │ │ ├── field_construct_defclass.mag │ │ └── field_defclass_construct.mag │ ├── method │ │ ├── construct_def_field.mag │ │ ├── construct_field_def.mag │ │ ├── def_construct_field.mag │ │ ├── def_field_construct.mag │ │ ├── field_construct_def.mag │ │ └── field_def_construct.mag │ └── var │ │ ├── construct_field_var.mag │ │ ├── construct_var_field.mag │ │ ├── field_construct_var.mag │ │ ├── field_var_construct.mag │ │ ├── var_construct_field.mag │ │ └── var_field_construct.mag ├── field_pattern │ ├── construct_later_class.mag │ ├── construct_later_variable.mag │ ├── later_class.mag │ ├── later_variable.mag │ ├── previous_class.mag │ └── previous_variable.mag ├── superclass │ ├── later_class.mag │ ├── later_variable.mag │ ├── previous_class.mag │ └── previous_variable.mag └── variable │ ├── instantiate_later_class.mag │ └── instantiate_previous_class.mag ├── do ├── block_argument.mag ├── block_argument_must_follow_call.mag ├── block_argument_with_pattern.mag ├── block_argument_with_pattern_must_follow_call.mag ├── do_expression.mag ├── eof_block.mag └── eof_with_newline.mag ├── event ├── exit_while_fiber_sleeping.mag ├── sleep.mag ├── sleep_main_fiber.mag ├── sleep_main_fiber_with_other_fiber.mag └── sleep_return.mag ├── functions ├── argument_mismatch.mag ├── arguments.mag ├── class.mag ├── closure.mag ├── closure_in_method.mag ├── fn.mag ├── implicit_parameters.mag └── loop_closure.mag ├── if.mag ├── import ├── do_not_import_private_vars │ ├── do_not_import_private_vars.mag │ └── foo.mag ├── do_not_run_imported_module_if_main_has_error │ ├── foo.mag │ └── main.mag ├── do_not_run_main_module_if_import_has_error │ ├── foo.mag │ └── main.mag ├── import_from_same_dir │ ├── foo.mag │ └── import_from_same_dir.mag ├── import_from_subdir │ ├── foo │ │ └── bar │ │ │ └── baz.mag │ └── import_from_subdir.mag ├── imports_must_appear_before_other_code.mag ├── private_var_in_same_module.mag └── shared_import │ ├── a.mag │ ├── b.mag │ ├── c.mag │ └── shared_import.mag ├── io ├── buffer │ ├── class.mag │ ├── construct_int.mag │ ├── count.mag │ ├── decode_ascii.mag │ ├── subscript_int.mag │ ├── subscript_setter_int.mag │ └── to_string.mag ├── file │ ├── class.mag │ ├── close.mag │ ├── data.txt │ ├── open.mag │ ├── open_block.mag │ ├── read.mag │ ├── read_bytes.mag │ ├── read_from_path.mag │ ├── size.mag │ └── stream_bytes.mag └── stream │ ├── class.mag │ └── to_string.mag ├── is ├── eof.mag ├── eof_with_newline.mag ├── is.mag └── newline.mag ├── iterable ├── contains.mag ├── count.mag ├── each.mag ├── first.mag ├── join.mag ├── map.mag ├── skip.mag ├── to_list.mag └── where.mag ├── list ├── add.mag ├── class.mag ├── clear.mag ├── count.mag ├── insert.mag ├── iteration.mag ├── last.mag ├── literals.mag ├── remove_at.mag ├── subscript_int.mag ├── subscript_range.mag └── subscript_setter_int.mag ├── looping ├── break_at_top_level.mag ├── break_outside_loop.mag ├── for.mag ├── for_break.mag ├── for_scope.mag ├── for_syntax.mag ├── while_break.mag ├── while_scope.mag └── while_syntax.mag ├── match ├── case_after_else.mag ├── duplicate_field.mag ├── duplicate_positional_field.mag ├── match.mag ├── record_patterns.mag └── use_wildcard.mag ├── methods ├── declare_in_local_scope.mag ├── expression_in_type_pattern.mag ├── expression_in_value_pattern.mag ├── mutual_recursion.mag ├── record_pattern_in_setter.mag ├── recursion.mag └── top_level_vars_in_body │ ├── call_def_var.mag │ ├── call_var_def.mag │ ├── def_call_var.mag │ ├── def_var_call.mag │ ├── var_call_def.mag │ └── var_def_call.mag ├── modules └── empty.mag ├── multimethods ├── collision │ ├── bool.mag │ ├── char.mag │ ├── float.mag │ ├── int.mag │ ├── int_float.mag │ └── nothing.mag ├── different_arity.mag ├── literal_patterns.mag ├── nested_record_pattern.mag ├── ordering │ ├── field_pattern.mag │ ├── subclass_before_superclass.mag │ ├── type_before_variable.mag │ ├── value_before_type.mag │ ├── value_before_variable.mag │ └── wide_record_before_narrow.mag ├── type_patterns.mag └── types_in_record_patterns.mag ├── not.mag ├── nothing.mag ├── number ├── float │ ├── addition.mag │ ├── class.mag │ ├── comparison.mag │ ├── division.mag │ ├── literals.mag │ ├── multiplication.mag │ ├── negation.mag │ ├── sgn.mag │ ├── subtraction.mag │ └── to_string.mag ├── int │ ├── addition.mag │ ├── class.mag │ ├── comparison.mag │ ├── division.mag │ ├── literals.mag │ ├── multiplication.mag │ ├── negation.mag │ ├── sgn.mag │ ├── subtraction.mag │ └── to_string.mag └── mixed │ ├── addition.mag │ ├── comparison.mag │ ├── division.mag │ ├── multiplication.mag │ └── subtraction.mag ├── operator ├── associativity.mag ├── custom_infix.mag ├── custom_prefix.mag └── range.mag ├── or ├── eof.mag ├── eof_with_newline.mag └── or.mag ├── range ├── iteration.mag └── range.mag ├── records ├── class.mag ├── duplicate_field.mag ├── duplicate_infix_field.mag ├── record.mag └── record_in_method.mag ├── return.mag ├── strings ├── class.mag ├── count.mag ├── iterate.mag ├── multiply.mag ├── newline_in_string.mag ├── plus.mag ├── strings.mag ├── subscript.mag ├── to_string.mag ├── unterminated_escape.mag └── unterminated_string.mag ├── throw ├── catch.mag ├── catch_in_if.mag ├── catch_unwind.mag ├── method_catch.mag ├── uncaught.mag └── unwind_past_match_failure.mag ├── top_level_variables ├── assign_to_undeclared_variable.mag ├── assignment.mag ├── destructure_missing_field.mag ├── destructure_non_record.mag ├── destructure_pattern_fail.mag ├── destructuring.mag ├── duplicate_definition.mag ├── duplicate_field.mag ├── duplicate_infix_field.mag ├── duplicate_positional_field.mag ├── initialize_from_later_class.mag ├── initialize_from_later_method.mag ├── initialize_from_later_variable.mag ├── initialize_from_previous_class.mag ├── initialize_from_previous_method.mag ├── initialize_from_previous_variable.mag ├── type_pattern_fail.mag ├── type_patterns.mag ├── unknown.mag ├── use_before_definition.mag ├── value_pattern_fail.mag └── value_patterns.mag ├── variables ├── assign_to_undeclared_variable.mag ├── assignment.mag ├── destructuring.mag ├── duplicate_definition.mag ├── duplicate_field.mag ├── duplicate_infix_field.mag ├── duplicate_positional_field.mag ├── initializer_scope.mag ├── out_of_scope.mag ├── shadowing.mag ├── type_patterns.mag ├── unknown.mag └── value_patterns.mag └── whitespace ├── beginning_of_file.mag ├── end_of_file.mag └── none_at_end_of_file.mag /.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Ignore output files 2 | bin/ 3 | build/ 4 | magpie.jar 5 | doc/site/html/ 6 | doc/site/magpie/magpie/__init__.pyc 7 | doc/site/.sass-cache/ 8 | 9 | # Ignore gyp generated projects 10 | magpie.xcodeproj/project.pbxproj 11 | dep/libuv/uv.xcodeproj/project.pbxproj 12 | 13 | # Ignore user-specific config files. 14 | xcuserdata 15 | magpie.xcworkspace/ -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Bob Nystrom 2 | Marcus Martin 3 | Antal Szabó 4 | -------------------------------------------------------------------------------- /core/README: -------------------------------------------------------------------------------- 1 | This directory contains the Magpie "standard library" for the C++ Magpie VM. 2 | Once the VM is more mature, this will be merged with lib/. -------------------------------------------------------------------------------- /dep/gyp/.gitignore: -------------------------------------------------------------------------------- 1 | *.pyc 2 | -------------------------------------------------------------------------------- /dep/gyp/AUTHORS: -------------------------------------------------------------------------------- 1 | # Names should be added to this file like so: 2 | # Name or Organization 3 | 4 | Google Inc. 5 | Bloomberg Finance L.P. 6 | 7 | Steven Knight 8 | Ryan Norton 9 | -------------------------------------------------------------------------------- /dep/gyp/OWNERS: -------------------------------------------------------------------------------- 1 | * 2 | -------------------------------------------------------------------------------- /dep/gyp/gyp.bat: -------------------------------------------------------------------------------- 1 | @rem Copyright (c) 2009 Google Inc. All rights reserved. 2 | @rem Use of this source code is governed by a BSD-style license that can be 3 | @rem found in the LICENSE file. 4 | 5 | @python "%~dp0/gyp" %* 6 | -------------------------------------------------------------------------------- /dep/gyp/gyp_dummy.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2009 Google Inc. All rights reserved. 2 | * Use of this source code is governed by a BSD-style license that can be 3 | * found in the LICENSE file. */ 4 | 5 | int main() { 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /dep/gyp/pylib/gyp/generator/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munificent/magpie/f5138e3d316ec1a664b5eadba1bcc8573d3faca3/dep/gyp/pylib/gyp/generator/__init__.py -------------------------------------------------------------------------------- /dep/gyp/samples/samples.bat: -------------------------------------------------------------------------------- 1 | @rem Copyright (c) 2009 Google Inc. All rights reserved. 2 | @rem Use of this source code is governed by a BSD-style license that can be 3 | @rem found in the LICENSE file. 4 | 5 | @python %~dp0/samples %* 6 | -------------------------------------------------------------------------------- /dep/gyp/test/actions-bare/src/bare.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Copyright (c) 2009 Google Inc. All rights reserved. 4 | # Use of this source code is governed by a BSD-style license that can be 5 | # found in the LICENSE file. 6 | 7 | import sys 8 | 9 | f = open(sys.argv[1], 'wb') 10 | f.write('Hello from bare.py\n') 11 | f.close() 12 | -------------------------------------------------------------------------------- /dep/gyp/test/actions-multiple/src/copy.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # Copyright (c) 2011 Google Inc. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | import shutil 7 | import sys 8 | 9 | shutil.copyfile(sys.argv[1], sys.argv[2]) 10 | -------------------------------------------------------------------------------- /dep/gyp/test/actions-multiple/src/foo.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Google Inc. All rights reserved. 3 | * Use of this source code is governed by a BSD-style license that can be 4 | * found in the LICENSE file. 5 | */ 6 | 7 | #include 8 | 9 | void foo(void) { 10 | printf("foo\n"); 11 | } 12 | -------------------------------------------------------------------------------- /dep/gyp/test/actions-multiple/src/input.txt: -------------------------------------------------------------------------------- 1 | hello there 2 | -------------------------------------------------------------------------------- /dep/gyp/test/actions-none/src/foo.cc: -------------------------------------------------------------------------------- 1 | foo.cc 2 | -------------------------------------------------------------------------------- /dep/gyp/test/actions-subdir/src/make-file.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Copyright (c) 2009 Google Inc. All rights reserved. 4 | # Use of this source code is governed by a BSD-style license that can be 5 | # found in the LICENSE file. 6 | 7 | import sys 8 | 9 | contents = 'Hello from make-file.py\n' 10 | 11 | open(sys.argv[1], 'wb').write(contents) 12 | -------------------------------------------------------------------------------- /dep/gyp/test/actions-subdir/src/subdir/make-subdir-file.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Copyright (c) 2009 Google Inc. All rights reserved. 4 | # Use of this source code is governed by a BSD-style license that can be 5 | # found in the LICENSE file. 6 | 7 | import sys 8 | 9 | contents = 'Hello from make-subdir-file.py\n' 10 | 11 | open(sys.argv[1], 'wb').write(contents) 12 | -------------------------------------------------------------------------------- /dep/gyp/test/actions/src/subdir1/program.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | extern void prog1(void); 4 | extern void prog2(void); 5 | 6 | int main(int argc, char *argv[]) 7 | { 8 | printf("Hello from program.c\n"); 9 | prog1(); 10 | prog2(); 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /dep/gyp/test/actions/src/subdir2/make-file.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Copyright (c) 2009 Google Inc. All rights reserved. 4 | # Use of this source code is governed by a BSD-style license that can be 5 | # found in the LICENSE file. 6 | 7 | import sys 8 | 9 | contents = "Hello from make-file.py\n" 10 | 11 | open(sys.argv[1], 'wb').write(contents) 12 | -------------------------------------------------------------------------------- /dep/gyp/test/additional-targets/src/dir1/emit.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Copyright (c) 2009 Google Inc. All rights reserved. 4 | # Use of this source code is governed by a BSD-style license that can be 5 | # found in the LICENSE file. 6 | 7 | import sys 8 | 9 | f = open(sys.argv[1], 'wb') 10 | f.write('Hello from emit.py\n') 11 | f.close() 12 | -------------------------------------------------------------------------------- /dep/gyp/test/additional-targets/src/dir1/lib1.c: -------------------------------------------------------------------------------- 1 | #ifdef _WIN32 2 | __declspec(dllexport) 3 | #endif 4 | int func1(void) { 5 | return 42; 6 | } 7 | -------------------------------------------------------------------------------- /dep/gyp/test/assembly/src/as.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | :: Mock windows assembler. 3 | cl /c %1 /Fo"%2" 4 | 5 | -------------------------------------------------------------------------------- /dep/gyp/test/assembly/src/lib1.c: -------------------------------------------------------------------------------- 1 | int lib1_function(void) { 2 | return 42; 3 | } 4 | -------------------------------------------------------------------------------- /dep/gyp/test/assembly/src/override_asm.asm: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2012 Google Inc. All rights reserved. 2 | ; Use of this source code is governed by a BSD-style license that can be 3 | ; found in the LICENSE file. 4 | 5 | ; This is a placeholder. It should not be referenced if overrides work 6 | ; correctly. 7 | 8 | Bad stuff that shouldn't assemble. 9 | -------------------------------------------------------------------------------- /dep/gyp/test/assembly/src/program.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | extern int lib1_function(void); 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | fprintf(stdout, "Hello from program.c\n"); 8 | fflush(stdout); 9 | fprintf(stdout, "Got %d.\n", lib1_function()); 10 | fflush(stdout); 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /dep/gyp/test/build-option/hello.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012 Google Inc. All rights reserved. 3 | * Use of this source code is governed by a BSD-style license that can be 4 | * found in the LICENSE file. 5 | */ 6 | 7 | #include 8 | 9 | int main(int argc, char *argv[]) 10 | { 11 | printf("Hello, world!\n"); 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /dep/gyp/test/builddir/src/func1.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void func1(void) 4 | { 5 | printf("Hello from func1.c\n"); 6 | } 7 | -------------------------------------------------------------------------------- /dep/gyp/test/builddir/src/func2.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void func2(void) 4 | { 5 | printf("Hello from func2.c\n"); 6 | } 7 | -------------------------------------------------------------------------------- /dep/gyp/test/builddir/src/func3.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void func3(void) 4 | { 5 | printf("Hello from func3.c\n"); 6 | } 7 | -------------------------------------------------------------------------------- /dep/gyp/test/builddir/src/func4.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void func4(void) 4 | { 5 | printf("Hello from func4.c\n"); 6 | } 7 | -------------------------------------------------------------------------------- /dep/gyp/test/builddir/src/func5.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void func5(void) 4 | { 5 | printf("Hello from func5.c\n"); 6 | } 7 | -------------------------------------------------------------------------------- /dep/gyp/test/builddir/src/prog1.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | extern void func1(void); 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | printf("Hello from prog1.c\n"); 8 | func1(); 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /dep/gyp/test/builddir/src/subdir2/prog2.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | extern void func2(void); 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | printf("Hello from subdir2/prog2.c\n"); 8 | func2(); 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /dep/gyp/test/builddir/src/subdir2/subdir3/prog3.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | extern void func3(void); 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | printf("Hello from subdir2/subdir3/prog3.c\n"); 8 | func3(); 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /dep/gyp/test/builddir/src/subdir2/subdir3/subdir4/prog4.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | extern void func4(void); 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | printf("Hello from subdir2/subdir3/subdir4/prog4.c\n"); 8 | func4(); 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /dep/gyp/test/builddir/src/subdir2/subdir3/subdir4/subdir5/prog5.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | extern void func5(void); 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | printf("Hello from subdir2/subdir3/subdir4/subdir5/prog5.c\n"); 8 | func5(); 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /dep/gyp/test/compilable/src/lib1.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "lib1.hpp" 3 | 4 | void lib1_function(void) { 5 | fprintf(stdout, "Hello from lib1.c\n"); 6 | fflush(stdout); 7 | } 8 | -------------------------------------------------------------------------------- /dep/gyp/test/compilable/src/lib1.hpp: -------------------------------------------------------------------------------- 1 | #ifndef _lib1_hpp 2 | #define _lib1_hpp 3 | 4 | extern void lib1_function(void); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /dep/gyp/test/compilable/src/program.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "lib1.hpp" 3 | 4 | int main(int argc, char *argv[]) { 5 | fprintf(stdout, "Hello from program.c\n"); 6 | fflush(stdout); 7 | lib1_function(); 8 | return 0; 9 | } 10 | -------------------------------------------------------------------------------- /dep/gyp/test/compiler-override/cxxtest.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | // Deliberate C syntax error as this file should never be passed to 6 | // the actual compiler 7 | #error Should not be passed to a real compiler 8 | -------------------------------------------------------------------------------- /dep/gyp/test/compiler-override/my_cc.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # Copyright (c) 2012 Google Inc. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | import sys 6 | print sys.argv 7 | -------------------------------------------------------------------------------- /dep/gyp/test/compiler-override/my_cxx.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # Copyright (c) 2012 Google Inc. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | import sys 6 | print sys.argv 7 | -------------------------------------------------------------------------------- /dep/gyp/test/compiler-override/my_ld.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # Copyright (c) 2012 Google Inc. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | import sys 6 | print sys.argv 7 | -------------------------------------------------------------------------------- /dep/gyp/test/compiler-override/test.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | // Deliberate C syntax error as this file should never be passed to 6 | // the actual compiler 7 | #error Should not be passed to a real compiler 8 | -------------------------------------------------------------------------------- /dep/gyp/test/configurations/basics/configurations.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, char *argv[]) 4 | { 5 | #ifdef FOO 6 | printf("Foo configuration\n"); 7 | #endif 8 | #ifdef DEBUG 9 | printf("Debug configuration\n"); 10 | #endif 11 | #ifdef RELEASE 12 | printf("Release configuration\n"); 13 | #endif 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /dep/gyp/test/configurations/target_platform/front.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | const char *message(void); 4 | 5 | int main(int argc, char *argv[]) { 6 | printf("%s\n", message()); 7 | return 0; 8 | } 9 | -------------------------------------------------------------------------------- /dep/gyp/test/configurations/target_platform/left.c: -------------------------------------------------------------------------------- 1 | const char *message(void) { 2 | return "left"; 3 | } 4 | -------------------------------------------------------------------------------- /dep/gyp/test/configurations/target_platform/right.c: -------------------------------------------------------------------------------- 1 | const char *message(void) { 2 | return "right"; 3 | } 4 | -------------------------------------------------------------------------------- /dep/gyp/test/configurations/x64/configurations.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, char *argv[]) { 4 | if (sizeof(void*) == 4) { 5 | printf("Running Win32\n"); 6 | } else if (sizeof(void*) == 8) { 7 | printf("Running x64\n"); 8 | } else { 9 | printf("Unexpected platform\n"); 10 | } 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /dep/gyp/test/copies/src/directory/file3: -------------------------------------------------------------------------------- 1 | file3 contents 2 | -------------------------------------------------------------------------------- /dep/gyp/test/copies/src/directory/file4: -------------------------------------------------------------------------------- 1 | file4 contents 2 | -------------------------------------------------------------------------------- /dep/gyp/test/copies/src/directory/subdir/file5: -------------------------------------------------------------------------------- 1 | file5 contents 2 | -------------------------------------------------------------------------------- /dep/gyp/test/copies/src/file1: -------------------------------------------------------------------------------- 1 | file1 contents 2 | -------------------------------------------------------------------------------- /dep/gyp/test/copies/src/file2: -------------------------------------------------------------------------------- 1 | file2 contents 2 | -------------------------------------------------------------------------------- /dep/gyp/test/copies/src/parentdir/subdir/file6: -------------------------------------------------------------------------------- 1 | file6 contents 2 | -------------------------------------------------------------------------------- /dep/gyp/test/defines-escaping/defines-escaping.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2010 Google Inc. All rights reserved. 2 | * Use of this source code is governed by a BSD-style license that can be 3 | * found in the LICENSE file. */ 4 | 5 | #include 6 | 7 | int main(int argc, char *argv[]) 8 | { 9 | printf(TEST_FORMAT, TEST_ARGS); 10 | return 0; 11 | } 12 | -------------------------------------------------------------------------------- /dep/gyp/test/dependencies/a.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2009 Google Inc. All rights reserved. 2 | * Use of this source code is governed by a BSD-style license that can be 3 | * found in the LICENSE file. */ 4 | 5 | extern int funcB(); 6 | 7 | int funcA() { 8 | return funcB(); 9 | } 10 | -------------------------------------------------------------------------------- /dep/gyp/test/dependencies/b/b.c: -------------------------------------------------------------------------------- 1 | int funcB() { 2 | return 2; 3 | } 4 | -------------------------------------------------------------------------------- /dep/gyp/test/dependencies/b/b3.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Google Inc. All rights reserved. 3 | * Use of this source code is governed by a BSD-style license that can be 4 | * found in the LICENSE file. 5 | */ 6 | 7 | int funcB() { 8 | return 3; 9 | } 10 | -------------------------------------------------------------------------------- /dep/gyp/test/dependencies/c/c.c: -------------------------------------------------------------------------------- 1 | int funcC() { 2 | return 3 3 | // Intentional syntax error. This file should never be compiled, so this 4 | // shouldn't be a problem. 5 | -------------------------------------------------------------------------------- /dep/gyp/test/dependencies/c/d.c: -------------------------------------------------------------------------------- 1 | int funcD() { 2 | return 4; 3 | } 4 | -------------------------------------------------------------------------------- /dep/gyp/test/dependencies/double_dependent.gyp: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012 Google Inc. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | { 6 | 'targets': [ 7 | { 8 | 'target_name': 'double_dependent', 9 | 'type': 'none', 10 | }, 11 | ], 12 | } 13 | -------------------------------------------------------------------------------- /dep/gyp/test/dependencies/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Google Inc. All rights reserved. 3 | * Use of this source code is governed by a BSD-style license that can be 4 | * found in the LICENSE file. 5 | */ 6 | 7 | #include 8 | 9 | extern int funcA(); 10 | 11 | int main() { 12 | printf("%d\n", funcA()); 13 | return 0; 14 | } 15 | -------------------------------------------------------------------------------- /dep/gyp/test/dependency-copy/src/file1.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, char *argv[]) 4 | { 5 | printf("Hello from file1.c\n"); 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /dep/gyp/test/dependency-copy/src/file2.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, char *argv[]) 4 | { 5 | printf("Hello from file2.c\n"); 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /dep/gyp/test/errors/duplicate_targets.gyp: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009 Google Inc. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | { 6 | 'targets': [ 7 | { 8 | 'target_name': 'foo' 9 | }, 10 | { 11 | 'target_name': 'foo' 12 | }, 13 | ] 14 | } 15 | -------------------------------------------------------------------------------- /dep/gyp/test/errors/missing_targets.gyp: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2011 Google Inc. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | { 6 | 'target_defaults': { 7 | }, 8 | } 9 | -------------------------------------------------------------------------------- /dep/gyp/test/external-cross-compile/src/bogus1.cc: -------------------------------------------------------------------------------- 1 | From bogus1.cc 2 | -------------------------------------------------------------------------------- /dep/gyp/test/external-cross-compile/src/bogus2.c: -------------------------------------------------------------------------------- 1 | From bogus2.c 2 | -------------------------------------------------------------------------------- /dep/gyp/test/external-cross-compile/src/test1.cc: -------------------------------------------------------------------------------- 1 | From test1.cc 2 | -------------------------------------------------------------------------------- /dep/gyp/test/external-cross-compile/src/test2.c: -------------------------------------------------------------------------------- 1 | From test2.c 2 | -------------------------------------------------------------------------------- /dep/gyp/test/external-cross-compile/src/test3.cc: -------------------------------------------------------------------------------- 1 | From test3.cc 2 | -------------------------------------------------------------------------------- /dep/gyp/test/external-cross-compile/src/test4.c: -------------------------------------------------------------------------------- 1 | From test4.c 2 | -------------------------------------------------------------------------------- /dep/gyp/test/generator-output/actions/subdir1/actions-out/README.txt: -------------------------------------------------------------------------------- 1 | A place-holder for this Xcode build output directory, so that the 2 | test script can verify that .xcodeproj files are not created in 3 | their normal location by making the src/ read-only, and then 4 | selectively making this build directory writable. 5 | -------------------------------------------------------------------------------- /dep/gyp/test/generator-output/actions/subdir1/program.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | extern void prog1(void); 4 | extern void prog2(void); 5 | 6 | int main(int argc, char *argv[]) 7 | { 8 | printf("Hello from program.c\n"); 9 | prog1(); 10 | prog2(); 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /dep/gyp/test/generator-output/actions/subdir2/actions-out/README.txt: -------------------------------------------------------------------------------- 1 | A place-holder for this Xcode build output directory, so that the 2 | test script can verify that .xcodeproj files are not created in 3 | their normal location by making the src/ read-only, and then 4 | selectively making this build directory writable. 5 | -------------------------------------------------------------------------------- /dep/gyp/test/generator-output/actions/subdir2/make-file.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Copyright (c) 2009 Google Inc. All rights reserved. 4 | # Use of this source code is governed by a BSD-style license that can be 5 | # found in the LICENSE file. 6 | 7 | import sys 8 | 9 | contents = "Hello from make-file.py\n" 10 | 11 | open(sys.argv[1], 'wb').write(contents) 12 | -------------------------------------------------------------------------------- /dep/gyp/test/generator-output/copies/copies-out/README.txt: -------------------------------------------------------------------------------- 1 | A place-holder for this Xcode build output directory, so that the 2 | test script can verify that .xcodeproj files are not created in 3 | their normal location by making the src/ read-only, and then 4 | selectively making this build directory writable. 5 | -------------------------------------------------------------------------------- /dep/gyp/test/generator-output/copies/file1: -------------------------------------------------------------------------------- 1 | file1 contents 2 | -------------------------------------------------------------------------------- /dep/gyp/test/generator-output/copies/file2: -------------------------------------------------------------------------------- 1 | file2 contents 2 | -------------------------------------------------------------------------------- /dep/gyp/test/generator-output/copies/subdir/copies-out/README.txt: -------------------------------------------------------------------------------- 1 | A place-holder for this Xcode build output directory, so that the 2 | test script can verify that .xcodeproj files are not created in 3 | their normal location by making the src/ read-only, and then 4 | selectively making this build directory writable. 5 | -------------------------------------------------------------------------------- /dep/gyp/test/generator-output/copies/subdir/file3: -------------------------------------------------------------------------------- 1 | file3 contents 2 | -------------------------------------------------------------------------------- /dep/gyp/test/generator-output/copies/subdir/file4: -------------------------------------------------------------------------------- 1 | file4 contents 2 | -------------------------------------------------------------------------------- /dep/gyp/test/generator-output/mac-bundle/app.order: -------------------------------------------------------------------------------- 1 | _main 2 | -------------------------------------------------------------------------------- /dep/gyp/test/generator-output/mac-bundle/header.h: -------------------------------------------------------------------------------- 1 | int f(); 2 | -------------------------------------------------------------------------------- /dep/gyp/test/generator-output/mac-bundle/main.c: -------------------------------------------------------------------------------- 1 | int main() {} 2 | -------------------------------------------------------------------------------- /dep/gyp/test/generator-output/mac-bundle/resource.sb: -------------------------------------------------------------------------------- 1 | A text file. 2 | -------------------------------------------------------------------------------- /dep/gyp/test/generator-output/rules/subdir1/define3.in0: -------------------------------------------------------------------------------- 1 | #define STRING3 "Hello from define3.in0\n" 2 | -------------------------------------------------------------------------------- /dep/gyp/test/generator-output/rules/subdir1/define4.in0: -------------------------------------------------------------------------------- 1 | #define STRING4 "Hello from define4.in0\n" 2 | -------------------------------------------------------------------------------- /dep/gyp/test/generator-output/rules/subdir1/function1.in1: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void function1(void) 4 | { 5 | printf("Hello from function1.in1\n"); 6 | } 7 | -------------------------------------------------------------------------------- /dep/gyp/test/generator-output/rules/subdir1/function2.in1: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void function2(void) 4 | { 5 | printf("Hello from function2.in1\n"); 6 | } 7 | -------------------------------------------------------------------------------- /dep/gyp/test/generator-output/rules/subdir2/file1.in0: -------------------------------------------------------------------------------- 1 | Hello from file1.in0 2 | -------------------------------------------------------------------------------- /dep/gyp/test/generator-output/rules/subdir2/file2.in0: -------------------------------------------------------------------------------- 1 | Hello from file2.in0 2 | -------------------------------------------------------------------------------- /dep/gyp/test/generator-output/rules/subdir2/file3.in1: -------------------------------------------------------------------------------- 1 | Hello from file3.in1 2 | -------------------------------------------------------------------------------- /dep/gyp/test/generator-output/rules/subdir2/file4.in1: -------------------------------------------------------------------------------- 1 | Hello from file4.in1 2 | -------------------------------------------------------------------------------- /dep/gyp/test/generator-output/rules/subdir2/rules-out/README.txt: -------------------------------------------------------------------------------- 1 | A place-holder for this Xcode build output directory, so that the 2 | test script can verify that .xcodeproj files are not created in 3 | their normal location by making the src/ read-only, and then 4 | selectively making this build directory writable. 5 | -------------------------------------------------------------------------------- /dep/gyp/test/generator-output/src/inc.h: -------------------------------------------------------------------------------- 1 | #define INC_STRING "inc.h" 2 | -------------------------------------------------------------------------------- /dep/gyp/test/generator-output/src/inc1/include1.h: -------------------------------------------------------------------------------- 1 | #define INCLUDE1_STRING "inc1/include1.h" 2 | -------------------------------------------------------------------------------- /dep/gyp/test/generator-output/src/subdir2/deeper/deeper.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, char *argv[]) 4 | { 5 | printf("Hello from deeper.c\n"); 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /dep/gyp/test/generator-output/src/subdir2/deeper/deeper.h: -------------------------------------------------------------------------------- 1 | #define DEEPER_STRING "subdir2/deeper/deeper.h" 2 | -------------------------------------------------------------------------------- /dep/gyp/test/generator-output/src/subdir2/inc2/include2.h: -------------------------------------------------------------------------------- 1 | #define INCLUDE2_STRING "inc2/include2.h" 2 | -------------------------------------------------------------------------------- /dep/gyp/test/generator-output/src/subdir3/inc3/include3.h: -------------------------------------------------------------------------------- 1 | #define INCLUDE3_STRING "inc3/include3.h" 2 | -------------------------------------------------------------------------------- /dep/gyp/test/gyp-defines/echo.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Copyright (c) 2012 Google Inc. All rights reserved. 4 | # Use of this source code is governed by a BSD-style license that can be 5 | # found in the LICENSE file. 6 | 7 | import sys 8 | 9 | f = open(sys.argv[2], 'w+') 10 | f.write(sys.argv[1]) 11 | f.close() 12 | -------------------------------------------------------------------------------- /dep/gyp/test/hard_dependency/src/a.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011 Google Inc. All rights reserved. 2 | * Use of this source code is governed by a BSD-style license that can be 3 | * found in the LICENSE file. */ 4 | 5 | #include "a.h" 6 | 7 | int funcA() { 8 | return 42; 9 | } 10 | -------------------------------------------------------------------------------- /dep/gyp/test/hard_dependency/src/a.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2009 Google Inc. All rights reserved. 2 | * Use of this source code is governed by a BSD-style license that can be 3 | * found in the LICENSE file. */ 4 | 5 | #ifndef A_H_ 6 | #define A_H_ 7 | 8 | #include "generated.h" 9 | 10 | int funcA(); 11 | 12 | #endif // A_H_ 13 | -------------------------------------------------------------------------------- /dep/gyp/test/hard_dependency/src/b.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011 Google Inc. All rights reserved. 2 | * Use of this source code is governed by a BSD-style license that can be 3 | * found in the LICENSE file. */ 4 | 5 | #include "a.h" 6 | 7 | int funcB() { 8 | return funcA(); 9 | } 10 | -------------------------------------------------------------------------------- /dep/gyp/test/hard_dependency/src/b.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011 Google Inc. All rights reserved. 2 | * Use of this source code is governed by a BSD-style license that can be 3 | * found in the LICENSE file. */ 4 | 5 | #ifndef B_H_ 6 | #define B_H_ 7 | 8 | #include "a.h" 9 | 10 | int funcB(); 11 | 12 | #endif // B_H_ 13 | -------------------------------------------------------------------------------- /dep/gyp/test/hard_dependency/src/c.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011 Google Inc. All rights reserved. 2 | * Use of this source code is governed by a BSD-style license that can be 3 | * found in the LICENSE file. */ 4 | 5 | #include "b.h" 6 | #include "c.h" 7 | 8 | int funcC() { 9 | return funcB(); 10 | } 11 | -------------------------------------------------------------------------------- /dep/gyp/test/hard_dependency/src/c.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011 Google Inc. All rights reserved. 2 | * Use of this source code is governed by a BSD-style license that can be 3 | * found in the LICENSE file. */ 4 | 5 | #ifndef C_H_ 6 | #define C_H_ 7 | 8 | int funcC(); 9 | 10 | #endif // C_H_ 11 | -------------------------------------------------------------------------------- /dep/gyp/test/hard_dependency/src/d.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2009 Google Inc. All rights reserved. 2 | * Use of this source code is governed by a BSD-style license that can be 3 | * found in the LICENSE file. */ 4 | 5 | #include "c.h" 6 | 7 | int funcD() { 8 | return funcC(); 9 | } 10 | -------------------------------------------------------------------------------- /dep/gyp/test/hard_dependency/src/emit.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Copyright (c) 2011 Google Inc. All rights reserved. 4 | # Use of this source code is governed by a BSD-style license that can be 5 | # found in the LICENSE file. 6 | 7 | import sys 8 | 9 | f = open(sys.argv[1], 'wb') 10 | f.write('/* Hello World */\n') 11 | f.close() 12 | -------------------------------------------------------------------------------- /dep/gyp/test/hello/hello.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2009 Google Inc. All rights reserved. 2 | * Use of this source code is governed by a BSD-style license that can be 3 | * found in the LICENSE file. */ 4 | 5 | #include 6 | 7 | int main(int argc, char *argv[]) 8 | { 9 | printf("Hello, world!\n"); 10 | return 0; 11 | } 12 | -------------------------------------------------------------------------------- /dep/gyp/test/hello/hello2.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2009 Google Inc. All rights reserved. 2 | * Use of this source code is governed by a BSD-style license that can be 3 | * found in the LICENSE file. */ 4 | 5 | #include 6 | 7 | int main(int argc, char *argv[]) 8 | { 9 | printf("Hello, two!\n"); 10 | return 0; 11 | } 12 | -------------------------------------------------------------------------------- /dep/gyp/test/home_dot_gyp/home/.gyp/include.gypi: -------------------------------------------------------------------------------- 1 | { 2 | 'variables': { 3 | 'foo': '"fromhome"', 4 | }, 5 | } 6 | -------------------------------------------------------------------------------- /dep/gyp/test/home_dot_gyp/home2/.gyp/include.gypi: -------------------------------------------------------------------------------- 1 | { 2 | 'variables': { 3 | 'foo': '"fromhome2"', 4 | }, 5 | } 6 | -------------------------------------------------------------------------------- /dep/gyp/test/home_dot_gyp/src/printfoo.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, char *argv[]) 4 | { 5 | printf("FOO is %s\n", FOO); 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /dep/gyp/test/include_dirs/src/inc.h: -------------------------------------------------------------------------------- 1 | #define INC_STRING "inc.h" 2 | -------------------------------------------------------------------------------- /dep/gyp/test/include_dirs/src/inc1/include1.h: -------------------------------------------------------------------------------- 1 | #define INCLUDE1_STRING "include1.h" 2 | -------------------------------------------------------------------------------- /dep/gyp/test/include_dirs/src/shadow1/shadow.h: -------------------------------------------------------------------------------- 1 | #define SHADOW_STRING "shadow1/shadow.h" 2 | -------------------------------------------------------------------------------- /dep/gyp/test/include_dirs/src/shadow2/shadow.h: -------------------------------------------------------------------------------- 1 | #define SHADOW_STRING "shadow2/shadow.h" 2 | -------------------------------------------------------------------------------- /dep/gyp/test/include_dirs/src/subdir/inc.h: -------------------------------------------------------------------------------- 1 | #define INC_STRING "subdir/inc.h" 2 | -------------------------------------------------------------------------------- /dep/gyp/test/include_dirs/src/subdir/inc2/include2.h: -------------------------------------------------------------------------------- 1 | #define INCLUDE2_STRING "subdir/inc2/include2.h" 2 | -------------------------------------------------------------------------------- /dep/gyp/test/intermediate_dir/src/shared_infile.txt: -------------------------------------------------------------------------------- 1 | dummy input 2 | -------------------------------------------------------------------------------- /dep/gyp/test/library/src/lib1.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #ifdef _WIN32 4 | __declspec(dllexport) 5 | #endif 6 | void lib1_function(void) 7 | { 8 | fprintf(stdout, "Hello from lib1.c\n"); 9 | fflush(stdout); 10 | } 11 | -------------------------------------------------------------------------------- /dep/gyp/test/library/src/lib1_moveable.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #ifdef _WIN32 4 | __declspec(dllexport) 5 | #endif 6 | void moveable_function(void) 7 | { 8 | fprintf(stdout, "Hello from lib1_moveable.c\n"); 9 | fflush(stdout); 10 | } 11 | -------------------------------------------------------------------------------- /dep/gyp/test/library/src/lib2.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #ifdef _WIN32 4 | __declspec(dllexport) 5 | #endif 6 | void lib2_function(void) 7 | { 8 | fprintf(stdout, "Hello from lib2.c\n"); 9 | fflush(stdout); 10 | } 11 | -------------------------------------------------------------------------------- /dep/gyp/test/library/src/lib2_moveable.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #ifdef _WIN32 4 | __declspec(dllexport) 5 | #endif 6 | void moveable_function(void) 7 | { 8 | fprintf(stdout, "Hello from lib2_moveable.c\n"); 9 | fflush(stdout); 10 | } 11 | -------------------------------------------------------------------------------- /dep/gyp/test/link-objects/base.c: -------------------------------------------------------------------------------- 1 | void extra(); 2 | 3 | int main(int argc, char** argv) { 4 | extra(); 5 | return 0; 6 | } 7 | -------------------------------------------------------------------------------- /dep/gyp/test/link-objects/extra.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void extra() { 4 | printf("PASS\n"); 5 | } 6 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/action-envvars/action/action.sh: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012 Google Inc. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | set -e 6 | 7 | echo 'Test output' > "${BUILT_PRODUCTS_DIR}/result" 8 | echo 'Other output' > "$1" 9 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/app-bundle/TestApp/English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | NSHumanReadableCopyright = "Copyright ©2011 Google Inc." 4 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/app-bundle/TestApp/main.m: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #import 6 | 7 | int main(int argc, char *argv[]) 8 | { 9 | return NSApplicationMain(argc, (const char **) argv); 10 | } 11 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/app-bundle/empty.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munificent/magpie/f5138e3d316ec1a664b5eadba1bcc8573d3faca3/dep/gyp/test/mac/app-bundle/empty.c -------------------------------------------------------------------------------- /dep/gyp/test/mac/archs/my_file.cc: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2012 Google Inc. All rights reserved. 2 | * Use of this source code is governed by a BSD-style license that can be 3 | * found in the LICENSE file. */ 4 | int x = 1; 5 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/archs/my_main_file.cc: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2012 Google Inc. All rights reserved. 2 | * Use of this source code is governed by a BSD-style license that can be 3 | * found in the LICENSE file. */ 4 | #include 5 | extern int x; 6 | int main() { 7 | printf("hello, world %d\n", x); 8 | } 9 | 10 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/cflags/ccfile.cc: -------------------------------------------------------------------------------- 1 | #ifdef CFLAG 2 | #error CFLAG should not be set 3 | #endif 4 | 5 | #ifndef CCFLAG 6 | #error CCFLAG should be set 7 | #endif 8 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/cflags/ccfile_withcflags.cc: -------------------------------------------------------------------------------- 1 | #ifndef CFLAG 2 | #error CFLAG should be set 3 | #endif 4 | 5 | #ifndef CCFLAG 6 | #error CCFLAG should be set 7 | #endif 8 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/cflags/cfile.c: -------------------------------------------------------------------------------- 1 | #ifndef CFLAG 2 | #error CFLAG should be set 3 | #endif 4 | 5 | #ifdef CCFLAG 6 | #error CCFLAG should not be set 7 | #endif 8 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/cflags/cppfile.cpp: -------------------------------------------------------------------------------- 1 | #ifdef CFLAG 2 | #error CFLAG should not be set 3 | #endif 4 | 5 | #ifndef CCFLAG 6 | #error CCFLAG should be set 7 | #endif 8 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/cflags/cppfile_withcflags.cpp: -------------------------------------------------------------------------------- 1 | #ifndef CFLAG 2 | #error CFLAG should be set 3 | #endif 4 | 5 | #ifndef CCFLAG 6 | #error CCFLAG should be set 7 | #endif 8 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/cflags/cxxfile.cxx: -------------------------------------------------------------------------------- 1 | #ifdef CFLAG 2 | #error CFLAG should not be set 3 | #endif 4 | 5 | #ifndef CCFLAG 6 | #error CCFLAG should be set 7 | #endif 8 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/cflags/cxxfile_withcflags.cxx: -------------------------------------------------------------------------------- 1 | #ifndef CFLAG 2 | #error CFLAG should be set 3 | #endif 4 | 5 | #ifndef CCFLAG 6 | #error CCFLAG should be set 7 | #endif 8 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/cflags/mfile.m: -------------------------------------------------------------------------------- 1 | #ifndef CFLAG 2 | #error CFLAG should be set 3 | #endif 4 | 5 | #ifdef CCFLAG 6 | #error CCFLAG should not be set 7 | #endif 8 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/cflags/mmfile.mm: -------------------------------------------------------------------------------- 1 | #ifdef CFLAG 2 | #error CFLAG should not be set 3 | #endif 4 | 5 | #ifndef CCFLAG 6 | #error CCFLAG should be set 7 | #endif 8 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/cflags/mmfile_withcflags.mm: -------------------------------------------------------------------------------- 1 | #ifndef CFLAG 2 | #error CFLAG should be set 3 | #endif 4 | 5 | #ifndef CCFLAG 6 | #error CCFLAG should be set 7 | #endif 8 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/copy-dylib/empty.c: -------------------------------------------------------------------------------- 1 | int main() {} 2 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/debuginfo/file.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | void f() {} 6 | int main() {} 7 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/depend-on-bundle/English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/depend-on-bundle/bundle.c: -------------------------------------------------------------------------------- 1 | int f() { return 42; } 2 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/depend-on-bundle/executable.c: -------------------------------------------------------------------------------- 1 | int f(); 2 | int main() { 3 | return f(); 4 | } 5 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/framework-headers/myframework.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #import 6 | 7 | @interface TestObject : NSObject 8 | @end 9 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/framework-headers/myframework.m: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #import "myframework.h" 6 | 7 | @implementation TestObject 8 | @end 9 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/framework/TestFramework/English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/framework/TestFramework/ObjCVectorInternal.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include 6 | 7 | struct ObjCVectorImp { 8 | std::vector v; 9 | }; 10 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/framework/TestFramework/TestFramework_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'TestFramework' target in the 'TestFramework' project. 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/framework/empty.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munificent/magpie/f5138e3d316ec1a664b5eadba1bcc8573d3faca3/dep/gyp/test/mac/framework/empty.c -------------------------------------------------------------------------------- /dep/gyp/test/mac/global-settings/src/dir1/dir1.gyp: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012 Google Inc. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | { 5 | 'targets': [ 6 | { 7 | 'target_name': 'dir1_target', 8 | 'type': 'none', 9 | }, 10 | ], 11 | } 12 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/global-settings/src/dir2/file.txt: -------------------------------------------------------------------------------- 1 | File. 2 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/infoplist-process/main.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | int main() { 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/installname/file.c: -------------------------------------------------------------------------------- 1 | int f() { return 0; } 2 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/installname/main.c: -------------------------------------------------------------------------------- 1 | int main() {} 2 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/ldflags-libtool/file.c: -------------------------------------------------------------------------------- 1 | void f() {} 2 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/ldflags/subdirectory/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleSignature 6 | ???? 7 | 8 | 9 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/ldflags/subdirectory/file.c: -------------------------------------------------------------------------------- 1 | void f() {} 2 | void g() {} 3 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/ldflags/subdirectory/symbol_list.def: -------------------------------------------------------------------------------- 1 | _f 2 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/libraries/subdir/README.txt: -------------------------------------------------------------------------------- 1 | Make things live in a subdirectory, to make sure that DEPTH works correctly. 2 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/libraries/subdir/hello.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include 6 | 7 | int main() { 8 | std::cout << "Hello, world!" << std::endl; 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/libraries/subdir/mylib.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | int my_foo(int x) { 6 | return x + 1; 7 | } 8 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/loadable-module/module.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | int SuperFly() { 6 | return 42; 7 | } 8 | 9 | const char* SuperFoo() { 10 | return "Hello World"; 11 | } 12 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/missing-cfbundlesignature/file.c: -------------------------------------------------------------------------------- 1 | int main() {} 2 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/non-strs-flattened-to-env/main.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | int main() { 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/objc-gc/c-file.c: -------------------------------------------------------------------------------- 1 | void c_fun() {} 2 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/objc-gc/cc-file.cc: -------------------------------------------------------------------------------- 1 | void cc_fun() {} 2 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/objc-gc/main.m: -------------------------------------------------------------------------------- 1 | #import 2 | 3 | int main() { 4 | printf("gc on: %d\n", [NSGarbageCollector defaultCollector] != NULL); 5 | return 0; 6 | } 7 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/objc-gc/needs-gc-mm.mm: -------------------------------------------------------------------------------- 1 | void objcpp_fun() { } 2 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/objc-gc/needs-gc.m: -------------------------------------------------------------------------------- 1 | void objc_fun() { } 2 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/postbuild-copy-bundle/copied.txt: -------------------------------------------------------------------------------- 1 | old copied file 2 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/postbuild-copy-bundle/empty.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munificent/magpie/f5138e3d316ec1a664b5eadba1bcc8573d3faca3/dep/gyp/test/mac/postbuild-copy-bundle/empty.c -------------------------------------------------------------------------------- /dep/gyp/test/mac/postbuild-copy-bundle/main.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | int main() {} 5 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/postbuild-copy-bundle/postbuild-copy-framework.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (c) 2012 Google Inc. All rights reserved. 4 | # Use of this source code is governed by a BSD-style license that can be 5 | # found in the LICENSE file. 6 | 7 | set -e 8 | 9 | rsync -acC --delete "$1" "$2" 10 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/postbuild-copy-bundle/resource_file.sb: -------------------------------------------------------------------------------- 1 | This is included in the framework bundle. 2 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/postbuild-defaults/main.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | int main() { 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/postbuild-fail/file.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | // That's right, this is copyrighted. 6 | void f() {} 7 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/postbuild-fail/postbuild-fail.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/bash 2 | # Copyright (c) 2011 Google Inc. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | exit 1 7 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/postbuild-fail/touch-dynamic.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2011 Google Inc. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | set -e 7 | touch "${BUILT_PRODUCTS_DIR}/dynamic_touch" 8 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/postbuild-fail/touch-static.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2011 Google Inc. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | set -e 7 | touch "${BUILT_PRODUCTS_DIR}/static_touch" 8 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/postbuild-multiple-configurations/main.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | int main() {} 5 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/postbuild-multiple-configurations/postbuild-touch-file.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (c) 2012 Google Inc. All rights reserved. 4 | # Use of this source code is governed by a BSD-style license that can be 5 | # found in the LICENSE file. 6 | 7 | touch "${BUILT_PRODUCTS_DIR}/postbuild-file" 8 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/postbuild-static-library/empty.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | void f() {} 5 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/postbuild-static-library/postbuild-touch-file.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Copyright (c) 2012 Google Inc. All rights reserved. 4 | # Use of this source code is governed by a BSD-style license that can be 5 | # found in the LICENSE file. 6 | 7 | touch "${BUILT_PRODUCTS_DIR}/$1" 8 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/postbuilds/copy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cp "$@" 4 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/postbuilds/file.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | void f() {} 5 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/postbuilds/file_g.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | void g() {} 5 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/postbuilds/file_h.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | void h() {} 5 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/postbuilds/subdirectory/copied_file.txt: -------------------------------------------------------------------------------- 1 | This file should be copied to the products dir. 2 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/prefixheader/file.c: -------------------------------------------------------------------------------- 1 | MyInt f() { return 0; } 2 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/prefixheader/file.cc: -------------------------------------------------------------------------------- 1 | MyInt f() { return 0; } 2 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/prefixheader/file.m: -------------------------------------------------------------------------------- 1 | MyInt f() { return 0; } 2 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/prefixheader/file.mm: -------------------------------------------------------------------------------- 1 | MyInt f() { return 0; } 2 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/prefixheader/header.h: -------------------------------------------------------------------------------- 1 | typedef int MyInt; 2 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/rebuild/delay-touch.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | sleep 1 # mtime resolution is 1 sec on unix. 6 | touch "$1" 7 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/rebuild/empty.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munificent/magpie/f5138e3d316ec1a664b5eadba1bcc8573d3faca3/dep/gyp/test/mac/rebuild/empty.c -------------------------------------------------------------------------------- /dep/gyp/test/mac/rebuild/main.c: -------------------------------------------------------------------------------- 1 | int main() {} 2 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/rpath/file.c: -------------------------------------------------------------------------------- 1 | void f() {} 2 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/rpath/main.c: -------------------------------------------------------------------------------- 1 | int main() {} 2 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/sdkroot/file.cc: -------------------------------------------------------------------------------- 1 | #include 2 | using std::map; 3 | 4 | int main() { 5 | } 6 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/sdkroot/test_shorthand.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2012 Google Inc. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | 6 | set -e 7 | 8 | test $SDKROOT = /Developer/SDKs/MacOSX10.6.sdk 9 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/sourceless-module/empty.c: -------------------------------------------------------------------------------- 1 | int main() {} 2 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/strip/file.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | static void the_static_function() {} 6 | 7 | void the_function() { 8 | the_static_function(); 9 | } 10 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/strip/strip.saves: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2011 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | # This file would list symbols that should not be stripped. 6 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/strip/subdirectory/nested_file.c: -------------------------------------------------------------------------------- 1 | void nested_f() {} 2 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/strip/subdirectory/nested_strip.saves: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | # This file would list symbols that should not be stripped. 6 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/strip/subdirectory/test_reading_save_file_from_postbuild.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -e 4 | 5 | test -f ${CHROMIUM_STRIP_SAVE_FILE} 6 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/type_envvars/file.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | void f() {} 6 | int main() {} 7 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/xcode-env-order/file.ext1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munificent/magpie/f5138e3d316ec1a664b5eadba1bcc8573d3faca3/dep/gyp/test/mac/xcode-env-order/file.ext1 -------------------------------------------------------------------------------- /dep/gyp/test/mac/xcode-env-order/file.ext2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munificent/magpie/f5138e3d316ec1a664b5eadba1bcc8573d3faca3/dep/gyp/test/mac/xcode-env-order/file.ext2 -------------------------------------------------------------------------------- /dep/gyp/test/mac/xcode-env-order/file.ext3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munificent/magpie/f5138e3d316ec1a664b5eadba1bcc8573d3faca3/dep/gyp/test/mac/xcode-env-order/file.ext3 -------------------------------------------------------------------------------- /dep/gyp/test/mac/xcode-env-order/main.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | int main() { 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/xcode-gcc/valid_c.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | // This file exists to test that valid C files compile correctly. 6 | 7 | void FunctionInCFile(void) { 8 | } 9 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/xcode-gcc/valid_cc.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | // This file exists to test that valid C++ files compile correctly. 6 | 7 | void FunctionInCCFile() { 8 | } 9 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/xcode-gcc/valid_m.m: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | // This file exists to test that valid Objective-C files compile correctly. 6 | 7 | void FunctionInMFile(void) { 8 | } 9 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/xcode-gcc/valid_mm.mm: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | // This file exists to test that valid Objective-C++ files compile correctly. 6 | 7 | void FunctionInMMFile() { 8 | } 9 | -------------------------------------------------------------------------------- /dep/gyp/test/mac/xcode-gcc/warn_about_missing_newline.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | // Important: Don't terminate this file with a newline. 6 | int main() { 7 | return 0; 8 | } -------------------------------------------------------------------------------- /dep/gyp/test/make/main.cc: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2009 Google Inc. All rights reserved. 2 | * Use of this source code is governed by a BSD-style license that can be 3 | * found in the LICENSE file. */ 4 | 5 | #include 6 | 7 | #include "main.h" 8 | 9 | int main(int argc, char *argv[]) { 10 | printf("hello world\n"); 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /dep/gyp/test/make/main.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munificent/magpie/f5138e3d316ec1a664b5eadba1bcc8573d3faca3/dep/gyp/test/make/main.h -------------------------------------------------------------------------------- /dep/gyp/test/make/noload/lib/shared.c: -------------------------------------------------------------------------------- 1 | #include "shared.h" 2 | 3 | const char kSharedStr[] = "shared.c"; 4 | -------------------------------------------------------------------------------- /dep/gyp/test/make/noload/lib/shared.h: -------------------------------------------------------------------------------- 1 | extern const char kSharedStr[]; 2 | -------------------------------------------------------------------------------- /dep/gyp/test/make/noload/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include "lib/shared.h" 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | printf("Hello from %s.\n", kSharedStr); 8 | return 0; 9 | } 10 | -------------------------------------------------------------------------------- /dep/gyp/test/many-actions/file0: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munificent/magpie/f5138e3d316ec1a664b5eadba1bcc8573d3faca3/dep/gyp/test/many-actions/file0 -------------------------------------------------------------------------------- /dep/gyp/test/many-actions/file1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munificent/magpie/f5138e3d316ec1a664b5eadba1bcc8573d3faca3/dep/gyp/test/many-actions/file1 -------------------------------------------------------------------------------- /dep/gyp/test/many-actions/file2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munificent/magpie/f5138e3d316ec1a664b5eadba1bcc8573d3faca3/dep/gyp/test/many-actions/file2 -------------------------------------------------------------------------------- /dep/gyp/test/many-actions/file3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munificent/magpie/f5138e3d316ec1a664b5eadba1bcc8573d3faca3/dep/gyp/test/many-actions/file3 -------------------------------------------------------------------------------- /dep/gyp/test/many-actions/file4: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munificent/magpie/f5138e3d316ec1a664b5eadba1bcc8573d3faca3/dep/gyp/test/many-actions/file4 -------------------------------------------------------------------------------- /dep/gyp/test/module/src/lib1.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #ifdef _WIN32 4 | __declspec(dllexport) 5 | #endif 6 | void module_main(void) 7 | { 8 | fprintf(stdout, "Hello from lib1.c\n"); 9 | fflush(stdout); 10 | } 11 | -------------------------------------------------------------------------------- /dep/gyp/test/module/src/lib2.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #ifdef _WIN32 4 | __declspec(dllexport) 5 | #endif 6 | void module_main(void) 7 | { 8 | fprintf(stdout, "Hello from lib2.c\n"); 9 | fflush(stdout); 10 | } 11 | -------------------------------------------------------------------------------- /dep/gyp/test/msvs/config_attrs/hello.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2012 Google Inc. All rights reserved. 2 | * Use of this source code is governed by a BSD-style license that can be 3 | * found in the LICENSE file. */ 4 | 5 | #include 6 | 7 | int main(int argc, char *argv[]) 8 | { 9 | printf("Hello, world!\n"); 10 | return 0; 11 | } -------------------------------------------------------------------------------- /dep/gyp/test/msvs/list_excluded/hello.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include 6 | 7 | int main(int argc, char *argv[]) { 8 | printf("Hello, world!\n"); 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /dep/gyp/test/msvs/list_excluded/hello_mac.cpp: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include 6 | 7 | int hello2() { 8 | printf("Hello, two!\n"); 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /dep/gyp/test/msvs/props/AppName.vsprops: -------------------------------------------------------------------------------- 1 | 2 | 7 | 11 | 12 | -------------------------------------------------------------------------------- /dep/gyp/test/msvs/props/hello.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2012 Google Inc. All rights reserved. 2 | * Use of this source code is governed by a BSD-style license that can be 3 | * found in the LICENSE file. */ 4 | 5 | #include 6 | 7 | int main(int argc, char *argv[]) 8 | { 9 | printf("Hello, world!\n"); 10 | return 0; 11 | } 12 | -------------------------------------------------------------------------------- /dep/gyp/test/msvs/shared_output/hello.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012 Google Inc. All rights reserved. 3 | * Use of this source code is governed by a BSD-style license that can be 4 | * found in the LICENSE file. 5 | */ 6 | 7 | #include 8 | 9 | int main(int argc, char *argv[]) { 10 | printf("Hello, world!\n"); 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /dep/gyp/test/msvs/shared_output/there/there.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012 Google Inc. All rights reserved. 3 | * Use of this source code is governed by a BSD-style license that can be 4 | * found in the LICENSE file. 5 | */ 6 | 7 | #include 8 | 9 | int main(int argc, char *argv[]) { 10 | printf("Hello, world!\n"); 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /dep/gyp/test/msvs/uldi2010/hello2.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2012 Google Inc. All rights reserved. 2 | * Use of this source code is governed by a BSD-style license that can be 3 | * found in the LICENSE file. */ 4 | 5 | #include 6 | 7 | int hello2() { 8 | printf("Hello, two!\n"); 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /dep/gyp/test/multiple-targets/src/common.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void common(void) 4 | { 5 | printf("hello from common.c\n"); 6 | return; 7 | } 8 | -------------------------------------------------------------------------------- /dep/gyp/test/multiple-targets/src/prog1.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | extern void common(void); 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | printf("hello from prog1.c\n"); 8 | common(); 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /dep/gyp/test/multiple-targets/src/prog2.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | extern void common(void); 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | printf("hello from prog2.c\n"); 8 | common(); 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /dep/gyp/test/ninja/action_dependencies/src/a.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011 Google Inc. All rights reserved. 2 | * Use of this source code is governed by a BSD-style license that can be 3 | * found in the LICENSE file. 4 | */ 5 | 6 | #include "a.h" 7 | 8 | int funcA() { 9 | return 42; 10 | } 11 | -------------------------------------------------------------------------------- /dep/gyp/test/ninja/action_dependencies/src/a.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011 Google Inc. All rights reserved. 2 | * Use of this source code is governed by a BSD-style license that can be 3 | * found in the LICENSE file. 4 | */ 5 | 6 | #ifndef A_H_ 7 | #define A_H_ 8 | 9 | #include "a/generated.h" 10 | 11 | int funcA(); 12 | 13 | #endif // A_H_ 14 | -------------------------------------------------------------------------------- /dep/gyp/test/ninja/action_dependencies/src/b.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011 Google Inc. All rights reserved. 2 | * Use of this source code is governed by a BSD-style license that can be 3 | * found in the LICENSE file. 4 | */ 5 | 6 | #ifndef B_H_ 7 | #define B_H_ 8 | 9 | #include "a.h" 10 | 11 | int funcB(); 12 | 13 | #endif // B_H_ 14 | -------------------------------------------------------------------------------- /dep/gyp/test/ninja/action_dependencies/src/c.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011 Google Inc. All rights reserved. 2 | * Use of this source code is governed by a BSD-style license that can be 3 | * found in the LICENSE file. 4 | */ 5 | 6 | #include "c.h" 7 | 8 | int funcC() { 9 | return VALUE; 10 | } 11 | -------------------------------------------------------------------------------- /dep/gyp/test/ninja/action_dependencies/src/c.h: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011 Google Inc. All rights reserved. 2 | * Use of this source code is governed by a BSD-style license that can be 3 | * found in the LICENSE file. 4 | */ 5 | 6 | #ifndef C_H_ 7 | #define C_H_ 8 | 9 | #include "c/generated.h" 10 | 11 | int funcC(); 12 | 13 | #endif // C_H_ 14 | -------------------------------------------------------------------------------- /dep/gyp/test/ninja/action_dependencies/src/emit.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Copyright (c) 2011 Google Inc. All rights reserved. 4 | # Use of this source code is governed by a BSD-style license that can be 5 | # found in the LICENSE file. 6 | 7 | import sys 8 | 9 | f = open(sys.argv[1], 'wb') 10 | f.write('/* Hello World */\n') 11 | f.close() 12 | -------------------------------------------------------------------------------- /dep/gyp/test/ninja/chained-dependency/chained.c: -------------------------------------------------------------------------------- 1 | #include "generated/header.h" 2 | 3 | int main(int argc, char** argv) { 4 | return 0; 5 | } 6 | -------------------------------------------------------------------------------- /dep/gyp/test/ninja/normalize-paths-win/hello.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | int main() { 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /dep/gyp/test/ninja/s-needs-no-depfiles/empty.s: -------------------------------------------------------------------------------- 1 | # This file intentionally left blank. 2 | -------------------------------------------------------------------------------- /dep/gyp/test/ninja/solibs_avoid_relinking/main.cc: -------------------------------------------------------------------------------- 1 | extern int foo(); 2 | 3 | int main() { 4 | return foo(); 5 | } 6 | -------------------------------------------------------------------------------- /dep/gyp/test/ninja/solibs_avoid_relinking/solib.cc: -------------------------------------------------------------------------------- 1 | #ifdef _MSC_VER 2 | __declspec(dllexport) 3 | #else 4 | __attribute__((visibility("default"))) 5 | #endif 6 | int foo() { 7 | return 42; 8 | } 9 | -------------------------------------------------------------------------------- /dep/gyp/test/ninja/use-custom-environment-files/use-custom-environment-files.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | int main() { 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /dep/gyp/test/relative/foo/a/a.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Google Inc. All rights reserved. 3 | * Use of this source code is governed by a BSD-style license that can be 4 | * found in the LICENSE file. 5 | */ 6 | 7 | int main() { 8 | return 0; 9 | } 10 | -------------------------------------------------------------------------------- /dep/gyp/test/relative/foo/a/a.gyp: -------------------------------------------------------------------------------- 1 | { 2 | 'targets': [ 3 | { 4 | 'target_name': 'a', 5 | 'type': 'executable', 6 | 'sources': ['a.cc'], 7 | 'dependencies': [ 8 | '../../foo/b/b.gyp:b', 9 | 'c/c.gyp:c', 10 | ], 11 | }, 12 | ], 13 | } 14 | -------------------------------------------------------------------------------- /dep/gyp/test/relative/foo/a/c/c.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Google Inc. All rights reserved. 3 | * Use of this source code is governed by a BSD-style license that can be 4 | * found in the LICENSE file. 5 | */ 6 | 7 | int func() { 8 | return 0; 9 | } 10 | -------------------------------------------------------------------------------- /dep/gyp/test/relative/foo/a/c/c.gyp: -------------------------------------------------------------------------------- 1 | { 2 | 'targets': [ 3 | { 4 | 'target_name': 'c', 5 | 'type': 'static_library', 6 | 'sources': ['c.cc'], 7 | 'dependencies': [ 8 | '../../b/b.gyp:b', 9 | ], 10 | }, 11 | ], 12 | } 13 | -------------------------------------------------------------------------------- /dep/gyp/test/relative/foo/b/b.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2011 Google Inc. All rights reserved. 3 | * Use of this source code is governed by a BSD-style license that can be 4 | * found in the LICENSE file. 5 | */ 6 | 7 | int func2() { 8 | return 0; 9 | } 10 | -------------------------------------------------------------------------------- /dep/gyp/test/relative/foo/b/b.gyp: -------------------------------------------------------------------------------- 1 | { 2 | 'targets': [ 3 | { 4 | 'target_name': 'b', 5 | 'type': 'static_library', 6 | 'sources': ['b.cc'], 7 | }, 8 | ], 9 | } 10 | -------------------------------------------------------------------------------- /dep/gyp/test/rename/filecase/file.c: -------------------------------------------------------------------------------- 1 | int main() { return 0; } 2 | -------------------------------------------------------------------------------- /dep/gyp/test/rules-dirname/src/copy-file.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Copyright (c) 2011 Google Inc. All rights reserved. 4 | # Use of this source code is governed by a BSD-style license that can be 5 | # found in the LICENSE file. 6 | import sys 7 | 8 | contents = open(sys.argv[1], 'r').read() 9 | open(sys.argv[2], 'wb').write(contents) 10 | 11 | sys.exit(0) 12 | -------------------------------------------------------------------------------- /dep/gyp/test/rules-dirname/src/subdir/a/b/c.gencc: -------------------------------------------------------------------------------- 1 | // -*- mode: c++ -*- 2 | #include 3 | 4 | using std::cout; 5 | using std::endl; 6 | 7 | namespace gen { 8 | void c() { 9 | cout << "hi c" << endl; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /dep/gyp/test/rules-dirname/src/subdir/a/b/c.printvars: -------------------------------------------------------------------------------- 1 | # Empty file for testing build rules 2 | -------------------------------------------------------------------------------- /dep/gyp/test/rules-dirname/src/subdir/foo/bar/baz.gencc: -------------------------------------------------------------------------------- 1 | // -*- mode: c++ -*- 2 | #include 3 | 4 | using std::cout; 5 | using std::endl; 6 | 7 | namespace gen { 8 | void baz() { 9 | cout << "hello baz" << endl; 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /dep/gyp/test/rules-dirname/src/subdir/foo/bar/baz.printvars: -------------------------------------------------------------------------------- 1 | # Empty file for testing build rules 2 | -------------------------------------------------------------------------------- /dep/gyp/test/rules-dirname/src/subdir/main.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | namespace gen { 5 | extern void c(); 6 | extern void baz(); 7 | } 8 | 9 | int main() { 10 | gen::c(); 11 | gen::baz(); 12 | } 13 | -------------------------------------------------------------------------------- /dep/gyp/test/rules-rebuild/src/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | extern void prog1(void); 4 | extern void prog2(void); 5 | 6 | int main(int argc, char *argv[]) 7 | { 8 | printf("Hello from main.c\n"); 9 | prog1(); 10 | prog2(); 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /dep/gyp/test/rules-rebuild/src/prog1.in: -------------------------------------------------------------------------------- 1 | #include 2 | #include "prog1.h" 3 | 4 | void prog1(void) 5 | { 6 | printf("Hello from %s!\n", NAME); 7 | } 8 | -------------------------------------------------------------------------------- /dep/gyp/test/rules-rebuild/src/prog2.in: -------------------------------------------------------------------------------- 1 | #include 2 | #include "prog2.h" 3 | 4 | void prog2(void) 5 | { 6 | printf("Hello from %s!\n", NAME); 7 | } 8 | -------------------------------------------------------------------------------- /dep/gyp/test/rules-variables/src/input_ext.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include 6 | 7 | void input_ext() { 8 | printf("input_ext\n"); 9 | } 10 | -------------------------------------------------------------------------------- /dep/gyp/test/rules-variables/src/input_name/test.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include 6 | 7 | void input_name() { 8 | printf("input_name\n"); 9 | } 10 | -------------------------------------------------------------------------------- /dep/gyp/test/rules-variables/src/input_path/subdir/test.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include 6 | 7 | void input_path() { 8 | printf("input_path\n"); 9 | } 10 | -------------------------------------------------------------------------------- /dep/gyp/test/rules-variables/src/subdir/input_dirname.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include 6 | 7 | void input_dirname() { 8 | printf("input_dirname\n"); 9 | } 10 | -------------------------------------------------------------------------------- /dep/gyp/test/rules-variables/src/test.input_root.c: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2011 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include 6 | 7 | void input_root() { 8 | printf("input_root\n"); 9 | } 10 | -------------------------------------------------------------------------------- /dep/gyp/test/rules/src/an_asm.S: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | // Fake asm file. 6 | int main() {} 7 | -------------------------------------------------------------------------------- /dep/gyp/test/rules/src/as.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | :: Copyright (c) 2011 Google Inc. All rights reserved. 3 | :: Use of this source code is governed by a BSD-style license that can be 4 | :: found in the LICENSE file. 5 | 6 | :: Fake assembler for Windows 7 | cl /TP /c %1 /Fo%2 8 | -------------------------------------------------------------------------------- /dep/gyp/test/rules/src/copy-file.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Copyright (c) 2009 Google Inc. All rights reserved. 4 | # Use of this source code is governed by a BSD-style license that can be 5 | # found in the LICENSE file. 6 | import sys 7 | 8 | contents = open(sys.argv[1], 'r').read() 9 | open(sys.argv[2], 'wb').write(contents) 10 | 11 | sys.exit(0) 12 | -------------------------------------------------------------------------------- /dep/gyp/test/rules/src/external/file1.in: -------------------------------------------------------------------------------- 1 | Hello from file1.in 2 | -------------------------------------------------------------------------------- /dep/gyp/test/rules/src/external/file2.in: -------------------------------------------------------------------------------- 1 | Hello from file2.in 2 | -------------------------------------------------------------------------------- /dep/gyp/test/rules/src/noaction/file1.in: -------------------------------------------------------------------------------- 1 | Hello from file1.in 2 | -------------------------------------------------------------------------------- /dep/gyp/test/rules/src/somefile.ext: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munificent/magpie/f5138e3d316ec1a664b5eadba1bcc8573d3faca3/dep/gyp/test/rules/src/somefile.ext -------------------------------------------------------------------------------- /dep/gyp/test/rules/src/subdir1/function1.in: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void function1(void) 4 | { 5 | printf("Hello from function1.in\n"); 6 | } 7 | -------------------------------------------------------------------------------- /dep/gyp/test/rules/src/subdir1/function2.in: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void function2(void) 4 | { 5 | printf("Hello from function2.in\n"); 6 | } 7 | -------------------------------------------------------------------------------- /dep/gyp/test/rules/src/subdir1/program.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | extern void function1(void); 4 | extern void function2(void); 5 | 6 | int main(int argc, char *argv[]) 7 | { 8 | printf("Hello from program.c\n"); 9 | function1(); 10 | function2(); 11 | return 0; 12 | } 13 | -------------------------------------------------------------------------------- /dep/gyp/test/rules/src/subdir2/file1.in: -------------------------------------------------------------------------------- 1 | Hello from file1.in 2 | -------------------------------------------------------------------------------- /dep/gyp/test/rules/src/subdir2/file2.in: -------------------------------------------------------------------------------- 1 | Hello from file2.in 2 | -------------------------------------------------------------------------------- /dep/gyp/test/rules/src/subdir3/function3.in: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | extern "C" void function3(void) 4 | { 5 | printf("Hello from function3.in\n"); 6 | } 7 | -------------------------------------------------------------------------------- /dep/gyp/test/rules/src/subdir3/program.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | extern void function3(void); 4 | 5 | int main(int argc, char *argv[]) 6 | { 7 | printf("Hello from program.c\n"); 8 | function3(); 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /dep/gyp/test/rules/src/subdir4/asm-function.assem: -------------------------------------------------------------------------------- 1 | #if PLATFORM_WINDOWS || PLATFORM_MAC 2 | # define IDENTIFIER(n) _##n 3 | #else /* Linux */ 4 | # define IDENTIFIER(n) n 5 | #endif 6 | 7 | .globl IDENTIFIER(asm_function) 8 | IDENTIFIER(asm_function): 9 | movl $41, %eax 10 | ret 11 | -------------------------------------------------------------------------------- /dep/gyp/test/same-gyp-name/library/one/sub.gyp: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012 Google Inc. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | { 5 | 'targets': [ 6 | { 7 | 'target_name': 'one', 8 | 'type': 'static_library', 9 | }, 10 | ], 11 | } 12 | -------------------------------------------------------------------------------- /dep/gyp/test/same-gyp-name/library/two/sub.gyp: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012 Google Inc. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | { 5 | 'targets': [ 6 | { 7 | 'target_name': 'two', 8 | 'type': 'static_library', 9 | }, 10 | ], 11 | } 12 | -------------------------------------------------------------------------------- /dep/gyp/test/same-gyp-name/src/subdir1/main1.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() { 4 | printf("Hello from main1.cc\n"); 5 | return 0; 6 | } 7 | -------------------------------------------------------------------------------- /dep/gyp/test/same-gyp-name/src/subdir2/main2.cc: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main() { 4 | printf("Hello from main2.cc\n"); 5 | return 0; 6 | } 7 | -------------------------------------------------------------------------------- /dep/gyp/test/same-rule-output-file-name/src/touch.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Copyright (c) 2012 Google Inc. All rights reserved. 4 | # Use of this source code is governed by a BSD-style license that can be 5 | # found in the LICENSE file. 6 | 7 | import sys 8 | 9 | f = open(sys.argv[1], 'w+') 10 | f.write('Hello from touch.py\n') 11 | f.close() 12 | -------------------------------------------------------------------------------- /dep/gyp/test/same-source-file-name/src/func.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void func(void) 4 | { 5 | printf("Hello %s from func.c\n", PROG); 6 | } 7 | -------------------------------------------------------------------------------- /dep/gyp/test/same-source-file-name/src/subdir1/func.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void subdir1_func(void) 4 | { 5 | printf("Hello %s from subdir1/func.c\n", PROG); 6 | } 7 | -------------------------------------------------------------------------------- /dep/gyp/test/same-source-file-name/src/subdir2/func.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void subdir2_func(void) 4 | { 5 | printf("Hello %s from subdir2/func.c\n", PROG); 6 | } 7 | -------------------------------------------------------------------------------- /dep/gyp/test/same-target-name-different-directory/src/touch.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Copyright (c) 2012 Google Inc. All rights reserved. 4 | # Use of this source code is governed by a BSD-style license that can be 5 | # found in the LICENSE file. 6 | 7 | import sys 8 | 9 | f = open(sys.argv[1], 'w+') 10 | f.write('Hello from touch.py\n') 11 | f.close() 12 | -------------------------------------------------------------------------------- /dep/gyp/test/sanitize-rule-names/blah.S: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munificent/magpie/f5138e3d316ec1a664b5eadba1bcc8573d3faca3/dep/gyp/test/sanitize-rule-names/blah.S -------------------------------------------------------------------------------- /dep/gyp/test/sanitize-rule-names/hello.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | int main() { 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /dep/gyp/test/sanitize-rule-names/script.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Copyright (c) 2012 Google Inc. All rights reserved. 4 | # Use of this source code is governed by a BSD-style license that can be 5 | # found in the LICENSE file. 6 | 7 | import shutil 8 | import sys 9 | 10 | shutil.copyfile(*sys.argv[1:]) 11 | -------------------------------------------------------------------------------- /dep/gyp/test/scons_tools/tools.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2009 Google Inc. All rights reserved. 2 | * Use of this source code is governed by a BSD-style license that can be 3 | * found in the LICENSE file. */ 4 | 5 | #include 6 | 7 | int main(int argc, char *argv[]) 8 | { 9 | #ifdef THIS_TOOL 10 | printf("Hello, world!\n"); 11 | #endif 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /dep/gyp/test/sibling/src/prog1/prog1.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, char *argv[]) 4 | { 5 | printf("Hello from prog1.c\n"); 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /dep/gyp/test/sibling/src/prog2/prog2.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, char *argv[]) 4 | { 5 | printf("Hello from prog2.c\n"); 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /dep/gyp/test/standalone-static-library/mylib.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void print(void) 4 | { 5 | printf("hello from mylib.c\n"); 6 | return; 7 | } 8 | -------------------------------------------------------------------------------- /dep/gyp/test/standalone-static-library/prog.c: -------------------------------------------------------------------------------- 1 | extern void print(void); 2 | 3 | int main(int argc, char *argv[]) 4 | { 5 | print(); 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /dep/gyp/test/standalone/standalone.gyp: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2009 Google Inc. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | { 6 | 'targets': [ 7 | { 8 | 'target_name' : 'foo', 9 | 'type' : 'executable' 10 | }, 11 | ] 12 | } 13 | -------------------------------------------------------------------------------- /dep/gyp/test/subdirectory/src/prog1.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, char *argv[]) 4 | { 5 | printf("Hello from prog1.c\n"); 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /dep/gyp/test/subdirectory/src/subdir/prog2.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, char *argv[]) 4 | { 5 | printf("Hello from prog2.c\n"); 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /dep/gyp/test/subdirectory/src/subdir/subdir2/prog3.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, char *argv[]) 4 | { 5 | printf("Hello from prog3.c\n"); 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /dep/gyp/test/toolsets/main.cc: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2009 Google Inc. All rights reserved. 2 | * Use of this source code is governed by a BSD-style license that can be 3 | * found in the LICENSE file. */ 4 | 5 | #include 6 | 7 | const char *GetToolset(); 8 | 9 | int main(int argc, char *argv[]) { 10 | printf("%s\n", GetToolset()); 11 | } 12 | -------------------------------------------------------------------------------- /dep/gyp/test/toolsets/toolsets.cc: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2009 Google Inc. All rights reserved. 2 | * Use of this source code is governed by a BSD-style license that can be 3 | * found in the LICENSE file. */ 4 | 5 | const char *GetToolset() { 6 | #ifdef TARGET 7 | return "Target"; 8 | #else 9 | return "Host"; 10 | #endif 11 | } 12 | -------------------------------------------------------------------------------- /dep/gyp/test/toplevel-dir/src/sub1/prog1.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, char *argv[]) 4 | { 5 | printf("Hello from prog1.c\n"); 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /dep/gyp/test/toplevel-dir/src/sub2/prog2.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, char *argv[]) 4 | { 5 | printf("Hello from prog2.c\n"); 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /dep/gyp/test/variables/commands/test.py: -------------------------------------------------------------------------------- 1 | print "sample\\path\\foo.cpp" 2 | -------------------------------------------------------------------------------- /dep/gyp/test/variables/latelate/src/program.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2012 Google Inc. All rights reserved. 3 | * Use of this source code is governed by a BSD-style license that can be 4 | * found in the LICENSE file. 5 | */ 6 | 7 | #include 8 | 9 | 10 | int main(int argc, char *argv[]) { 11 | printf(FOO "\n"); 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /dep/gyp/test/variables/variable-in-path/C1/hello.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | int main() { 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /dep/gyp/test/variants/src/variants.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, char *argv[]) 4 | { 5 | #if defined(VARIANT1) 6 | printf("Hello from VARIANT1\n"); 7 | #elif defined(VARIANT2) 8 | printf("Hello from VARIANT2\n"); 9 | #else 10 | printf("Hello, world!\n"); 11 | #endif 12 | return 0; 13 | } 14 | -------------------------------------------------------------------------------- /dep/gyp/test/win/asm-files/b.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munificent/magpie/f5138e3d316ec1a664b5eadba1bcc8573d3faca3/dep/gyp/test/win/asm-files/b.s -------------------------------------------------------------------------------- /dep/gyp/test/win/asm-files/c.S: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munificent/magpie/f5138e3d316ec1a664b5eadba1bcc8573d3faca3/dep/gyp/test/win/asm-files/c.S -------------------------------------------------------------------------------- /dep/gyp/test/win/asm-files/hello.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | int main() { 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /dep/gyp/test/win/batch-file-action/infile: -------------------------------------------------------------------------------- 1 | input 2 | -------------------------------------------------------------------------------- /dep/gyp/test/win/batch-file-action/somecmd.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | :: The redirs to nul are important. %2 can end up being an unterminated "'d 3 | :: string, so the remainder of the command line becomes the target file name, 4 | :: which in turn fails because it's a filename containing >, nul, etc. 5 | copy /y %1 %2 >nul 2>nul 6 | -------------------------------------------------------------------------------- /dep/gyp/test/win/command-quote/a.S: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munificent/magpie/f5138e3d316ec1a664b5eadba1bcc8573d3faca3/dep/gyp/test/win/command-quote/a.S -------------------------------------------------------------------------------- /dep/gyp/test/win/command-quote/bat with spaces.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | :: Copyright (c) 2012 Google Inc. All rights reserved. 4 | :: Use of this source code is governed by a BSD-style license that can be 5 | :: found in the LICENSE file. 6 | 7 | copy %1 %2 8 | -------------------------------------------------------------------------------- /dep/gyp/test/win/command-quote/go.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | :: Copyright (c) 2012 Google Inc. All rights reserved. 4 | :: Use of this source code is governed by a BSD-style license that can be 5 | :: found in the LICENSE file. 6 | 7 | copy %1 %2 8 | -------------------------------------------------------------------------------- /dep/gyp/test/win/compiler-flags/additional-include-dirs.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | // No path qualification to test compiler include dir specification. 6 | #include "header.h" 7 | 8 | int main() { 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /dep/gyp/test/win/compiler-flags/character-set-mbcs.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef _MBCS 6 | #error 7 | #endif 8 | 9 | int main() { 10 | return 0; 11 | } 12 | -------------------------------------------------------------------------------- /dep/gyp/test/win/compiler-flags/character-set-unicode.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef _UNICODE 6 | #error 7 | #endif 8 | 9 | #ifndef UNICODE 10 | #error 11 | #endif 12 | 13 | int main() { 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /dep/gyp/test/win/compiler-flags/force-include-files.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | int main() { 6 | std::list > l; 7 | return 0; 8 | } 9 | -------------------------------------------------------------------------------- /dep/gyp/test/win/compiler-flags/function-level-linking.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | int comdat_function() { 6 | return 1; 7 | } 8 | 9 | int main() { 10 | return 0; 11 | } 12 | -------------------------------------------------------------------------------- /dep/gyp/test/win/compiler-flags/hello.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | int main() { 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /dep/gyp/test/win/compiler-flags/pdbname.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | int some_function() { 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /dep/gyp/test/win/compiler-flags/rtti-on.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef _CPPRTTI 6 | #error 7 | #endif 8 | 9 | int main() { 10 | return 0; 11 | } 12 | -------------------------------------------------------------------------------- /dep/gyp/test/win/compiler-flags/runtime-checks.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef __MSVC_RUNTIME_CHECKS 6 | #error 7 | #endif 8 | 9 | int main() { 10 | return 0; 11 | } 12 | -------------------------------------------------------------------------------- /dep/gyp/test/win/compiler-flags/subdir/header.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munificent/magpie/f5138e3d316ec1a664b5eadba1bcc8573d3faca3/dep/gyp/test/win/compiler-flags/subdir/header.h -------------------------------------------------------------------------------- /dep/gyp/test/win/compiler-flags/treat-wchar-t-as-built-in-type1.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifdef _NATIVE_WCHAR_T_DEFINED 6 | #error 7 | #endif 8 | 9 | int main() { 10 | return 0; 11 | } 12 | -------------------------------------------------------------------------------- /dep/gyp/test/win/compiler-flags/treat-wchar-t-as-built-in-type2.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #ifndef _NATIVE_WCHAR_T_DEFINED 6 | #error 7 | #endif 8 | 9 | int main() { 10 | return 0; 11 | } 12 | -------------------------------------------------------------------------------- /dep/gyp/test/win/compiler-flags/warning-as-error.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | int main() { 6 | // Cause a warning, even at /W1 7 | int export; 8 | return 0; 9 | } 10 | -------------------------------------------------------------------------------- /dep/gyp/test/win/compiler-flags/warning-level1.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | int main() { 6 | int export; // Cause a level 1 warning (C4237). 7 | return 0; 8 | } 9 | -------------------------------------------------------------------------------- /dep/gyp/test/win/compiler-flags/warning-level4.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | int main() { 6 | const int i = -1; 7 | // Cause a level 4 warning (C4245). 8 | unsigned int j = i; 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /dep/gyp/test/win/importlib/has-exports.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | __declspec(dllexport) void some_function() { 6 | } 7 | 8 | int main() { 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /dep/gyp/test/win/importlib/hello.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | __declspec(dllimport) void some_function(); 6 | 7 | int main() { 8 | some_function(); 9 | } 10 | -------------------------------------------------------------------------------- /dep/gyp/test/win/lib-flags/answer.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include "answer.h" 6 | 7 | int answer() { 8 | return 42; 9 | } 10 | -------------------------------------------------------------------------------- /dep/gyp/test/win/lib-flags/answer.h: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | int answer(); -------------------------------------------------------------------------------- /dep/gyp/test/win/linker-flags/additional-deps.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include 6 | 7 | int main() { 8 | WSAStartup(0, 0); 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /dep/gyp/test/win/linker-flags/deffile.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | void AnExportedFunction() { 6 | } 7 | 8 | int main() { 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /dep/gyp/test/win/linker-flags/deffile.def: -------------------------------------------------------------------------------- 1 | ; Copyright (c) 2012 Google Inc. All rights reserved. 2 | ; Use of this source code is governed by a BSD-style license that can be 3 | ; found in the LICENSE file. 4 | 5 | LIBRARY test_deffile_ok 6 | 7 | EXPORTS 8 | AnExportedFunction 9 | -------------------------------------------------------------------------------- /dep/gyp/test/win/linker-flags/delay-load.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include 6 | 7 | int main() { 8 | SHCreateDirectory(0, 0); 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /dep/gyp/test/win/linker-flags/hello.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | int main() { 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /dep/gyp/test/win/linker-flags/library-adjust.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include 6 | 7 | int main() { 8 | WSAStartup(0, 0); 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /dep/gyp/test/win/linker-flags/library-directories-define.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | int library_function() { 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /dep/gyp/test/win/linker-flags/library-directories-reference.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | extern int library_function(); 6 | 7 | int main() { 8 | library_function(); 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /dep/gyp/test/win/linker-flags/opt-ref.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | int unused_function() { 6 | return 0; 7 | } 8 | 9 | int main() { 10 | return 0; 11 | } 12 | -------------------------------------------------------------------------------- /dep/gyp/test/win/linker-flags/subsystem-windows.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | #include 6 | 7 | int CALLBACK WinMain(HINSTANCE, HINSTANCE, LPSTR, int) { 8 | return 0; 9 | } 10 | -------------------------------------------------------------------------------- /dep/gyp/test/win/long-command-line/function.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | int func() { 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /dep/gyp/test/win/long-command-line/hello.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | int main() { 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /dep/gyp/test/win/precompiled/precomp.c: -------------------------------------------------------------------------------- 1 | /* Copyright (c) 2011 Google Inc. All rights reserved. 2 | * Use of this source code is governed by a BSD-style license that can be 3 | * found in the LICENSE file. */ 4 | 5 | // The precompiled header does not have to be the first one in the file. 6 | 7 | #include 8 | #include 9 | -------------------------------------------------------------------------------- /dep/gyp/test/win/rc-build/hello.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "resource.h" 4 | -------------------------------------------------------------------------------- /dep/gyp/test/win/rc-build/hello.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munificent/magpie/f5138e3d316ec1a664b5eadba1bcc8573d3faca3/dep/gyp/test/win/rc-build/hello.ico -------------------------------------------------------------------------------- /dep/gyp/test/win/rc-build/small.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munificent/magpie/f5138e3d316ec1a664b5eadba1bcc8573d3faca3/dep/gyp/test/win/rc-build/small.ico -------------------------------------------------------------------------------- /dep/gyp/test/win/rc-build/subdir/include.h: -------------------------------------------------------------------------------- 1 | // Just exists to make sure it can be included. 2 | -------------------------------------------------------------------------------- /dep/gyp/test/win/uldi/a.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | int some_function() { 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /dep/gyp/test/win/uldi/b.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | int some_function() { 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /dep/gyp/test/win/uldi/main.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | extern int some_function(); 6 | 7 | int main() { 8 | some_function(); 9 | return 0; 10 | } 11 | -------------------------------------------------------------------------------- /dep/gyp/test/win/vs-macros/do_stuff.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012 Google Inc. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | import sys 6 | 7 | input = open(sys.argv[1], "r").read() 8 | open(sys.argv[2], "w").write(input + "Modified.") 9 | -------------------------------------------------------------------------------- /dep/gyp/test/win/vs-macros/hello.cc: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2012 Google Inc. All rights reserved. 2 | // Use of this source code is governed by a BSD-style license that can be 3 | // found in the LICENSE file. 4 | 5 | int main() { 6 | return 0; 7 | } 8 | -------------------------------------------------------------------------------- /dep/gyp/test/win/vs-macros/input.S: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munificent/magpie/f5138e3d316ec1a664b5eadba1bcc8573d3faca3/dep/gyp/test/win/vs-macros/input.S -------------------------------------------------------------------------------- /dep/gyp/test/win/vs-macros/stuff.blah: -------------------------------------------------------------------------------- 1 | Random data file. 2 | -------------------------------------------------------------------------------- /dep/gyp/test/win/vs-macros/test_exists.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2012 Google Inc. All rights reserved. 2 | # Use of this source code is governed by a BSD-style license that can be 3 | # found in the LICENSE file. 4 | 5 | import os 6 | import sys 7 | 8 | if not os.path.exists(sys.argv[1]): 9 | raise 10 | open(sys.argv[2], 'w').close() 11 | -------------------------------------------------------------------------------- /dep/gyp/tools/Xcode/README: -------------------------------------------------------------------------------- 1 | Specifications contains syntax formatters for Xcode 3. These do not appear to be supported yet on Xcode 4. To use these with Xcode 3 please install both the gyp.pbfilespec and gyp.xclangspec files in 2 | 3 | ~/Library/Application Support/Developer/Shared/Xcode/Specifications/ 4 | 5 | and restart Xcode. -------------------------------------------------------------------------------- /dep/gyp/tools/emacs/run-unit-tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Copyright (c) 2012 Google Inc. All rights reserved. 3 | # Use of this source code is governed by a BSD-style license that can be 4 | # found in the LICENSE file. 5 | emacs --no-site-file --no-init-file --batch \ 6 | --load ert.el --load gyp.el --load gyp-tests.el \ 7 | -f ert-run-tests-batch-and-exit 8 | -------------------------------------------------------------------------------- /dep/libuv/.travis.yml: -------------------------------------------------------------------------------- 1 | language: node_js 2 | 3 | script: 4 | - "make test" 5 | 6 | notifications: 7 | email: false 8 | irc: 9 | - "irc.freenode.net#libuv" 10 | -------------------------------------------------------------------------------- /dep/libuv/src/win/fs.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munificent/magpie/f5138e3d316ec1a664b5eadba1bcc8573d3faca3/dep/libuv/src/win/fs.c -------------------------------------------------------------------------------- /dep/libuv/test/fixtures/empty_file: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munificent/magpie/f5138e3d316ec1a664b5eadba1bcc8573d3faca3/dep/libuv/test/fixtures/empty_file -------------------------------------------------------------------------------- /dep/libuv/test/fixtures/load_error.node: -------------------------------------------------------------------------------- 1 | foobar 2 | -------------------------------------------------------------------------------- /doc/scratchpad/precedence.txt: -------------------------------------------------------------------------------- 1 | 10 call, message, with 2 | 90 not, unary negate 3 | 80 * / % 4 | 70 + - 5 | 60 ~ concatenate 6 | 50 and or 7 | 40 < > <= >= 8 | 30 == != 9 | 20 tuple, record 10 | 10 assignment 11 | -------------------------------------------------------------------------------- /doc/site/design/Comp 7.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munificent/magpie/f5138e3d316ec1a664b5eadba1bcc8573d3faca3/doc/site/design/Comp 7.psd -------------------------------------------------------------------------------- /doc/site/magpie/Magpie.egg-info/PKG-INFO: -------------------------------------------------------------------------------- 1 | Metadata-Version: 1.0 2 | Name: Magpie 3 | Version: 1.0 4 | Summary: 5 | A Pygments lexer for Magpie. 6 | 7 | Home-page: UNKNOWN 8 | Author: Robert Nystrom 9 | Author-email: UNKNOWN 10 | License: UNKNOWN 11 | Description: UNKNOWN 12 | Platform: UNKNOWN 13 | -------------------------------------------------------------------------------- /doc/site/magpie/Magpie.egg-info/SOURCES.txt: -------------------------------------------------------------------------------- 1 | setup.py 2 | Magpie.egg-info/PKG-INFO 3 | Magpie.egg-info/SOURCES.txt 4 | Magpie.egg-info/dependency_links.txt 5 | Magpie.egg-info/entry_points.txt 6 | Magpie.egg-info/top_level.txt 7 | magpie/__init__.py -------------------------------------------------------------------------------- /doc/site/magpie/Magpie.egg-info/dependency_links.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /doc/site/magpie/Magpie.egg-info/entry_points.txt: -------------------------------------------------------------------------------- 1 | 2 | [pygments.lexers] 3 | magpielexer = magpie:MagpieLexer 4 | -------------------------------------------------------------------------------- /doc/site/magpie/Magpie.egg-info/top_level.txt: -------------------------------------------------------------------------------- 1 | magpie 2 | -------------------------------------------------------------------------------- /doc/site/markdown/concurrency.md: -------------------------------------------------------------------------------- 1 | ^title Concurrency 2 | 3 | **TODO** -------------------------------------------------------------------------------- /doc/site/markdown/internals.md: -------------------------------------------------------------------------------- 1 | ^title Internals 2 | 3 |

To do...

-------------------------------------------------------------------------------- /doc/site/markdown/pragmatics.md: -------------------------------------------------------------------------------- 1 | ^title Pragmatics 2 | 3 | **TODO** -------------------------------------------------------------------------------- /doc/site/markdown/top-level-definitions.md: -------------------------------------------------------------------------------- 1 | ^title Top-Level Definitions 2 | 3 | **TODO: Explain mutual recursion, and accessing undefined top-level variables.** -------------------------------------------------------------------------------- /doc/site/markdown/tutorial.md: -------------------------------------------------------------------------------- 1 | ^title Tutorial 2 | 3 | If this is your first time looking at Magpie (and let's be honest, it probably is), this little tutorial will walk you gently through its garden of features. Before we get started, make sure you've got Magpie [installed and running](index.html). 4 | 5 | **TODO** -------------------------------------------------------------------------------- /doc/site/static/background.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/munificent/magpie/f5138e3d316ec1a664b5eadba1bcc8573d3faca3/doc/site/static/background.gif -------------------------------------------------------------------------------- /example/Channel.mag: -------------------------------------------------------------------------------- 1 | var channel = Channel make 2 | 3 | fn() 4 | print("Started fiber") 5 | print(channel) 6 | channel send("value!") 7 | print("Ending fiber") 8 | end run 9 | 10 | print("Created fiber") 11 | print(channel) 12 | 13 | var value = channel receive 14 | print("Received " + value) 15 | -------------------------------------------------------------------------------- /example/fibers.mag: -------------------------------------------------------------------------------- 1 | print("Top") 2 | 3 | for i in [1, 2, 3, 4] do 4 | fn() 5 | print("In function") 6 | end run 7 | end 8 | 9 | print("Bottom") 10 | -------------------------------------------------------------------------------- /example/hello.mag: -------------------------------------------------------------------------------- 1 | // Doesn't get much simpler than this! 2 | print("Hello, world!") -------------------------------------------------------------------------------- /example/tcp.mag: -------------------------------------------------------------------------------- 1 | import net 2 | 3 | print("Listening on port 8124") 4 | 5 | TcpListener new("0.0.0.0", 8124) as stream do 6 | print("Got connection") 7 | for data in stream do print(data) 8 | end 9 | 10 | print("Done listening") 11 | -------------------------------------------------------------------------------- /example/temp.mag: -------------------------------------------------------------------------------- 1 | import magpie.lexer 2 | 3 | var lexer = Lexer new("()()[]][") 4 | 5 | for i in 1..5 do print(lexer readToken) 6 | -------------------------------------------------------------------------------- /lib/README: -------------------------------------------------------------------------------- 1 | This directory contains the Magpie "standard library". When a module is 2 | imported, it will look for it starting in the current working directory (i.e 3 | the directory of the initial Magpie script that is being executed). If not 4 | found there, it will look here. -------------------------------------------------------------------------------- /lib/process.mag: -------------------------------------------------------------------------------- 1 | import classfile:com.stuffwithstuff.magpie.intrinsic.ProcessMethods 2 | 3 | def executeOutput(command is String) 4 | /// Executes the given command in a new process and returns the output. 5 | val out: output = execute(command) 6 | output 7 | end -------------------------------------------------------------------------------- /lib/reflection.mag: -------------------------------------------------------------------------------- 1 | def showDoc 2 | /// Displays the documentation for the given argument. 3 | end 4 | 5 | import classfile:com.stuffwithstuff.magpie.intrinsic.ReflectionMethods 6 | -------------------------------------------------------------------------------- /magpie.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /magpie.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /run_gyp: -------------------------------------------------------------------------------- 1 | ./dep/gyp/gyp --depth=1 -Dlibrary=static_library -Icommon.gypi -------------------------------------------------------------------------------- /run_gyp.bat: -------------------------------------------------------------------------------- 1 | .\dep\gyp\gyp --depth=1 -Dlibrary=static_library -Dtarget_arch=%1 -Icommon.gypi 2 | -------------------------------------------------------------------------------- /spec/_init.mag: -------------------------------------------------------------------------------- 1 | // The test infrastructure. 2 | import spec.specify 3 | 4 | // The individual test cases. 5 | import spec.language 6 | import spec.lib 7 | 8 | runTests() 9 | -------------------------------------------------------------------------------- /spec/language/import_test.mag: -------------------------------------------------------------------------------- 1 | val a = "a" 2 | 3 | // TODO(bob): Module-local top-level multimethods aren't implemented yet. 4 | /* 5 | def b() 6 | "b" 7 | end 8 | */ -------------------------------------------------------------------------------- /spec/language/import_test_a.mag: -------------------------------------------------------------------------------- 1 | def foo("a") 2 | "in a" 3 | end 4 | -------------------------------------------------------------------------------- /spec/language/import_test_b.mag: -------------------------------------------------------------------------------- 1 | def foo("b") 2 | "in b" 3 | end 4 | -------------------------------------------------------------------------------- /spec/language/import_test_c.mag: -------------------------------------------------------------------------------- 1 | def overridable("c") 2 | "in c" 3 | end 4 | 5 | def callsOverridable(arg) 6 | overridable(arg) 7 | end 8 | -------------------------------------------------------------------------------- /spec/language/import_test_d.mag: -------------------------------------------------------------------------------- 1 | import spec.language.import_test_c 2 | 3 | def overridable("d") 4 | "in d" 5 | end 6 | -------------------------------------------------------------------------------- /spec/lib/io/test_dir/a.txt: -------------------------------------------------------------------------------- 1 | one 2 | two 3 | three -------------------------------------------------------------------------------- /spec/lib/io/test_dir/b.txt: -------------------------------------------------------------------------------- 1 | one 2 | two 3 | three -------------------------------------------------------------------------------- /spec/lib/io/test_dir/test_subdir/a.txt: -------------------------------------------------------------------------------- 1 | one 2 | two 3 | three -------------------------------------------------------------------------------- /spec/lib/io/test_file.txt: -------------------------------------------------------------------------------- 1 | one 2 | two 3 | three -------------------------------------------------------------------------------- /spec/lib/magpie/core/Bool.mag: -------------------------------------------------------------------------------- 1 | import spec.specify 2 | 3 | specifyMethod("(this is Bool) not") with 4 | it should("negate") with 5 | not(true) shouldEqual(false) 6 | not(false) shouldEqual(true) 7 | end 8 | end -------------------------------------------------------------------------------- /spec/lib/magpie/core/Class.mag: -------------------------------------------------------------------------------- 1 | import spec.specify 2 | 3 | specifyMethod("(this is Class) name") with 4 | it should("return the name of the class") with 5 | Int name shouldEqual("Int") 6 | String name shouldEqual("String") 7 | defclass Foo 8 | end 9 | Foo name shouldEqual("Foo") 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /spec/lib/magpie/syntax/lexer.mag: -------------------------------------------------------------------------------- 1 | import spec.specify 2 | import magpie.syntax 3 | import magpie.syntax.lexer 4 | 5 | // TODO(bob): Spec! -------------------------------------------------------------------------------- /src/.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /src/Native/Core.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Common.h" 4 | #include "Memory/Memory.h" 5 | #include "Memory/RootSource.h" 6 | #include "VM/Fiber.h" 7 | #include "VM/Method.h" 8 | 9 | namespace magpie 10 | { 11 | void defineCoreNatives(VM& vm); 12 | } 13 | 14 | -------------------------------------------------------------------------------- /src/Test/LexerTests.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Test.h" 4 | 5 | namespace magpie 6 | { 7 | class LexerTests : public Test 8 | { 9 | public: 10 | virtual void runTests(); 11 | 12 | private: 13 | void create(); 14 | void stringLiteral(); 15 | }; 16 | } 17 | 18 | -------------------------------------------------------------------------------- /src/Test/MemoryTests.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Test.h" 4 | 5 | namespace magpie 6 | { 7 | class MemoryTests : public Test 8 | { 9 | public: 10 | virtual void runTests(); 11 | 12 | private: 13 | void collect(); 14 | }; 15 | } 16 | 17 | -------------------------------------------------------------------------------- /src/Test/ParserTests.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Test.h" 4 | 5 | namespace magpie 6 | { 7 | class ParserTests : public Test 8 | { 9 | public: 10 | virtual void runTests(); 11 | 12 | private: 13 | void parseModule(); 14 | }; 15 | } 16 | 17 | -------------------------------------------------------------------------------- /src/Test/StringTests.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Test.h" 4 | 5 | namespace magpie 6 | { 7 | class StringTests : public Test 8 | { 9 | public: 10 | virtual void runTests(); 11 | 12 | private: 13 | void create(); 14 | void concat(); 15 | void subscript(); 16 | void equals(); 17 | void substring(); 18 | }; 19 | } 20 | 21 | -------------------------------------------------------------------------------- /src/Test/TokenTests.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "Test.h" 4 | 5 | namespace magpie 6 | { 7 | class TokenTests : public Test 8 | { 9 | public: 10 | virtual void runTests(); 11 | 12 | private: 13 | void create(); 14 | void is(); 15 | }; 16 | } 17 | 18 | -------------------------------------------------------------------------------- /src/com/stuffwithstuff/magpie/Def.java: -------------------------------------------------------------------------------- 1 | package com.stuffwithstuff.magpie; 2 | 3 | import java.lang.annotation.*; 4 | 5 | @Retention(RetentionPolicy.RUNTIME) 6 | @Target(ElementType.TYPE) 7 | public @interface Def { 8 | String value(); 9 | } 10 | -------------------------------------------------------------------------------- /src/com/stuffwithstuff/magpie/Doc.java: -------------------------------------------------------------------------------- 1 | package com.stuffwithstuff.magpie; 2 | 3 | import java.lang.annotation.*; 4 | 5 | @Retention(RetentionPolicy.RUNTIME) 6 | @Target(ElementType.TYPE) 7 | public @interface Doc { 8 | String value(); 9 | } 10 | -------------------------------------------------------------------------------- /src/com/stuffwithstuff/magpie/MagpieHost.java: -------------------------------------------------------------------------------- 1 | package com.stuffwithstuff.magpie; 2 | 3 | public interface MagpieHost { 4 | SourceFile loadModule(String name); 5 | void showSyntaxError(String message); 6 | } 7 | -------------------------------------------------------------------------------- /src/com/stuffwithstuff/magpie/Method.java: -------------------------------------------------------------------------------- 1 | package com.stuffwithstuff.magpie; 2 | 3 | public interface Method { 4 | Object call(Object left, Object right); 5 | } 6 | -------------------------------------------------------------------------------- /src/com/stuffwithstuff/magpie/app/QuitException.java: -------------------------------------------------------------------------------- 1 | package com.stuffwithstuff.magpie.app; 2 | 3 | /** 4 | * This exception is thrown by the "quit" built-in function to unwind the 5 | * entire evaluation stack and exit the interpreter. 6 | */ 7 | @SuppressWarnings("serial") 8 | public class QuitException extends RuntimeException { 9 | } -------------------------------------------------------------------------------- /src/com/stuffwithstuff/magpie/interpreter/InterpreterException.java: -------------------------------------------------------------------------------- 1 | package com.stuffwithstuff.magpie.interpreter; 2 | 3 | @SuppressWarnings("serial") 4 | public class InterpreterException extends RuntimeException { 5 | public InterpreterException(String message) { 6 | super(message); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /src/com/stuffwithstuff/magpie/intrinsic/Intrinsic.java: -------------------------------------------------------------------------------- 1 | package com.stuffwithstuff.magpie.intrinsic; 2 | 3 | import com.stuffwithstuff.magpie.interpreter.Context; 4 | import com.stuffwithstuff.magpie.interpreter.Obj; 5 | 6 | public interface Intrinsic { 7 | Obj invoke(Context context, Obj left, Obj right); 8 | } 9 | -------------------------------------------------------------------------------- /src/com/stuffwithstuff/magpie/parser/InfixParser.java: -------------------------------------------------------------------------------- 1 | package com.stuffwithstuff.magpie.parser; 2 | 3 | import com.stuffwithstuff.magpie.ast.Expr; 4 | 5 | public interface InfixParser { 6 | Expr parse(MagpieParser parser, Expr left, Token token); 7 | int getPrecedence(); 8 | } 9 | -------------------------------------------------------------------------------- /src/com/stuffwithstuff/magpie/parser/PrefixParser.java: -------------------------------------------------------------------------------- 1 | package com.stuffwithstuff.magpie.parser; 2 | 3 | import com.stuffwithstuff.magpie.ast.Expr; 4 | 5 | public interface PrefixParser { 6 | Expr parse(MagpieParser parser, Token token); 7 | } 8 | -------------------------------------------------------------------------------- /src/com/stuffwithstuff/magpie/parser/TokenReader.java: -------------------------------------------------------------------------------- 1 | package com.stuffwithstuff.magpie.parser; 2 | 3 | /** 4 | * Defines a source of characters that a Lexer can read from. Used to abstract 5 | * whether the Lexer is reading from a file, or from the REPL. 6 | */ 7 | public interface TokenReader { 8 | Token readToken(); 9 | } 10 | -------------------------------------------------------------------------------- /test/and/eof.mag: -------------------------------------------------------------------------------- 1 | false and // expect error -------------------------------------------------------------------------------- /test/and/eof_with_newline.mag: -------------------------------------------------------------------------------- 1 | false and 2 | // expect error -------------------------------------------------------------------------------- /test/async/end_when_main_fiber_ends.mag: -------------------------------------------------------------------------------- 1 | // Stops when the main fiber is done, even if there are other fibers that can 2 | // run. 3 | 4 | val result = [] 5 | 6 | async 7 | result add("in spawned") 8 | end 9 | 10 | result add("in main") 11 | 12 | print(result join("\n")) // expect: in main 13 | -------------------------------------------------------------------------------- /test/async/return.mag: -------------------------------------------------------------------------------- 1 | var channel = Channel new 2 | 3 | async 4 | print("before") // expect: before 5 | return 6 | print("after") 7 | end 8 | 9 | async channel send("done") 10 | 11 | print(channel receive) // expect: done 12 | -------------------------------------------------------------------------------- /test/bools/class.mag: -------------------------------------------------------------------------------- 1 | print(true is Bool) // expect: true 2 | print(true class == Bool) // expect: true 3 | -------------------------------------------------------------------------------- /test/bools/to_string.mag: -------------------------------------------------------------------------------- 1 | print(true toString == "true") // expect: true 2 | print(false toString == "false") // expect: true 3 | -------------------------------------------------------------------------------- /test/calls/left_argument.mag: -------------------------------------------------------------------------------- 1 | // Method with left parameter. 2 | def (n) foo 3 | print("left") 4 | print(n) 5 | end 6 | 7 | "arg" foo // expect: left 8 | // expect: arg 9 | -------------------------------------------------------------------------------- /test/calls/nested_param.mag: -------------------------------------------------------------------------------- 1 | def foo(a, b (c (d, e), f)) 2 | print(a) 3 | print(b) 4 | print(c) 5 | print(d) 6 | print(e) 7 | print(f) 8 | end 9 | 10 | foo(1, ((2, 3), 4)) 11 | // expect: 1 12 | // expect: ((2, 3), 4) 13 | // expect: (2, 3) 14 | // expect: 2 15 | // expect: 3 16 | // expect: 4 17 | -------------------------------------------------------------------------------- /test/calls/no_arguments.mag: -------------------------------------------------------------------------------- 1 | // Method with no parameter on either side. 2 | def foo() 3 | print("no params") 4 | end 5 | 6 | // Call with no argument. 7 | foo() // expect: no params 8 | -------------------------------------------------------------------------------- /test/calls/right_argument.mag: -------------------------------------------------------------------------------- 1 | // Method with right parameter. 2 | def foo(n) 3 | print("right") 4 | print(n) 5 | end 6 | 7 | // Call with explicit nothing argument. 8 | foo(nothing) // expect: right 9 | // expect: nothing 10 | 11 | // Call with right argument. 12 | foo("arg") // expect: right 13 | // expect: arg 14 | -------------------------------------------------------------------------------- /test/calls/unknown_method.mag: -------------------------------------------------------------------------------- 1 | foop() // expect error -------------------------------------------------------------------------------- /test/calls/unknown_signature.mag: -------------------------------------------------------------------------------- 1 | def (a) foo(b) 2 | print("bad") 3 | end 4 | 5 | // Right method name, but wrong signature. Missing left arg. 6 | foo("arg") // expect error -------------------------------------------------------------------------------- /test/channel/new.mag: -------------------------------------------------------------------------------- 1 | val channel = Channel new 2 | print(channel class) // expect: Channel 3 | print(channel is Channel) // expect: true 4 | print(channel isOpen) // expect: true 5 | -------------------------------------------------------------------------------- /test/channel/two_blocked_senders.mag: -------------------------------------------------------------------------------- 1 | val channel = Channel new 2 | 3 | async channel send("a") 4 | async channel send("b") 5 | 6 | print(channel receive) // expect: a 7 | print(channel receive) // expect: b 8 | print("done") // expect: done 9 | -------------------------------------------------------------------------------- /test/char/class.mag: -------------------------------------------------------------------------------- 1 | print('a' is Char) // expect: true 2 | print('a' class == Char) // expect: true 3 | -------------------------------------------------------------------------------- /test/char/literal.mag: -------------------------------------------------------------------------------- 1 | // TODO(bob): Non-printing characters, Unicode, escapes, etc. 2 | 3 | print('a') // expect: a 4 | print('Z') // expect: Z 5 | -------------------------------------------------------------------------------- /test/char/to_string.mag: -------------------------------------------------------------------------------- 1 | // TODO(bob): Non-printing characters, Unicode, escapes, etc. 2 | 3 | print('a' toString == "a") // expect: true 4 | print('Z' toString == "Z") // expect: true 5 | -------------------------------------------------------------------------------- /test/classes/class_with_no_fields.mag: -------------------------------------------------------------------------------- 1 | defclass Foo 2 | end 3 | 4 | print(Foo) // expect: Foo 5 | -------------------------------------------------------------------------------- /test/classes/classes_are_first_class.mag: -------------------------------------------------------------------------------- 1 | defclass Foo 2 | end 3 | 4 | var foo = Foo 5 | print(foo new is Foo) // expect: true 6 | -------------------------------------------------------------------------------- /test/classes/field/no_literal_pattern.mag: -------------------------------------------------------------------------------- 1 | defclass Foo 2 | var a 123 // expect error 3 | end 4 | -------------------------------------------------------------------------------- /test/classes/field/no_value_pattern.mag: -------------------------------------------------------------------------------- 1 | defclass Foo 2 | var a == 123 // expect error 3 | end 4 | -------------------------------------------------------------------------------- /test/classes/field/no_variable_pattern.mag: -------------------------------------------------------------------------------- 1 | defclass Foo 2 | var a blah // expect error 3 | end 4 | -------------------------------------------------------------------------------- /test/classes/field_getters.mag: -------------------------------------------------------------------------------- 1 | defclass Foo 2 | var a 3 | var b 4 | end 5 | 6 | var foo = Foo new(a: 1, b: 2) 7 | print(foo a) // expect: 1 8 | print(foo b) // expect: 2 9 | 10 | foo = Foo new(a: 3, b: 4) 11 | print(foo a) // expect: 3 12 | print(foo b) // expect: 4 13 | -------------------------------------------------------------------------------- /test/classes/field_setter_modifies_object.mag: -------------------------------------------------------------------------------- 1 | defclass Foo 2 | var a 3 | var b 4 | end 5 | 6 | var foo = Foo new(a: 1, b: 2) 7 | print(foo a) // expect: 1 8 | print(foo b) // expect: 2 9 | 10 | foo a = 3 11 | foo b = 4 12 | print(foo a) // expect: 3 13 | print(foo b) // expect: 4 14 | -------------------------------------------------------------------------------- /test/classes/field_setter_returns_value.mag: -------------------------------------------------------------------------------- 1 | defclass Foo 2 | var a 3 | var b 4 | end 5 | 6 | var foo = Foo new(a: 1, b: 2) 7 | print(foo a = 3) // expect: 3 8 | -------------------------------------------------------------------------------- /test/classes/immutable_fields_cannot_be_set.mag: -------------------------------------------------------------------------------- 1 | defclass Foo 2 | val a 3 | var b 4 | end 5 | 6 | var foo = Foo new(a: 1, b: 2) 7 | // TODO(bob): Should this assume a compile error or a runtime one? It will turn 8 | // into a runtime error if any other type anywhere defines a setter named "a". 9 | foo a = 2 // expect error 10 | -------------------------------------------------------------------------------- /test/classes/new.mag: -------------------------------------------------------------------------------- 1 | defclass Foo 2 | end 3 | 4 | defclass Bar 5 | end 6 | 7 | print(Foo new is Foo) // expect: true 8 | print(Foo new class == Foo) // expect: true 9 | print(Bar new is Bar) // expect: true 10 | print(Bar new class == Bar) // expect: true 11 | -------------------------------------------------------------------------------- /test/classes/new_requires_all_fields.mag: -------------------------------------------------------------------------------- 1 | defclass Foo 2 | var a 3 | var b 4 | end 5 | 6 | Foo new // expect error 7 | Foo new(a: 1) // expect error 8 | Foo new(b: 1) // expect error 9 | -------------------------------------------------------------------------------- /test/classes/new_requires_fields_in_order.mag: -------------------------------------------------------------------------------- 1 | defclass Foo 2 | var a 3 | var b 4 | end 5 | 6 | var foo = Foo new(b: 1, a: 2) // expect error 7 | -------------------------------------------------------------------------------- /test/classes/new_with_fields.mag: -------------------------------------------------------------------------------- 1 | defclass Foo 2 | var a 3 | var b 4 | end 5 | 6 | var foo = Foo new(a: 1, b: 2) 7 | print(foo is Foo) // expect: true 8 | -------------------------------------------------------------------------------- /test/classes/superclass/no_literal.mag: -------------------------------------------------------------------------------- 1 | defclass Foo is 123 // expect error 2 | end 3 | -------------------------------------------------------------------------------- /test/classes/superclass/no_method_call.mag: -------------------------------------------------------------------------------- 1 | defclass Foo is print() // expect error 2 | end 3 | -------------------------------------------------------------------------------- /test/comments/block.mag: -------------------------------------------------------------------------------- 1 | // In middle of line. 2 | print/* ... */(/* */"ok"/* */) // expect: ok 3 | 4 | // Nested. 5 | print(/* in /* nest */ out */"ok") // expect: ok 6 | -------------------------------------------------------------------------------- /test/comments/block_at_end_of_file.mag: -------------------------------------------------------------------------------- 1 | print("ok") // expect: ok 2 | /* comment */ -------------------------------------------------------------------------------- /test/comments/line_at_end_of_file.mag: -------------------------------------------------------------------------------- 1 | print("ok") // expect: ok 2 | // comment -------------------------------------------------------------------------------- /test/definition_order/field_initializer/class/construct_defclass_field.mag: -------------------------------------------------------------------------------- 1 | // skip: Field initializers are not implemented yet. 2 | var foo = Foo new // expect exit 3 3 | 4 | defclass Bar 5 | end 6 | 7 | defclass Foo 8 | var bar = Bar 9 | end 10 | -------------------------------------------------------------------------------- /test/definition_order/field_initializer/class/construct_field_defclass.mag: -------------------------------------------------------------------------------- 1 | // skip: Field initializers are not implemented yet. 2 | var foo = Foo new // expect exit 3 3 | 4 | defclass Foo 5 | var bar = Bar 6 | end 7 | 8 | defclass Bar 9 | end 10 | -------------------------------------------------------------------------------- /test/definition_order/field_initializer/class/defclass_construct_field.mag: -------------------------------------------------------------------------------- 1 | // skip: Field initializers are not implemented yet. 2 | defclass Bar 3 | end 4 | 5 | var foo = Foo new // expect exit 3 6 | 7 | defclass Foo 8 | var bar = Bar 9 | end 10 | 11 | -------------------------------------------------------------------------------- /test/definition_order/field_initializer/class/defclass_field_construct.mag: -------------------------------------------------------------------------------- 1 | // skip: Field initializers are not implemented yet. 2 | defclass Bar 3 | end 4 | 5 | defclass Foo 6 | var bar = Bar 7 | end 8 | 9 | var foo = Foo new 10 | print(foo bar == Bar) // expect: true 11 | -------------------------------------------------------------------------------- /test/definition_order/field_initializer/class/field_construct_defclass.mag: -------------------------------------------------------------------------------- 1 | // skip: Field initializers are not implemented yet. 2 | defclass Foo 3 | var bar = Bar 4 | end 5 | 6 | var foo = Foo new // expect exit 3 7 | 8 | defclass Bar 9 | end 10 | -------------------------------------------------------------------------------- /test/definition_order/field_initializer/class/field_defclass_construct.mag: -------------------------------------------------------------------------------- 1 | // skip: Field initializers are not implemented yet. 2 | defclass Foo 3 | var bar = Bar 4 | end 5 | 6 | defclass Bar 7 | end 8 | 9 | var foo = Foo new 10 | print(foo bar == Bar) // expect: true 11 | -------------------------------------------------------------------------------- /test/definition_order/field_initializer/class_constructor/construct_defclass_field.mag: -------------------------------------------------------------------------------- 1 | // skip: Field initializers are not implemented yet. 2 | var foo = Foo new // expect exit 3 3 | 4 | defclass Bar 5 | end 6 | 7 | defclass Foo 8 | var bar = Bar new 9 | end 10 | -------------------------------------------------------------------------------- /test/definition_order/field_initializer/class_constructor/construct_field_defclass.mag: -------------------------------------------------------------------------------- 1 | // skip: Field initializers are not implemented yet. 2 | var foo = Foo new // expect exit 3 3 | 4 | defclass Foo 5 | var bar = Bar new 6 | end 7 | 8 | defclass Bar 9 | end 10 | -------------------------------------------------------------------------------- /test/definition_order/field_initializer/class_constructor/defclass_construct_field.mag: -------------------------------------------------------------------------------- 1 | // skip: Field initializers are not implemented yet. 2 | defclass Bar 3 | end 4 | 5 | var foo = Foo new // expect exit 3 6 | 7 | defclass Foo 8 | var bar = Bar new 9 | end 10 | 11 | -------------------------------------------------------------------------------- /test/definition_order/field_initializer/class_constructor/defclass_field_construct.mag: -------------------------------------------------------------------------------- 1 | // skip: Field initializers are not implemented yet. 2 | defclass Bar 3 | end 4 | 5 | defclass Foo 6 | var bar = Bar new 7 | end 8 | 9 | var foo = Foo new 10 | print(foo bar is Bar) // expect: true 11 | -------------------------------------------------------------------------------- /test/definition_order/field_initializer/class_constructor/field_construct_defclass.mag: -------------------------------------------------------------------------------- 1 | // skip: Field initializers are not implemented yet. 2 | defclass Foo 3 | var bar = Bar new 4 | end 5 | 6 | var foo = Foo new // expect exit 3 7 | 8 | defclass Bar 9 | end 10 | -------------------------------------------------------------------------------- /test/definition_order/field_initializer/class_constructor/field_defclass_construct.mag: -------------------------------------------------------------------------------- 1 | // skip: Field initializers are not implemented yet. 2 | defclass Foo 3 | var bar = Bar new 4 | end 5 | 6 | defclass Bar 7 | end 8 | 9 | var foo = Foo new 10 | print(foo bar is Bar) // expect: true 11 | -------------------------------------------------------------------------------- /test/definition_order/field_initializer/method/construct_def_field.mag: -------------------------------------------------------------------------------- 1 | // skip: Field initializers are not implemented yet. 2 | var foo = Foo new // expect exit 3 3 | 4 | def baz() "baz" 5 | 6 | defclass Foo 7 | var bar = baz() 8 | end 9 | -------------------------------------------------------------------------------- /test/definition_order/field_initializer/method/construct_field_def.mag: -------------------------------------------------------------------------------- 1 | // skip: Field initializers are not implemented yet. 2 | var foo = Foo new // expect exit 3 3 | 4 | defclass Foo 5 | var bar = baz() 6 | end 7 | 8 | def baz() "baz" -------------------------------------------------------------------------------- /test/definition_order/field_initializer/method/def_construct_field.mag: -------------------------------------------------------------------------------- 1 | // skip: Field initializers are not implemented yet. 2 | def baz() "baz" 3 | 4 | var foo = Foo new // expect exit 3 5 | 6 | defclass Foo 7 | var bar = baz() 8 | end 9 | -------------------------------------------------------------------------------- /test/definition_order/field_initializer/method/def_field_construct.mag: -------------------------------------------------------------------------------- 1 | // skip: Field initializers are not implemented yet. 2 | def baz() "baz" 3 | 4 | defclass Foo 5 | var bar = baz() 6 | end 7 | 8 | var foo = Foo new 9 | print(foo bar) // expect: baz 10 | -------------------------------------------------------------------------------- /test/definition_order/field_initializer/method/field_construct_def.mag: -------------------------------------------------------------------------------- 1 | // skip: Field initializers are not implemented yet. 2 | defclass Foo 3 | var bar = baz() 4 | end 5 | 6 | var foo = Foo new // expect exit 3 7 | 8 | def baz() "baz" -------------------------------------------------------------------------------- /test/definition_order/field_initializer/method/field_def_construct.mag: -------------------------------------------------------------------------------- 1 | // skip: Field initializers are not implemented yet. 2 | defclass Foo 3 | var bar = baz() 4 | end 5 | 6 | def baz() "baz" 7 | 8 | var foo = Foo new 9 | print(foo bar) // expect: baz 10 | -------------------------------------------------------------------------------- /test/definition_order/field_initializer/var/construct_field_var.mag: -------------------------------------------------------------------------------- 1 | // skip: Field initializers are not implemented yet. 2 | var foo = Foo new // expect exit 3 3 | 4 | defclass Foo 5 | var bar = baz 6 | end 7 | 8 | var baz = "baz" -------------------------------------------------------------------------------- /test/definition_order/field_initializer/var/construct_var_field.mag: -------------------------------------------------------------------------------- 1 | // skip: Field initializers are not implemented yet. 2 | var foo = Foo new // expect exit 3 3 | 4 | var baz = "baz" 5 | 6 | defclass Foo 7 | var bar = baz 8 | end 9 | -------------------------------------------------------------------------------- /test/definition_order/field_initializer/var/field_construct_var.mag: -------------------------------------------------------------------------------- 1 | // skip: Field initializers are not implemented yet. 2 | defclass Foo 3 | var bar = baz 4 | end 5 | 6 | var foo = Foo new // expect exit 3 7 | 8 | var baz = "baz" -------------------------------------------------------------------------------- /test/definition_order/field_initializer/var/field_var_construct.mag: -------------------------------------------------------------------------------- 1 | // skip: Field initializers are not implemented yet. 2 | defclass Foo 3 | var bar = baz 4 | end 5 | 6 | var baz = "baz" 7 | 8 | var foo = Foo new 9 | print(foo bar) // expect: baz 10 | -------------------------------------------------------------------------------- /test/definition_order/field_initializer/var/var_construct_field.mag: -------------------------------------------------------------------------------- 1 | // skip: Field initializers are not implemented yet. 2 | var baz = "baz" 3 | 4 | var foo = Foo new // expect exit 3 5 | 6 | defclass Foo 7 | var bar = baz 8 | end 9 | -------------------------------------------------------------------------------- /test/definition_order/field_initializer/var/var_field_construct.mag: -------------------------------------------------------------------------------- 1 | // skip: Field initializers are not implemented yet. 2 | var baz = "baz" 3 | 4 | defclass Foo 5 | var bar = baz 6 | end 7 | 8 | var foo = Foo new 9 | print(foo bar) // expect: baz 10 | -------------------------------------------------------------------------------- /test/definition_order/field_pattern/construct_later_class.mag: -------------------------------------------------------------------------------- 1 | defclass Foo 2 | var field is Bar 3 | end 4 | 5 | do 6 | var foo = Foo new(field: nothing) 7 | catch is UndefinedVarError then 8 | print("caught") // expect: caught 9 | end 10 | 11 | defclass Bar 12 | end 13 | -------------------------------------------------------------------------------- /test/definition_order/field_pattern/construct_later_variable.mag: -------------------------------------------------------------------------------- 1 | defclass Foo 2 | var field is bar 3 | end 4 | 5 | do 6 | var foo = Foo new(field: 123) 7 | catch is UndefinedVarError then 8 | print("caught") // expect: caught 9 | end 10 | 11 | var bar = Num -------------------------------------------------------------------------------- /test/definition_order/field_pattern/later_class.mag: -------------------------------------------------------------------------------- 1 | defclass Foo 2 | var field is Bar 3 | end 4 | 5 | defclass Bar 6 | end 7 | 8 | print(Foo new(field: Bar new) field is Bar) // expect: true -------------------------------------------------------------------------------- /test/definition_order/field_pattern/later_variable.mag: -------------------------------------------------------------------------------- 1 | defclass Foo 2 | var field is bar 3 | end 4 | 5 | var bar = Num 6 | 7 | print(Foo new(field: 1) field) // expect: 1 -------------------------------------------------------------------------------- /test/definition_order/field_pattern/previous_class.mag: -------------------------------------------------------------------------------- 1 | defclass Bar 2 | end 3 | 4 | defclass Foo 5 | var field is Bar 6 | end 7 | 8 | print(Foo new(field: Bar new) field is Bar) // expect: true -------------------------------------------------------------------------------- /test/definition_order/field_pattern/previous_variable.mag: -------------------------------------------------------------------------------- 1 | var bar = Num 2 | 3 | defclass Foo 4 | var field is bar 5 | end 6 | 7 | print(Foo new(field: 1) field) // expect: 1 -------------------------------------------------------------------------------- /test/definition_order/superclass/later_class.mag: -------------------------------------------------------------------------------- 1 | // expect exit 3 2 | defclass Bar is Foo 3 | end 4 | 5 | defclass Foo 6 | end 7 | -------------------------------------------------------------------------------- /test/definition_order/superclass/later_variable.mag: -------------------------------------------------------------------------------- 1 | // expect exit 3 2 | defclass Foo 3 | end 4 | 5 | defclass Bar is fooVar 6 | end 7 | 8 | var fooVar = Foo 9 | -------------------------------------------------------------------------------- /test/definition_order/superclass/previous_class.mag: -------------------------------------------------------------------------------- 1 | defclass Foo 2 | end 3 | 4 | defclass Bar is Foo 5 | end 6 | 7 | print(Bar new is Foo) // expect: true -------------------------------------------------------------------------------- /test/definition_order/superclass/previous_variable.mag: -------------------------------------------------------------------------------- 1 | defclass Foo 2 | end 3 | 4 | var fooVar = Foo 5 | 6 | defclass Bar is fooVar 7 | end 8 | 9 | print(Bar new is Foo) // expect: true -------------------------------------------------------------------------------- /test/definition_order/variable/instantiate_later_class.mag: -------------------------------------------------------------------------------- 1 | // expect exit 3 2 | var a = Foo new 3 | 4 | defclass Foo 5 | end 6 | 7 | print(a is Foo) 8 | -------------------------------------------------------------------------------- /test/definition_order/variable/instantiate_previous_class.mag: -------------------------------------------------------------------------------- 1 | defclass Foo 2 | end 3 | 4 | var a = Foo new 5 | print(a is Foo) // expect: true 6 | -------------------------------------------------------------------------------- /test/do/eof_block.mag: -------------------------------------------------------------------------------- 1 | do 2 | print("1") 3 | print("2") // expect error -------------------------------------------------------------------------------- /test/do/eof_with_newline.mag: -------------------------------------------------------------------------------- 1 | do 2 | print("1") 3 | print("2") 4 | // expect error -------------------------------------------------------------------------------- /test/event/exit_while_fiber_sleeping.mag: -------------------------------------------------------------------------------- 1 | val channel = Channel new 2 | 3 | async 4 | sleep(ms: 20) 5 | // should exit before this prints 6 | print("should not print") 7 | end 8 | 9 | print("main") // expect: main 10 | 11 | // Sleep the main fiber a bit to make sure we get into the event loop. 12 | sleep(ms: 10) -------------------------------------------------------------------------------- /test/event/sleep_main_fiber.mag: -------------------------------------------------------------------------------- 1 | print("before") // expect: before 2 | sleep(ms: 10) 3 | print("after") // expect: after 4 | -------------------------------------------------------------------------------- /test/event/sleep_main_fiber_with_other_fiber.mag: -------------------------------------------------------------------------------- 1 | async 2 | print("other fiber") 3 | end 4 | 5 | print("before") // expect: before 6 | sleep(ms: 10) // expect: other fiber 7 | print("after") // expect: after 8 | -------------------------------------------------------------------------------- /test/event/sleep_return.mag: -------------------------------------------------------------------------------- 1 | print(sleep(ms: 10)) // expect: nothing 2 | -------------------------------------------------------------------------------- /test/functions/class.mag: -------------------------------------------------------------------------------- 1 | print((fn() "ok") is Function) // expect: true 2 | print((fn() "ok") class == Function) // expect: true 3 | -------------------------------------------------------------------------------- /test/import/do_not_import_private_vars/do_not_import_private_vars.mag: -------------------------------------------------------------------------------- 1 | import foo 2 | 3 | print(_hidden) // expect error 4 | -------------------------------------------------------------------------------- /test/import/do_not_import_private_vars/foo.mag: -------------------------------------------------------------------------------- 1 | // nontest 2 | 3 | val _hidden = "you can't see me" 4 | -------------------------------------------------------------------------------- /test/import/do_not_run_imported_module_if_main_has_error/foo.mag: -------------------------------------------------------------------------------- 1 | // nontest 2 | 3 | print("Should not be printed.") -------------------------------------------------------------------------------- /test/import/do_not_run_imported_module_if_main_has_error/main.mag: -------------------------------------------------------------------------------- 1 | import foo 2 | 3 | print(not_defined) // expect error 4 | -------------------------------------------------------------------------------- /test/import/do_not_run_main_module_if_import_has_error/foo.mag: -------------------------------------------------------------------------------- 1 | // nontest 2 | 3 | print(not_defined) 4 | -------------------------------------------------------------------------------- /test/import/do_not_run_main_module_if_import_has_error/main.mag: -------------------------------------------------------------------------------- 1 | import foo 2 | 3 | print("Should not be printed.") 4 | 5 | // expect error line 3 6 | // this is the error in the imported module -------------------------------------------------------------------------------- /test/import/import_from_same_dir/foo.mag: -------------------------------------------------------------------------------- 1 | // nontest 2 | 3 | def fooMethod() 4 | "found" 5 | end 6 | -------------------------------------------------------------------------------- /test/import/import_from_same_dir/import_from_same_dir.mag: -------------------------------------------------------------------------------- 1 | import foo 2 | 3 | print(fooMethod()) // expect: found 4 | -------------------------------------------------------------------------------- /test/import/import_from_subdir/foo/bar/baz.mag: -------------------------------------------------------------------------------- 1 | // nontest 2 | 3 | def bazMethod() 4 | "found" 5 | end 6 | -------------------------------------------------------------------------------- /test/import/import_from_subdir/import_from_subdir.mag: -------------------------------------------------------------------------------- 1 | import foo.bar.baz 2 | 3 | print(bazMethod()) // expect: found 4 | -------------------------------------------------------------------------------- /test/import/private_var_in_same_module.mag: -------------------------------------------------------------------------------- 1 | val _hidden = "can see me" 2 | print(_hidden) // expect: can see me 3 | -------------------------------------------------------------------------------- /test/import/shared_import/a.mag: -------------------------------------------------------------------------------- 1 | // nontest 2 | import b 3 | import c 4 | 5 | print("a") 6 | -------------------------------------------------------------------------------- /test/import/shared_import/b.mag: -------------------------------------------------------------------------------- 1 | // nontest 2 | import c 3 | 4 | print("b") 5 | -------------------------------------------------------------------------------- /test/import/shared_import/c.mag: -------------------------------------------------------------------------------- 1 | // nontest 2 | 3 | print("c") 4 | -------------------------------------------------------------------------------- /test/import/shared_import/shared_import.mag: -------------------------------------------------------------------------------- 1 | import a 2 | import b 3 | 4 | // c.mag should be run before both a and b because they both import it. 5 | // expect: c 6 | 7 | // b.mag should be run before a because a imports it. 8 | // expect: b 9 | 10 | // a.mag should be run since this script imports it. 11 | // expect: a 12 | print("main") // expect: main 13 | -------------------------------------------------------------------------------- /test/io/buffer/class.mag: -------------------------------------------------------------------------------- 1 | import io 2 | 3 | val buffer = Buffer new(1024) 4 | print(buffer is Buffer) // expect: true 5 | print(buffer is Iterable) // expect: true 6 | print(buffer is Indexable) // expect: true 7 | print(buffer class == Buffer) // expect: true 8 | -------------------------------------------------------------------------------- /test/io/buffer/construct_int.mag: -------------------------------------------------------------------------------- 1 | import io 2 | 3 | print(Buffer new(0) count) // expect: 0 4 | 5 | // Initialized with zeroes. 6 | val buffer = Buffer new(5) 7 | print(buffer[0]) // expect: 0 8 | print(buffer[1]) // expect: 0 9 | print(buffer[2]) // expect: 0 10 | print(buffer[3]) // expect: 0 11 | print(buffer[4]) // expect: 0 12 | -------------------------------------------------------------------------------- /test/io/buffer/count.mag: -------------------------------------------------------------------------------- 1 | import io 2 | 3 | print(Buffer new(0) count) // expect: 0 4 | print(Buffer new(1) count) // expect: 1 5 | print(Buffer new(2) count) // expect: 2 6 | print(Buffer new(1024) count) // expect: 1024 7 | print(Buffer new(65536) count) // expect: 65536 8 | -------------------------------------------------------------------------------- /test/io/buffer/decode_ascii.mag: -------------------------------------------------------------------------------- 1 | import io 2 | 3 | // TODO(bob): 4 | // - What if there are \0 bytes in the buffer? 5 | // - High-bit ASCII. 6 | 7 | val buffer = Buffer new(5) 8 | buffer[0] = 72 // H 9 | buffer[1] = 101 // e 10 | buffer[2] = 108 // l 11 | buffer[3] = 108 // l 12 | buffer[4] = 111 // o 13 | 14 | print(buffer decode(ASCII)) // expect: Hello 15 | -------------------------------------------------------------------------------- /test/io/file/class.mag: -------------------------------------------------------------------------------- 1 | import io 2 | 3 | // TODO(bob): Path should be relative to this script. 4 | val file = File open("test/io/file/class.mag") 5 | print(file is File) // expect: true 6 | print(file class == File) // expect: true 7 | -------------------------------------------------------------------------------- /test/io/file/data.txt: -------------------------------------------------------------------------------- 1 | This is the first line. 2 | This is the second line. -------------------------------------------------------------------------------- /test/io/file/open.mag: -------------------------------------------------------------------------------- 1 | // TODO(bob): Test invalid path. 2 | import io 3 | 4 | // TODO(bob): Path should be relative to this script. 5 | val file = File open("test/io/file/class.mag") 6 | print(file isOpen) // expect: true 7 | -------------------------------------------------------------------------------- /test/io/file/open_block.mag: -------------------------------------------------------------------------------- 1 | // TODO(bob): Test exception thrown from block. 2 | import io 3 | 4 | var outer = nothing 5 | // TODO(bob): Path should be relative to this script. 6 | File open("test/io/file/class.mag") as file do 7 | print(file isOpen) // expect: true 8 | outer = file 9 | end 10 | print(outer isOpen) // expect: false -------------------------------------------------------------------------------- /test/io/file/stream_bytes.mag: -------------------------------------------------------------------------------- 1 | import io 2 | 3 | // TODO(bob): Path should be relative to this script. 4 | val file = File open("test/io/file/data.txt") 5 | val stream = file streamBytes 6 | print(stream is Stream) // expect: true 7 | file close 8 | -------------------------------------------------------------------------------- /test/io/stream/class.mag: -------------------------------------------------------------------------------- 1 | import io 2 | 3 | // TODO(bob): Path should be relative to this script. 4 | val file = File open("test/io/file/data.txt") 5 | val stream = file streamBytes 6 | print(stream is Stream) // expect: true 7 | print(stream is Iterable) // expect: true 8 | print(stream class == Stream) // expect: true 9 | -------------------------------------------------------------------------------- /test/io/stream/to_string.mag: -------------------------------------------------------------------------------- 1 | import io 2 | 3 | val file = File open("test/io/file/data.txt") 4 | val stream = file streamBytes 5 | print(stream) // expect: [stream] -------------------------------------------------------------------------------- /test/is/eof.mag: -------------------------------------------------------------------------------- 1 | false is // expect error -------------------------------------------------------------------------------- /test/is/eof_with_newline.mag: -------------------------------------------------------------------------------- 1 | false is 2 | // expect error -------------------------------------------------------------------------------- /test/is/newline.mag: -------------------------------------------------------------------------------- 1 | print(false is 2 | Bool) // expect: true 3 | -------------------------------------------------------------------------------- /test/iterable/count.mag: -------------------------------------------------------------------------------- 1 | // Use a channel to test since String and List have their own count methods. 2 | val channel = Channel new 3 | async 4 | channel send(1) 5 | channel send(2) 6 | channel send(3) 7 | channel close 8 | end 9 | 10 | print(channel count) // expect: 3 11 | -------------------------------------------------------------------------------- /test/list/add.mag: -------------------------------------------------------------------------------- 1 | var a = [] 2 | a add(1) 3 | print(a) // expect: [1] 4 | a add(2) 5 | print(a) // expect: [1, 2] 6 | a add(3) 7 | print(a) // expect: [1, 2, 3] 8 | 9 | // Returns added element. 10 | print(a add(4)) // expect: 4 11 | -------------------------------------------------------------------------------- /test/list/class.mag: -------------------------------------------------------------------------------- 1 | print([] is List) // expect: true 2 | print([] is Iterable) // expect: true 3 | print([] is Indexable) // expect: true 4 | print([] class == List) // expect: true 5 | -------------------------------------------------------------------------------- /test/list/clear.mag: -------------------------------------------------------------------------------- 1 | var a = [1, 2, 3] 2 | a clear 3 | print(a) // expect: [] 4 | 5 | // Returns nothing. 6 | print([1, 2] clear) // expect: nothing 7 | -------------------------------------------------------------------------------- /test/list/count.mag: -------------------------------------------------------------------------------- 1 | print([] count) // expect: 0 2 | print(["a"] count) // expect: 1 3 | print(["a", "b", "c"] count) // expect: 3 4 | -------------------------------------------------------------------------------- /test/list/iteration.mag: -------------------------------------------------------------------------------- 1 | for i in [] do print(i) // prints nothing 2 | 3 | for i in ["value"] do print(i) 4 | // expect: value 5 | 6 | for i in [1, 2, 3, 4] do print(i) 7 | // expect: 1 8 | // expect: 2 9 | // expect: 3 10 | // expect: 4 11 | -------------------------------------------------------------------------------- /test/list/last.mag: -------------------------------------------------------------------------------- 1 | print(["only"] last) // expect: only 2 | print([1, 2, 3] last) // expect: 3 3 | 4 | do 5 | [] last 6 | catch is ArgError then print("caught") // expect: caught 7 | -------------------------------------------------------------------------------- /test/list/literals.mag: -------------------------------------------------------------------------------- 1 | print([]) // expect: [] 2 | print([1]) // expect: [1] 3 | print([1, 2, 3, 4, 5]) // expect: [1, 2, 3, 4, 5] 4 | 5 | // "," is lower precedence than "is". 6 | print([true is Bool, 1 is String]) // expect: [true, false] 7 | -------------------------------------------------------------------------------- /test/looping/break_at_top_level.mag: -------------------------------------------------------------------------------- 1 | print("before") 2 | break // expect error 3 | print("after") 4 | -------------------------------------------------------------------------------- /test/looping/break_outside_loop.mag: -------------------------------------------------------------------------------- 1 | do 2 | for i in 1..1 do 3 | break 4 | while 1 > 2 do 5 | break 6 | for i in 1..1 do 7 | break 8 | print(i) 9 | end 10 | end 11 | end 12 | print("before") 13 | break // expect error 14 | print("after") 15 | end 16 | -------------------------------------------------------------------------------- /test/match/case_after_else.mag: -------------------------------------------------------------------------------- 1 | // Should not allow a case after the else. 2 | match "whatever" 3 | case "a" then "a" 4 | else "b" 5 | case "c" then "c" // expect error 6 | end 7 | -------------------------------------------------------------------------------- /test/match/duplicate_field.mag: -------------------------------------------------------------------------------- 1 | // Should not allow a duplicate field name in a record pattern. 2 | match "whatever" 3 | case a: 1, a: 2 then print("no") // expect error 4 | end 5 | -------------------------------------------------------------------------------- /test/match/duplicate_positional_field.mag: -------------------------------------------------------------------------------- 1 | // Should not allow a duplicate field name in a record pattern. 2 | match 1, 2 3 | case 1, 0: 2 then print("no") // expect error 4 | end 5 | -------------------------------------------------------------------------------- /test/match/use_wildcard.mag: -------------------------------------------------------------------------------- 1 | // Should not bind a variable with a wildcard pattern. 2 | match "whatever" 3 | case _ then print(_) // expect error 4 | case "else" then print("no") 5 | end 6 | -------------------------------------------------------------------------------- /test/methods/declare_in_local_scope.mag: -------------------------------------------------------------------------------- 1 | // At least right now, methods can only be declared at the top level. 2 | do 3 | def foo() "no" // expect error 4 | end 5 | -------------------------------------------------------------------------------- /test/methods/expression_in_type_pattern.mag: -------------------------------------------------------------------------------- 1 | def bar(arg) Num 2 | 3 | // Can only have simple name expressions in type patterns. 4 | def foo(is bar("whatever")) "number" // expect error 5 | 6 | foo(3) -------------------------------------------------------------------------------- /test/methods/expression_in_value_pattern.mag: -------------------------------------------------------------------------------- 1 | // Can only have simple name expressions in value patterns. 2 | def foo(== 1 + 2) "three" // expect error -------------------------------------------------------------------------------- /test/methods/mutual_recursion.mag: -------------------------------------------------------------------------------- 1 | // Top-level methods can be mutually recursive. 2 | def foo(n) 3 | if n < 1 then "done" else bar(n - 1) 4 | end 5 | 6 | def bar(n) 7 | foo(n - 1) 8 | end 9 | 10 | print(bar(5)) // expect: done 11 | -------------------------------------------------------------------------------- /test/methods/record_pattern_in_setter.mag: -------------------------------------------------------------------------------- 1 | // skip: Destructuring value patterns isn't supported yet. 2 | def foo() = (a, b) 3 | print(a) 4 | print(b) 5 | end 6 | 7 | foo() = 1, 2 8 | // expect: 1 9 | // expect: 2 10 | -------------------------------------------------------------------------------- /test/methods/recursion.mag: -------------------------------------------------------------------------------- 1 | // Top-level methods can be recursive. 2 | def fib(n) 3 | if n < 2 then n else fib(n - 2) + fib(n - 1) 4 | end 5 | 6 | print(fib(10)) // expect: 55 7 | -------------------------------------------------------------------------------- /test/methods/top_level_vars_in_body/call_def_var.mag: -------------------------------------------------------------------------------- 1 | // expect exit 3 2 | foo() 3 | def foo() bar 4 | var bar = "123" -------------------------------------------------------------------------------- /test/methods/top_level_vars_in_body/call_var_def.mag: -------------------------------------------------------------------------------- 1 | // expect exit 3 2 | foo() 3 | var bar = "123" 4 | def foo() bar 5 | -------------------------------------------------------------------------------- /test/methods/top_level_vars_in_body/def_call_var.mag: -------------------------------------------------------------------------------- 1 | // expect exit 3 2 | def foo() bar 3 | foo() 4 | var bar = "123" 5 | -------------------------------------------------------------------------------- /test/methods/top_level_vars_in_body/def_var_call.mag: -------------------------------------------------------------------------------- 1 | def foo() bar 2 | var bar = "123" 3 | print(foo()) // expect: 123 4 | -------------------------------------------------------------------------------- /test/methods/top_level_vars_in_body/var_call_def.mag: -------------------------------------------------------------------------------- 1 | // expect exit 3 2 | var bar = "123" 3 | foo() 4 | def foo() bar 5 | -------------------------------------------------------------------------------- /test/methods/top_level_vars_in_body/var_def_call.mag: -------------------------------------------------------------------------------- 1 | var bar = "123" 2 | def foo() bar 3 | print(foo()) // expect: 123 4 | -------------------------------------------------------------------------------- /test/modules/empty.mag: -------------------------------------------------------------------------------- 1 | // A module that contains no code at all should still be valid. -------------------------------------------------------------------------------- /test/multimethods/collision/bool.mag: -------------------------------------------------------------------------------- 1 | // skip: Method collision is not implemented yet. 2 | def foo(true) print("zero") 3 | def foo(true) print("two") 4 | 5 | do 6 | foo(123) 7 | catch is MethodCollisionError then print("caught") // expect: caught 8 | -------------------------------------------------------------------------------- /test/multimethods/collision/char.mag: -------------------------------------------------------------------------------- 1 | // skip: Method collision is not implemented yet. 2 | def foo('c') print("zero") 3 | def foo('c') print("two") 4 | 5 | do 6 | foo(123) 7 | catch is MethodCollisionError then print("caught") // expect: caught 8 | -------------------------------------------------------------------------------- /test/multimethods/collision/float.mag: -------------------------------------------------------------------------------- 1 | // skip: Method collision is not implemented yet. 2 | def foo(1.2) print("zero") 3 | def foo(1.2) print("two") 4 | 5 | do 6 | foo(123) 7 | catch is MethodCollisionError then print("caught") // expect: caught 8 | -------------------------------------------------------------------------------- /test/multimethods/collision/int.mag: -------------------------------------------------------------------------------- 1 | // skip: Method collision is not implemented yet. 2 | def foo(1) print("zero") 3 | def foo(1) print("two") 4 | 5 | do 6 | foo('c') 7 | catch is MethodCollisionError then print("caught") // expect: caught 8 | -------------------------------------------------------------------------------- /test/multimethods/collision/int_float.mag: -------------------------------------------------------------------------------- 1 | // Int and floats with the same value do not collide. 2 | def foo(1) print("int") 3 | def foo(1.0) print("float") 4 | 5 | foo(1) // expect: int 6 | foo(1.0) // expect: float 7 | -------------------------------------------------------------------------------- /test/multimethods/collision/nothing.mag: -------------------------------------------------------------------------------- 1 | // skip: Method collision is not implemented yet. 2 | def foo(nothing) print("zero") 3 | def foo(nothing) print("two") 4 | 5 | do 6 | foo(123) 7 | catch is MethodCollisionError then print("caught") // expect: caught 8 | -------------------------------------------------------------------------------- /test/multimethods/literal_patterns.mag: -------------------------------------------------------------------------------- 1 | def foo(0) print("zero") 2 | def foo(2) print("two") 3 | def foo(1) print("one") 4 | 5 | foo(0) // expect: zero 6 | foo(1) // expect: one 7 | foo(2) // expect: two 8 | -------------------------------------------------------------------------------- /test/multimethods/nested_record_pattern.mag: -------------------------------------------------------------------------------- 1 | def foo(a (x: x, y: (y, z))) 2 | print("x: " + x + " y: " + y + " " + z) 3 | end 4 | 5 | val a = x: 1, y: (2, 3) 6 | foo(a) // expect: x: 1 y: 2 3 7 | -------------------------------------------------------------------------------- /test/multimethods/ordering/type_before_variable.mag: -------------------------------------------------------------------------------- 1 | def foo(n is Num) 2 | print("num") 3 | end 4 | 5 | def foo(a) 6 | print("other") 7 | end 8 | 9 | def foo(s is String) 10 | print("string") 11 | end 12 | 13 | foo(123) // expect: num 14 | foo("s") // expect: string 15 | foo(true) // expect: other 16 | -------------------------------------------------------------------------------- /test/multimethods/ordering/value_before_type.mag: -------------------------------------------------------------------------------- 1 | def foo(1) 2 | print("1") 3 | end 4 | 5 | def foo(is Num) 6 | print("num") 7 | end 8 | 9 | def foo(2) 10 | print("2") 11 | end 12 | 13 | foo(1) // expect: 1 14 | foo(2) // expect: 2 15 | foo(3) // expect: num 16 | -------------------------------------------------------------------------------- /test/multimethods/ordering/value_before_variable.mag: -------------------------------------------------------------------------------- 1 | def foo(1) 2 | print("1") 3 | end 4 | 5 | def foo(variable) 6 | print("variable") 7 | end 8 | 9 | def foo(2) 10 | print("2") 11 | end 12 | 13 | foo(1) // expect: 1 14 | foo(2) // expect: 2 15 | foo(3) // expect: variable 16 | -------------------------------------------------------------------------------- /test/multimethods/type_patterns.mag: -------------------------------------------------------------------------------- 1 | def foo(n is Num) 2 | print("num") 3 | end 4 | 5 | def foo(s is String) 6 | print("string") 7 | end 8 | 9 | defclass Bar 10 | end 11 | 12 | def foo(b is Bar) 13 | print("bar") 14 | end 15 | 16 | foo(123) // expect: num 17 | foo("s") // expect: string 18 | foo(Bar new) // expect: bar 19 | -------------------------------------------------------------------------------- /test/number/float/addition.mag: -------------------------------------------------------------------------------- 1 | // TODO(bob): More edge case values. 2 | 3 | print(1.2 + 3.4) // expect: 4.6 4 | print(12.34 + 76.54) // expect: 88.88 5 | print(3.0 + 4.0) // expect: 7.0 6 | -------------------------------------------------------------------------------- /test/number/float/class.mag: -------------------------------------------------------------------------------- 1 | print(1.23 is Float) // expect: true 2 | print(1.23 is Num) // expect: true 3 | print(1.23 class == Float) // expect: true 4 | -------------------------------------------------------------------------------- /test/number/float/division.mag: -------------------------------------------------------------------------------- 1 | // TODO(bob): Division by zero. 2 | 3 | print(10.0 / 2.0) // expect: 5.0 4 | print(1.0 / 3.0) // expect: 0.333333 5 | print(-8.0 / 2.0) // expect: -4.0 6 | print(-8.0 / -2.0) // expect: 4.0 7 | -------------------------------------------------------------------------------- /test/number/float/literals.mag: -------------------------------------------------------------------------------- 1 | // TODO(bob): Scientific notation, hex, etc. 2 | 3 | print(0.0) // expect: 0.0 4 | print(1.0) // expect: 1.0 5 | print(123.456) // expect: 123.456 6 | print(-123.456) // expect: -123.456 7 | print(-0.0) // expect: -0.0 8 | -------------------------------------------------------------------------------- /test/number/float/multiplication.mag: -------------------------------------------------------------------------------- 1 | print(0.0 * 0.0) // expect: 0.0 2 | print(0.0 * 123.0) // expect: 0.0 3 | print(3.0 * 4.0) // expect: 12.0 4 | print(-2.0 * 0.1) // expect: -0.2 5 | -------------------------------------------------------------------------------- /test/number/float/negation.mag: -------------------------------------------------------------------------------- 1 | print(-(1.2)) // expect: -1.2 2 | print(-(-1.2)) // expect: 1.2 3 | print(-(0.0)) // expect: -0.0 4 | print(-(-0.0)) // expect: 0.0 5 | -------------------------------------------------------------------------------- /test/number/float/sgn.mag: -------------------------------------------------------------------------------- 1 | print(0.0 sgn) // expect: 0 2 | print(0.01 sgn) // expect: 1 3 | print(1234.5 sgn) // expect: 1 4 | print(-0.2 sgn) // expect: -1 5 | print(-1234.5 sgn) // expect: -1 6 | 7 | // TODO(bob): Is this right? 8 | print(-0.0 sgn) // expect: 0 9 | -------------------------------------------------------------------------------- /test/number/float/subtraction.mag: -------------------------------------------------------------------------------- 1 | // TODO(bob): More. 2 | print(4.2 - 1.1) // expect: 3.1 3 | print(3.1 - 4.2) // expect: -1.1 4 | -------------------------------------------------------------------------------- /test/number/float/to_string.mag: -------------------------------------------------------------------------------- 1 | // TODO(bob): More examples. 2 | 3 | print(1.0 toString == "1.0") // expect: true 4 | print(0.1 toString == "0.1") // expect: true 5 | print(123.456 toString == "123.456") // expect: true 6 | print(-123.456 toString == "-123.456") // expect: true 7 | -------------------------------------------------------------------------------- /test/number/int/addition.mag: -------------------------------------------------------------------------------- 1 | print(0 + 0) // expect: 0 2 | print(1234 + 7654) // expect: 8888 3 | print(3 + 4) // expect: 7 4 | -------------------------------------------------------------------------------- /test/number/int/class.mag: -------------------------------------------------------------------------------- 1 | print(123 is Num) // expect: true 2 | print(123 is Int) // expect: true 3 | print(123 class == Int) // expect: true 4 | -------------------------------------------------------------------------------- /test/number/int/division.mag: -------------------------------------------------------------------------------- 1 | print(10 / 2) // expect: 5 2 | print(1234 / 1) // expect: 1234 3 | 4 | // TODO(bob): Division by zero. -------------------------------------------------------------------------------- /test/number/int/literals.mag: -------------------------------------------------------------------------------- 1 | print(0) // expect: 0 2 | print(1) // expect: 1 3 | print(123456) // expect: 123456 4 | print(-123456) // expect: -123456 5 | print(-0) // expect: 0 6 | 7 | // TODO(bob): Hex, etc. -------------------------------------------------------------------------------- /test/number/int/multiplication.mag: -------------------------------------------------------------------------------- 1 | print(0 * 0) // expect: 0 2 | print(0 * 123) // expect: 0 3 | print(3 * 4) // expect: 12 4 | -------------------------------------------------------------------------------- /test/number/int/negation.mag: -------------------------------------------------------------------------------- 1 | print(-(123)) // expect: -123 2 | print(-(-123)) // expect: 123 3 | print(-(0)) // expect: 0 4 | -------------------------------------------------------------------------------- /test/number/int/sgn.mag: -------------------------------------------------------------------------------- 1 | print(0 sgn) // expect: 0 2 | print(1 sgn) // expect: 1 3 | print(12345 sgn) // expect: 1 4 | print(-2 sgn) // expect: -1 5 | print(-12345 sgn) // expect: -1 6 | -------------------------------------------------------------------------------- /test/number/int/subtraction.mag: -------------------------------------------------------------------------------- 1 | print(0 - 0) // expect: 0 2 | print(4 - 3) // expect: 1 3 | print(3 - 4) // expect: -1 4 | 5 | // TODO(bob): How should it handle "3-4"? 6 | -------------------------------------------------------------------------------- /test/number/int/to_string.mag: -------------------------------------------------------------------------------- 1 | print(0 toString == "0") // expect: true 2 | print(-0 toString == "0") // expect: true 3 | print(123456 toString == "123456") // expect: true 4 | print(-123456 toString == "-123456") // expect: true 5 | 6 | // TODO(bob): Floating point, negative zero. -------------------------------------------------------------------------------- /test/number/mixed/addition.mag: -------------------------------------------------------------------------------- 1 | print(1 + 2.3) // expect: 3.3 2 | print(1.2 + 3) // expect: 4.2 3 | 4 | // Floating point arguments taint. 5 | print(1 + 1.0 is Float) // expect: true 6 | print(1.0 + 1 is Float) // expect: true 7 | -------------------------------------------------------------------------------- /test/number/mixed/division.mag: -------------------------------------------------------------------------------- 1 | // TODO(bob): Test mixed division. 2 | 3 | // Floating point arguments taint. 4 | print(1 / 1.0 is Float) // expect: true 5 | print(1.0 / 1 is Float) // expect: true 6 | -------------------------------------------------------------------------------- /test/number/mixed/multiplication.mag: -------------------------------------------------------------------------------- 1 | // TODO(bob): Test mixed multiplication. 2 | 3 | // Floating point arguments taint. 4 | print(1 * 1.0 is Float) // expect: true 5 | print(1.0 * 1 is Float) // expect: true 6 | -------------------------------------------------------------------------------- /test/number/mixed/subtraction.mag: -------------------------------------------------------------------------------- 1 | print(2 - 1.2) // expect: 0.8 2 | print(3.2 - 1) // expect: 2.2 3 | 4 | // Floating point arguments taint. 5 | print(1 - 1.0 is Float) // expect: true 6 | print(1.0 - 1 is Float) // expect: true 7 | -------------------------------------------------------------------------------- /test/or/eof.mag: -------------------------------------------------------------------------------- 1 | false or // expect error -------------------------------------------------------------------------------- /test/or/eof_with_newline.mag: -------------------------------------------------------------------------------- 1 | false or 2 | // expect error -------------------------------------------------------------------------------- /test/range/iteration.mag: -------------------------------------------------------------------------------- 1 | // TODO(bob): Descending ranges? 2 | 3 | for i in 2..5 do print(i) 4 | // expect: 2 5 | // expect: 3 6 | // expect: 4 7 | // expect: 5 8 | 9 | for i in 2...5 do print(i) 10 | // expect: 2 11 | // expect: 3 12 | // expect: 4 13 | -------------------------------------------------------------------------------- /test/records/class.mag: -------------------------------------------------------------------------------- 1 | var a = x: 1 2 | print(a is Record) // expect: true 3 | print(a class == Record) // expect: true 4 | -------------------------------------------------------------------------------- /test/records/duplicate_field.mag: -------------------------------------------------------------------------------- 1 | // Fail to parse duplicate field names. 2 | a: 1, a: 2 // expect error 3 | -------------------------------------------------------------------------------- /test/records/duplicate_infix_field.mag: -------------------------------------------------------------------------------- 1 | // Fail to parse duplicate field names. 2 | print(1, a: 2, a: 3) // expect error 3 | -------------------------------------------------------------------------------- /test/records/record_in_method.mag: -------------------------------------------------------------------------------- 1 | // Regression test. Records were being constructed from the stack 2 | // without taking into account the current frame's stack start. 3 | def foo(arg) 4 | var i = 3, 4 5 | print(i) // expect: (3, 4) 6 | end 7 | 8 | foo("arg") 9 | -------------------------------------------------------------------------------- /test/strings/class.mag: -------------------------------------------------------------------------------- 1 | print("s" is String) // expect: true 2 | print("s" is Iterable) // expect: true 3 | print("s" is Indexable) // expect: true 4 | print("s" class == String) // expect: true 5 | -------------------------------------------------------------------------------- /test/strings/count.mag: -------------------------------------------------------------------------------- 1 | print("" count) // expect: 0 2 | print("abc" count) // expect: 3 3 | print("123456789012345678901234567890" count) // expect: 30 4 | -------------------------------------------------------------------------------- /test/strings/iterate.mag: -------------------------------------------------------------------------------- 1 | // Iterates through the characters. 2 | for c in "abc" do print(c) 3 | // expect: a 4 | // expect: b 5 | // expect: c 6 | 7 | // Yields characters. 8 | for c in "a" do print(c class == Char) // expect: true -------------------------------------------------------------------------------- /test/strings/multiply.mag: -------------------------------------------------------------------------------- 1 | print("(" + ("ab" * 0) + ")") // expect: () 2 | print("ab" * 1) // expect: ab 3 | print("ab" * 4) // expect: abababab 4 | 5 | do 6 | "a" * -2 7 | catch is ArgError then print("caught") // expect: caught -------------------------------------------------------------------------------- /test/strings/newline_in_string.mag: -------------------------------------------------------------------------------- 1 | // TODO(bob): Decide if this is the behavior we actually want. 2 | print("a string with 3 | a newline in it") 4 | // expect: a string with 5 | // expect: a newline in it -------------------------------------------------------------------------------- /test/strings/plus.mag: -------------------------------------------------------------------------------- 1 | print("a" + "b") // expect: ab 2 | print("first" + "second") // expect: firstsecond 3 | print("blah" + "") // expect: blah 4 | print("" + "blah") // expect: blah 5 | 6 | // Convert other operand to string if one operand is. 7 | print("s" + 123) // expect: s123 8 | print(123 + "s") // expect: 123s 9 | -------------------------------------------------------------------------------- /test/strings/strings.mag: -------------------------------------------------------------------------------- 1 | // Delimited using double quotes. 2 | print("some string") // expect: some string 3 | 4 | // Escape characters. 5 | print("\"") // expect: " 6 | print("\\") // expect: \ 7 | print("(\n)") // expect: ( 8 | // expect: ) 9 | -------------------------------------------------------------------------------- /test/strings/to_string.mag: -------------------------------------------------------------------------------- 1 | print("" toString == "") // expect: true 2 | print("abc" toString == "abc") // expect: true 3 | 4 | // TODO(bob): Floating point, negative zero. -------------------------------------------------------------------------------- /test/strings/unterminated_escape.mag: -------------------------------------------------------------------------------- 1 | // expect error line 2 2 | "a string that isn't terminated\ -------------------------------------------------------------------------------- /test/strings/unterminated_string.mag: -------------------------------------------------------------------------------- 1 | // expect error line 2 2 | "a string that isn't terminated 3 | -------------------------------------------------------------------------------- /test/throw/catch_in_if.mag: -------------------------------------------------------------------------------- 1 | // Allow catch in if clauses. 2 | if true then 3 | throw "error" 4 | catch err is String then 5 | print(err) // expect: error 6 | end 7 | 8 | // Allow catch in else clauses. 9 | if false then 10 | nothing 11 | else 12 | throw "error" 13 | catch err is String then 14 | print(err) // expect: error 15 | end 16 | -------------------------------------------------------------------------------- /test/throw/catch_unwind.mag: -------------------------------------------------------------------------------- 1 | // Unwind to enclosing method. 2 | def a() 3 | throw "blah" 4 | end 5 | 6 | def b() 7 | a() 8 | end 9 | 10 | def c() 11 | b() 12 | catch err then 13 | print("caught") // expect: caught 14 | end 15 | 16 | c() -------------------------------------------------------------------------------- /test/throw/method_catch.mag: -------------------------------------------------------------------------------- 1 | // A method body can have a catch clause. 2 | def method(shouldThrow) 3 | print("method") 4 | if shouldThrow then throw "err" 5 | catch err then 6 | print("caught") 7 | end 8 | 9 | method(false) // expect: method 10 | method(true) // expect: method 11 | // expect: caught 12 | -------------------------------------------------------------------------------- /test/throw/uncaught.mag: -------------------------------------------------------------------------------- 1 | throw "uncaught" // expect exit 3 2 | -------------------------------------------------------------------------------- /test/throw/unwind_past_match_failure.mag: -------------------------------------------------------------------------------- 1 | do 2 | do 3 | throw "unwind error" 4 | catch is Num then 5 | print("Should not be caught here.") 6 | end 7 | catch is String then 8 | print("caught") // expect: caught 9 | end 10 | -------------------------------------------------------------------------------- /test/top_level_variables/assign_to_undeclared_variable.mag: -------------------------------------------------------------------------------- 1 | unknown = 123 // expect error 2 | -------------------------------------------------------------------------------- /test/top_level_variables/destructure_missing_field.mag: -------------------------------------------------------------------------------- 1 | // expect exit 3 2 | val x: a, y: b = x: 1 -------------------------------------------------------------------------------- /test/top_level_variables/destructure_non_record.mag: -------------------------------------------------------------------------------- 1 | // expect exit 3 2 | val x: a = "not record" 3 | -------------------------------------------------------------------------------- /test/top_level_variables/destructure_pattern_fail.mag: -------------------------------------------------------------------------------- 1 | // expect exit 3 2 | val x: a is Num = x: true 3 | -------------------------------------------------------------------------------- /test/top_level_variables/duplicate_definition.mag: -------------------------------------------------------------------------------- 1 | // Two variables in the same scope. 2 | val a = "first" 3 | val a = "second" // expect error 4 | -------------------------------------------------------------------------------- /test/top_level_variables/duplicate_field.mag: -------------------------------------------------------------------------------- 1 | // Should not allow a duplicate field name in a record pattern. 2 | val a: b, a: c = a: 2 // expect error 3 | -------------------------------------------------------------------------------- /test/top_level_variables/duplicate_infix_field.mag: -------------------------------------------------------------------------------- 1 | // Should not allow a duplicate field name in a record pattern. 2 | val a, b: b, b: c = 1 // expect error 3 | -------------------------------------------------------------------------------- /test/top_level_variables/duplicate_positional_field.mag: -------------------------------------------------------------------------------- 1 | // Should not allow a duplicate positional field name in a record pattern. 2 | val b, 0: c = 1, 2 // expect error 3 | -------------------------------------------------------------------------------- /test/top_level_variables/initialize_from_later_class.mag: -------------------------------------------------------------------------------- 1 | // expect exit 3 2 | var a = Foo 3 | 4 | defclass Foo 5 | end 6 | -------------------------------------------------------------------------------- /test/top_level_variables/initialize_from_later_method.mag: -------------------------------------------------------------------------------- 1 | // expect exit 3 2 | var a = foo() 3 | def foo() "ok" 4 | -------------------------------------------------------------------------------- /test/top_level_variables/initialize_from_later_variable.mag: -------------------------------------------------------------------------------- 1 | // expect exit 3 2 | var a = b 3 | var b = "ok" 4 | print(a) -------------------------------------------------------------------------------- /test/top_level_variables/initialize_from_previous_class.mag: -------------------------------------------------------------------------------- 1 | defclass Foo 2 | end 3 | 4 | var a = Foo 5 | print(a) // expect: Foo 6 | -------------------------------------------------------------------------------- /test/top_level_variables/initialize_from_previous_method.mag: -------------------------------------------------------------------------------- 1 | def foo() "ok" 2 | var a = foo() 3 | print(a) // expect: ok -------------------------------------------------------------------------------- /test/top_level_variables/initialize_from_previous_variable.mag: -------------------------------------------------------------------------------- 1 | var a = "ok" 2 | var b = a 3 | print(b) // expect: ok -------------------------------------------------------------------------------- /test/top_level_variables/type_pattern_fail.mag: -------------------------------------------------------------------------------- 1 | // expect exit 3 2 | val e is Bool = 2 3 | -------------------------------------------------------------------------------- /test/top_level_variables/type_patterns.mag: -------------------------------------------------------------------------------- 1 | val a is Num = 1 2 | print(a) // expect: 1 3 | 4 | // Can use an expression for the value. 5 | val d is String = "str" 6 | print(d) // expect: str 7 | 8 | // Don't actually need to name a variable. 9 | print(val is Num = 1) // expect: 1 10 | -------------------------------------------------------------------------------- /test/top_level_variables/unknown.mag: -------------------------------------------------------------------------------- 1 | // Accessing an unknown name. 2 | print(unknown) // expect error 3 | 4 | // Accessing a name that has gone out of scope. 5 | do 6 | val gone = "here" 7 | end 8 | print(gone) // expect error 9 | -------------------------------------------------------------------------------- /test/top_level_variables/use_before_definition.mag: -------------------------------------------------------------------------------- 1 | do 2 | print(a) 3 | catch is UndefinedVarError then print("caught") // expect: caught 4 | var a = "value" 5 | -------------------------------------------------------------------------------- /test/top_level_variables/value_pattern_fail.mag: -------------------------------------------------------------------------------- 1 | // expect exit 3 2 | val e == 1 = 2 3 | -------------------------------------------------------------------------------- /test/top_level_variables/value_patterns.mag: -------------------------------------------------------------------------------- 1 | val a == 1 = 1 2 | print(a) // expect: 1 3 | 4 | // Can use an expression for the value. 5 | val d == 1 + 2 + 3 = 6 6 | print(d) // expect: 6 7 | 8 | // Don't actually need to name a variable. 9 | print(val == 1 = 1) // expect: 1 10 | -------------------------------------------------------------------------------- /test/variables/assign_to_undeclared_variable.mag: -------------------------------------------------------------------------------- 1 | do 2 | unknown = 123 // expect error 3 | end -------------------------------------------------------------------------------- /test/variables/duplicate_definition.mag: -------------------------------------------------------------------------------- 1 | // Two variables in the same scope. 2 | do 3 | val a = "first" 4 | val a = "second" // expect error 5 | end 6 | -------------------------------------------------------------------------------- /test/variables/duplicate_field.mag: -------------------------------------------------------------------------------- 1 | // Should not allow a duplicate field name in a record pattern. 2 | do 3 | val a: b, a: c = a: 2 // expect error 4 | end -------------------------------------------------------------------------------- /test/variables/duplicate_infix_field.mag: -------------------------------------------------------------------------------- 1 | // Should not allow a duplicate field name in a record pattern. 2 | do 3 | val a, b: b, b: c = 1 // expect error 4 | end -------------------------------------------------------------------------------- /test/variables/duplicate_positional_field.mag: -------------------------------------------------------------------------------- 1 | // Should not allow a duplicate positional field name in a record pattern. 2 | do 3 | val b, 0: c = 1, 2 // expect error 4 | end -------------------------------------------------------------------------------- /test/variables/initializer_scope.mag: -------------------------------------------------------------------------------- 1 | // Make sure the RHS of a variable is executed in a scope *before* its variables 2 | // are declared. 3 | var a = "outer" 4 | do 5 | var a = a 6 | print(a) // expect: outer 7 | end 8 | -------------------------------------------------------------------------------- /test/variables/out_of_scope.mag: -------------------------------------------------------------------------------- 1 | do 2 | do 3 | val gone = "here" 4 | end 5 | print(gone) // expect error 6 | end 7 | -------------------------------------------------------------------------------- /test/variables/shadowing.mag: -------------------------------------------------------------------------------- 1 | // Shadowing and unshadowing. 2 | val a = "outer" 3 | print(a) // expect: outer 4 | do 5 | val a = "inner" 6 | print(a) // expect: inner 7 | 8 | do 9 | val a = "innerinner" 10 | print(a) // expect: innerinner 11 | end 12 | print(a) // expect: inner 13 | end 14 | print(a) // expect: outer 15 | -------------------------------------------------------------------------------- /test/variables/unknown.mag: -------------------------------------------------------------------------------- 1 | do 2 | print(unknown) // expect error 3 | end 4 | -------------------------------------------------------------------------------- /test/whitespace/beginning_of_file.mag: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | print("ok") // expect: ok -------------------------------------------------------------------------------- /test/whitespace/end_of_file.mag: -------------------------------------------------------------------------------- 1 | print("ok") // expect: ok 2 | 3 | 4 | -------------------------------------------------------------------------------- /test/whitespace/none_at_end_of_file.mag: -------------------------------------------------------------------------------- 1 | print("ok") // expect: ok --------------------------------------------------------------------------------