├── .bumpversion.cfg ├── .gitattributes ├── .gitignore ├── .travis.yml ├── CMakeLists.txt ├── LICENSE ├── README.md ├── config ├── CREDITS.txt ├── gta3 │ ├── alternators.xml │ ├── cleo.xml │ ├── commandline.txt │ ├── commands.xml │ ├── constants.xml │ ├── default.xml │ └── extensions.xml ├── gta3sc.xml ├── gtasa │ ├── alternators.xml │ ├── cleo.xml │ ├── commandline.txt │ ├── commands.xml │ ├── constants.xml │ ├── default.xml │ ├── eventchoices.xml │ ├── extensions.xml │ ├── sounds.xml │ ├── taskchoices.xml │ └── taskopcodes.xml └── gtavc │ ├── alternators.xml │ ├── cleo.xml │ ├── commandline.txt │ ├── commands.xml │ ├── constants.xml │ ├── default.xml │ ├── extensions.xml │ └── mobile.xml ├── deps ├── CMake │ ├── GetGitRevisionDescription.cmake │ ├── GetGitRevisionDescription.cmake.in │ └── PrecompiledHeader.cmake ├── SmallVector │ ├── LICENSE.TXT │ ├── README.md │ └── SmallVector.h ├── any │ └── include │ │ └── any │ │ └── any.hpp ├── cppformat │ └── cppformat │ │ ├── .travis.yml │ │ ├── Android.mk │ │ ├── CMakeLists.txt │ │ ├── ChangeLog.rst │ │ ├── LICENSE.rst │ │ ├── README.rst │ │ ├── doc │ │ ├── CMakeLists.txt │ │ ├── _static │ │ │ ├── bootstrap.min.js │ │ │ └── fonts │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ └── glyphicons-halflings-regular.woff │ │ ├── _templates │ │ │ ├── layout.html │ │ │ └── search.html │ │ ├── api.rst │ │ ├── basic-bootstrap │ │ │ ├── README │ │ │ ├── layout.html │ │ │ └── theme.conf │ │ ├── bootstrap │ │ │ ├── alerts.less │ │ │ ├── badges.less │ │ │ ├── bootstrap.less │ │ │ ├── breadcrumbs.less │ │ │ ├── button-groups.less │ │ │ ├── buttons.less │ │ │ ├── carousel.less │ │ │ ├── close.less │ │ │ ├── code.less │ │ │ ├── component-animations.less │ │ │ ├── dropdowns.less │ │ │ ├── forms.less │ │ │ ├── glyphicons.less │ │ │ ├── grid.less │ │ │ ├── input-groups.less │ │ │ ├── jumbotron.less │ │ │ ├── labels.less │ │ │ ├── list-group.less │ │ │ ├── media.less │ │ │ ├── mixins.less │ │ │ ├── mixins │ │ │ │ ├── alerts.less │ │ │ │ ├── background-variant.less │ │ │ │ ├── border-radius.less │ │ │ │ ├── buttons.less │ │ │ │ ├── center-block.less │ │ │ │ ├── clearfix.less │ │ │ │ ├── forms.less │ │ │ │ ├── gradients.less │ │ │ │ ├── grid-framework.less │ │ │ │ ├── grid.less │ │ │ │ ├── hide-text.less │ │ │ │ ├── image.less │ │ │ │ ├── labels.less │ │ │ │ ├── list-group.less │ │ │ │ ├── nav-divider.less │ │ │ │ ├── nav-vertical-align.less │ │ │ │ ├── opacity.less │ │ │ │ ├── pagination.less │ │ │ │ ├── panels.less │ │ │ │ ├── progress-bar.less │ │ │ │ ├── reset-filter.less │ │ │ │ ├── resize.less │ │ │ │ ├── responsive-visibility.less │ │ │ │ ├── size.less │ │ │ │ ├── tab-focus.less │ │ │ │ ├── table-row.less │ │ │ │ ├── text-emphasis.less │ │ │ │ ├── text-overflow.less │ │ │ │ └── vendor-prefixes.less │ │ │ ├── modals.less │ │ │ ├── navbar.less │ │ │ ├── navs.less │ │ │ ├── normalize.less │ │ │ ├── pager.less │ │ │ ├── pagination.less │ │ │ ├── panels.less │ │ │ ├── popovers.less │ │ │ ├── print.less │ │ │ ├── progress-bars.less │ │ │ ├── responsive-embed.less │ │ │ ├── responsive-utilities.less │ │ │ ├── scaffolding.less │ │ │ ├── tables.less │ │ │ ├── theme.less │ │ │ ├── thumbnails.less │ │ │ ├── tooltip.less │ │ │ ├── type.less │ │ │ ├── utilities.less │ │ │ ├── variables.less │ │ │ └── wells.less │ │ ├── build.py │ │ ├── conf.py │ │ ├── contents.rst │ │ ├── cppformat.less │ │ ├── html │ │ │ ├── _sources │ │ │ │ ├── api.txt │ │ │ │ ├── contents.txt │ │ │ │ ├── index.txt │ │ │ │ ├── syntax.txt │ │ │ │ └── usage.txt │ │ │ ├── _static │ │ │ │ ├── ajax-loader.gif │ │ │ │ ├── basic.css │ │ │ │ ├── bootstrap.min.js │ │ │ │ ├── comment-bright.png │ │ │ │ ├── comment-close.png │ │ │ │ ├── comment.png │ │ │ │ ├── cppformat.css │ │ │ │ ├── doctools.js │ │ │ │ ├── down-pressed.png │ │ │ │ ├── down.png │ │ │ │ ├── file.png │ │ │ │ ├── fonts │ │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ │ └── glyphicons-halflings-regular.woff │ │ │ │ ├── jquery-1.11.1.js │ │ │ │ ├── jquery.js │ │ │ │ ├── minus.png │ │ │ │ ├── plus.png │ │ │ │ ├── pygments.css │ │ │ │ ├── searchtools.js │ │ │ │ ├── underscore-1.3.1.js │ │ │ │ ├── underscore.js │ │ │ │ ├── up-pressed.png │ │ │ │ ├── up.png │ │ │ │ └── websupport.js │ │ │ ├── api.html │ │ │ ├── contents.html │ │ │ ├── genindex.html │ │ │ ├── index.html │ │ │ ├── objects.inv │ │ │ ├── search.html │ │ │ ├── searchindex.js │ │ │ ├── syntax.html │ │ │ └── usage.html │ │ ├── index.rst │ │ ├── python-license.txt │ │ ├── syntax.rst │ │ └── usage.rst │ │ ├── format.cc │ │ ├── format.h │ │ ├── gmock │ │ ├── gmock-gtest-all.cc │ │ ├── gmock │ │ │ └── gmock.h │ │ └── gtest │ │ │ ├── gtest-spi.h │ │ │ └── gtest.h │ │ ├── posix.cc │ │ ├── posix.h │ │ ├── support │ │ ├── README │ │ ├── appveyor-build.py │ │ ├── appveyor.yml │ │ ├── biicode-build.py │ │ ├── biicode │ │ │ ├── biicode.conf │ │ │ ├── ignore.bii │ │ │ └── sample.cc │ │ ├── cmake │ │ │ ├── FindSetEnv.cmake │ │ │ ├── biicode.cmake │ │ │ └── run-cmake.bat │ │ ├── download.py │ │ ├── release.py │ │ ├── rtd │ │ │ ├── conf.py │ │ │ ├── index.rst │ │ │ └── theme │ │ │ │ ├── layout.html │ │ │ │ └── theme.conf │ │ ├── timer.py │ │ ├── travis-build.py │ │ └── update-converity-branch.py │ │ └── test │ │ ├── CMakeLists.txt │ │ ├── assert-test.cc │ │ ├── compile-test │ │ └── CMakeLists.txt │ │ ├── format-impl-test.cc │ │ ├── format-test.cc │ │ ├── gtest-extra-test.cc │ │ ├── gtest-extra.cc │ │ ├── gtest-extra.h │ │ ├── header-only-test.cc │ │ ├── header-only-test2.cc │ │ ├── macro-test.cc │ │ ├── mock-allocator.h │ │ ├── posix-mock-test.cc │ │ ├── posix-mock.h │ │ ├── posix-test.cc │ │ ├── printf-test.cc │ │ ├── test-assert.h │ │ ├── test-main.cc │ │ ├── util-test.cc │ │ ├── util.cc │ │ └── util.h ├── expected │ ├── LICENSE │ ├── README.md │ └── include │ │ └── nonstd │ │ └── expected.hpp ├── optional │ ├── LICENSE_1_0.txt │ ├── README.md │ └── include │ │ └── optional │ │ └── optional.hpp ├── rapidxml │ ├── license.txt │ ├── manual.html │ ├── rapidxml.hpp │ ├── rapidxml_iterators.hpp │ ├── rapidxml_print.hpp │ └── rapidxml_utils.hpp ├── string_view │ ├── CREDITS.TXT │ ├── LICENSE.TXT │ ├── README.md │ └── string_view.hpp └── variant │ ├── .appveyor.yml │ ├── .travis.yml │ ├── CMakeLists.txt │ ├── LICENSE.txt │ ├── README.md │ ├── cmake │ └── eggs.variant-config.cmake.in │ ├── docs │ ├── README.md │ ├── config.md │ ├── css │ │ ├── img │ │ │ ├── bgcode.png │ │ │ └── favicon.png │ │ ├── main.css │ │ └── normalize.css │ ├── design.md │ ├── index.md │ ├── introduction.md │ ├── logo.png │ └── reference.Doxyfile │ ├── include │ └── eggs │ │ ├── variant.hpp │ │ └── variant │ │ ├── bad_variant_access.hpp │ │ ├── detail │ │ ├── apply.hpp │ │ ├── config │ │ │ ├── prefix.hpp │ │ │ └── suffix.hpp │ │ ├── pack.hpp │ │ ├── storage.hpp │ │ ├── utility.hpp │ │ └── visitor.hpp │ │ ├── in_place.hpp │ │ └── variant.hpp │ └── test │ ├── CMakeLists.txt │ ├── README.md │ ├── apply.cpp │ ├── assign.conversion.cpp │ ├── assign.copy.cpp │ ├── assign.emplace.cpp │ ├── assign.move.cpp │ ├── catch.cpp │ ├── catch.hpp │ ├── cnstr.conversion.cpp │ ├── cnstr.copy.cpp │ ├── cnstr.default.cpp │ ├── cnstr.emplace.cpp │ ├── cnstr.move.cpp │ ├── constexpr.hpp │ ├── dtor.cpp │ ├── dtor.hpp │ ├── elem.get.cpp │ ├── elem.get_if.cpp │ ├── hash.cpp │ ├── helper.cpp │ ├── in_place.cpp │ ├── obs.bool.cpp │ ├── obs.target.cpp │ ├── obs.target_type.cpp │ ├── obs.which.cpp │ ├── rel.equality.cpp │ ├── rel.order.cpp │ ├── swap.cpp │ └── throw.hpp ├── git-sha1.cpp.in ├── src ├── README.md ├── annotation.hpp ├── binary_fetcher.hpp ├── binary_writer.hpp ├── cdimage.hpp ├── codegen.cpp ├── codegen.hpp ├── commands.cpp ├── commands.hpp ├── compiler.cpp ├── compiler.hpp ├── config.cpp ├── cpp │ ├── any.hpp │ ├── argv.hpp │ ├── contracts.hpp │ ├── expected.hpp │ ├── file.hpp │ ├── filesystem.hpp │ ├── icompare.hpp │ ├── optional.hpp │ ├── scope_guard.hpp │ ├── small_vector.hpp │ ├── string_view.hpp │ └── variant.hpp ├── decompiler_ir2.hpp ├── disassembler.cpp ├── disassembler.hpp ├── main.cpp ├── main_compile.cpp ├── main_decompile.cpp ├── parser.hpp ├── parser_lexer.cpp ├── parser_syntax.cpp ├── program.cpp ├── program.hpp ├── script.cpp ├── script.hpp ├── stdinc.cpp ├── stdinc.h ├── symtable.cpp ├── symtable.hpp ├── system.cpp └── system.hpp ├── test ├── Checksum.sh ├── Discard.sh ├── GTA3ScriptTest.py ├── Not.sh ├── README.md ├── VerifyDiagnosticConsumer.py ├── codegen │ ├── 0001-var-offset.sc │ ├── 0001-var-offset │ │ └── mission.sc │ ├── 0002-multifile-local-offsets.sc │ ├── 0002-multifile-local-offsets │ │ ├── miss1.sc │ │ └── subscript.sc │ ├── 0003-call-scope-fix.sc │ ├── 0004-includers-label.sc │ ├── 0004-includers-label │ │ ├── miss1.sc │ │ └── subscript.sc │ ├── 0005-mission-vars-header.sc │ ├── 0005-mission-vars-header │ │ ├── miss1.sc │ │ └── miss2.sc │ ├── 0006-require-label-offset.sc │ ├── 0006-require-label-offset │ │ ├── a.sc │ │ └── b.sc │ ├── alternators.sc │ ├── andor.sc │ ├── arrays.sc │ ├── cheader_multifile.sc │ ├── cheader_multifile │ │ ├── miss1.sc │ │ ├── stream1.sc │ │ └── subscript1.sc │ ├── cheader_oatc.sc │ ├── cleo_call.sc │ ├── cleo_mission.sc │ ├── cleo_param.sc │ ├── cleo_script.sc │ ├── cleo_string.sc │ ├── cleo_string_3vc.sc │ ├── collectables.sc │ ├── const.sc │ ├── constant_precedence.sc │ ├── control_flow.sc │ ├── dump.sc │ ├── expr.sc │ ├── extension_lvar_eq_var.sc │ ├── extension_repeat_lvar.sc │ ├── models.sc │ ├── multifile.sc │ ├── multifile │ │ ├── gosub1.sc │ │ ├── gosub2.sc │ │ ├── gosub3.sc │ │ ├── subdir │ │ │ ├── mission1 │ │ │ │ └── mission1.sc │ │ │ ├── mission2 │ │ │ │ └── mission2.sc │ │ │ ├── mission3.sc │ │ │ └── subscript2.sc │ │ └── subscript1.sc │ ├── offsets.sc │ ├── offsets │ │ ├── gosub1.sc │ │ ├── mission1.sc │ │ ├── stream1.sc │ │ └── subscript1.sc │ ├── optimize_andor.sc │ ├── optimize_zero.sc │ ├── progress.sc │ ├── progress │ │ ├── prog2.sc │ │ └── prog5.sc │ ├── ranges.sc │ ├── require.sc │ ├── require │ │ ├── miss1.sc │ │ ├── requires │ │ │ ├── req1_from_main.sc │ │ │ ├── req2_from_extscript.sc │ │ │ ├── req3_from_subscript.sc │ │ │ ├── req4_from_miss1.sc │ │ │ ├── req5_from_stream1.sc │ │ │ ├── req6_from_everywhere.sc │ │ │ └── req7_from_subscript.sc │ │ ├── stream1.sc │ │ └── subscript.sc │ ├── require_cleo.sc │ ├── require_cleo │ │ └── req1.sc │ ├── save_string_to_debug_file.sc │ ├── scope.sc │ ├── skip_cutscene.sc │ ├── streaming.sc │ ├── streaming │ │ ├── attractor1.sc │ │ ├── brain1.sc │ │ ├── missions │ │ │ ├── mission1.sc │ │ │ └── mission2.sc │ │ ├── object1.sc │ │ ├── ped1.sc │ │ └── stream1.sc │ ├── switch_3vc.sc │ ├── switch_3vc_fail.sc │ ├── switch_sa.sc │ ├── text_label.sc │ ├── timers_3vc.sc │ ├── timers_sa.sc │ └── uppercase.sc ├── frontend │ ├── Inputs │ │ ├── override.xml │ │ └── test.xml │ ├── add_config.sc │ ├── override_config.sc │ └── switch.sc ├── lexer │ ├── commands.sc │ ├── comments.sc │ ├── dump.sc │ ├── expr.sc │ ├── label.sc │ ├── tokens.sc │ └── whitespaces.sc ├── lit.cfg ├── main │ ├── gta3.test │ └── gtavc.test ├── misc │ ├── expect_var_badindex.sc │ ├── expect_var_noexist_3vc.sc │ ├── expect_var_noexist_sa.sc │ ├── expect_var_okay_3.sc │ ├── expect_var_okay_sa.sc │ └── expect_var_okay_vc.sc ├── parser │ └── TODO ├── preprocessor │ ├── ifdef.sc │ └── syntax.sc └── semantics │ ├── Inputs │ └── data │ │ ├── default.dat │ │ ├── default.ide │ │ ├── gta.dat │ │ ├── gta3.dat │ │ ├── gta_vc.dat │ │ └── level.ide │ ├── arrays.sc │ ├── break-continue.sc │ ├── cleo_call_entity.sc │ ├── cleo_call_params.sc │ ├── cleo_call_text1.sc │ ├── cleo_call_text2.sc │ ├── cleo_disallow_global.sc │ ├── cleo_disallow_model.sc │ ├── cleo_disallow_scripts.sc │ ├── cleo_disallow_terminate.sc │ ├── collision.sc │ ├── collision │ └── gosub1.sc │ ├── commands.sc │ ├── control_flow.sc │ ├── directives.sc │ ├── directives │ ├── miss1.sc │ ├── miss2.sc │ ├── miss3.sc │ ├── miss4.sc │ ├── miss5.sc │ ├── stream1.sc │ └── subscript.sc │ ├── entity1.sc │ ├── entity2.sc │ ├── expr.sc │ ├── identifiers_3vc.sc │ ├── identifiers_sa.sc │ ├── identifiers_sa │ ├── 4x4.sc │ └── _a.sc │ ├── includers.sc │ ├── includers │ ├── gosub1.sc │ ├── something │ ├── something.sc2 │ └── subscript.sc │ ├── ranges.sc │ ├── repeat.sc │ ├── require.sc │ ├── require │ └── req1.sc │ ├── scopes.sc │ ├── script_name.sc │ ├── script_name │ └── miss1.sc │ ├── set_total.sc │ ├── skip_cutscene.sc │ ├── switch.sc │ ├── unsupported.sc │ ├── vars_scan_3vc.sc │ ├── vars_scan_sa.sc │ └── warn_conflict_text_label_var.sc └── utils ├── cmp_scmini.py ├── discover_constants.py ├── discover_entity_commands.py ├── discover_supported_commands.py ├── fix_sa.py ├── gta3sc ├── __init__.py ├── bytecode.py └── config.py ├── ir2_to_gta3.py ├── license.sh ├── make_hash.py ├── simplify.py └── test.py /.bumpversion.cfg: -------------------------------------------------------------------------------- 1 | [bumpversion] 2 | current_version = 0.9.7 3 | commit = True 4 | tag = True 5 | tag_name = {new_version} 6 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | *.sc linguist-vendored 2 | *.sh text eol=lf -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: cpp 2 | matrix: 3 | include: 4 | - compiler: gcc 5 | addons: 6 | apt: 7 | sources: [ 'ubuntu-toolchain-r-test' ] 8 | packages: [ 'gcc-6', 'g++-6' ] 9 | - compiler: clang 10 | addons: 11 | apt: 12 | sources: [ 'ubuntu-toolchain-r-test' ] 13 | packages: [ 'gcc-6', 'g++-6', 'libstdc++6' ] 14 | env: 15 | global: 16 | - LLVM_VERSION=3.8.0 17 | - LLVM_ARCHIVE_PATH=$HOME/clang+llvm.tar.xz 18 | before_install: 19 | - wget http://llvm.org/releases/$LLVM_VERSION/clang+llvm-$LLVM_VERSION-x86_64-linux-gnu-ubuntu-14.04.tar.xz -O $LLVM_ARCHIVE_PATH 20 | - mkdir $HOME/clang+llvm 21 | - tar xf $LLVM_ARCHIVE_PATH -C $HOME/clang+llvm --strip-components 1 22 | - export PATH=$HOME/clang+llvm/bin:$PATH 23 | install: 24 | - sudo pip install lit 25 | - sudo pip install OutputCheck 26 | script: 27 | - if [ "$CXX" == "g++" ]; then export CXX="g++-6"; fi 28 | - if [ "$CXX" == "clang++" ]; then export CXX="clang++"; fi 29 | - $CXX --version 30 | - lit --version 31 | - which OutputCheck 32 | - mkdir build 33 | - cd build 34 | - cmake .. && make 35 | - cd .. 36 | - export GTA3SC=$(readlink -f build/gta3sc) 37 | - lit test --verbose 38 | 39 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thelink2012/gta3sc/43aeb35e1f714394cd7f0f3f60472ee072b7d72c/LICENSE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # gta3sc 2 | 3 | [![Build Status](https://travis-ci.org/thelink2012/gta3sc.svg?branch=master)](https://travis-ci.org/thelink2012/gta3sc) 4 | 5 | This is a native script compiler/decompiler for the so called [GTA3script](http://www.gtamodding.com/wiki/SCM_language) language, used to design the mission scripts of the 3D Universe of the series. 6 | 7 | Due to its design, it can also be used as a framework for working with SCM data. See the README.md in the [src directory](src) for a technical overview. There's also a experimental Dynamic Recompiler in the [dynarec-x86](https://github.com/thelink2012/gta3sc/tree/dynarec-x86) branch. 8 | 9 | ## Building 10 | 11 | Windows (MSVC) and Linux (GCC/Clang) are currently supported, but you need the latest compiler toolchain of your platform due to the use of C++17. 12 | 13 | Just follow the standard CMake procedure for generating projects or makefiles. 14 | 15 | mkdir build 16 | cd build 17 | cmake .. 18 | 19 | Then `make` or use the generated project files. 20 | 21 | ## Using 22 | 23 | The compiler/decompiler is invoked by the file extension of the input file, or from the action `compile` or `decompile`. 24 | 25 | **Compilation example:** 26 | 27 | gta3sc main.sc --config=gta3 28 | gta3sc compile main.sc --config=gta3 # does the same thing as above 29 | 30 | **Decompilation example:** 31 | 32 | gta3sc main.scm --config=gta3 33 | gta3sc decompile main.scm --config=gta3 # does the same thing as above 34 | 35 | The decompiler is still very early and produces _very_ low-levelish code, so low that it cannot be recompiled back. High-level decompilation is supposed to be implemented later. 36 | 37 | **Help:** 38 | 39 | To get further instructions, try getting help from the utility. 40 | 41 | gta3sc --help 42 | 43 | 44 | ## Testing 45 | 46 | Ensuring a compiler is working correctly is a must. To help us on this task we use [llvm-lit](http://llvm.org/docs/CommandGuide/lit.html). While on the root of this tree, use the following command to run all the tests. 47 | 48 | lit test --verbose 49 | 50 | For further details, please refer to the [README.md](./test/README.md) on the test directory. 51 | -------------------------------------------------------------------------------- /config/CREDITS.txt: -------------------------------------------------------------------------------- 1 | + Thanks to Wesser for organizing the data present on miss2.exe, helped a lot when making the III/VC definitions. 2 | + Thanks to Deji for 1. GTAG Database; 2. SCRambl definitions; which helped on the making of the SA definitions (in fact, those were derived off SCRambl defs). -------------------------------------------------------------------------------- /config/gta3/commandline.txt: -------------------------------------------------------------------------------- 1 | --add-config=extensions.xml 2 | --levelfile=gta3.dat 3 | -mheader=gta3 4 | -mq11.4 5 | -mno-typed-text-label 6 | -mno-optimize-andor 7 | -fno-switch 8 | -fno-arrays 9 | -fno-const 10 | -fno-scope-then-label 11 | -fno-underscore-idents 12 | -fno-streamed-scripts 13 | -fno-text-label-vars 14 | -fno-skip-cutscene 15 | -ftimer-index=16 16 | -flocal-var-limit=16 17 | -fmission-var-begin=-1 18 | -fmission-var-limit=-1 19 | -fswitch-case-limit=-1 20 | -farray-elem-limit=-1 21 | -fno-constant-checks 22 | --expect-var=scplayer,script_controlled_player:11 23 | --expect-var=player:132 24 | --expect-var=flag_player_on_mission:207 -------------------------------------------------------------------------------- /config/gta3/extensions.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /config/gta3sc.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /config/gtasa/commandline.txt: -------------------------------------------------------------------------------- 1 | -Wconflict-text-label-var 2 | --add-config=sounds.xml 3 | --add-config=eventchoices.xml 4 | --add-config=taskchoices.xml 5 | --add-config=taskopcodes.xml 6 | --add-config=extensions.xml 7 | --levelfile=gta.dat 8 | -mheader=gtasa 9 | -mno-q11.4 10 | -mtyped-text-label 11 | -mno-optimize-andor 12 | -fswitch 13 | -farrays 14 | -fconst 15 | -fscope-then-label 16 | -funderscore-idents 17 | -fstreamed-scripts 18 | -ftext-label-vars 19 | -fskip-cutscene 20 | -ftimer-index=32 21 | -flocal-var-limit=32 22 | -fmission-var-begin=34 23 | -fmission-var-limit=1024 24 | -fswitch-case-limit=75 25 | -farray-elem-limit=255 26 | -fconstant-checks 27 | --expect-var=scplayer,script_controlled_player:3 28 | --expect-var=player:2 29 | --expect-var=flag_player_on_mission:409 30 | --expect-var=player_group:11 -------------------------------------------------------------------------------- /config/gtasa/extensions.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /config/gtavc/commandline.txt: -------------------------------------------------------------------------------- 1 | --add-config=extensions.xml 2 | --levelfile=gta_vc.dat 3 | -mheader=gtavc 4 | -mno-q11.4 5 | -mno-typed-text-label 6 | -mno-optimize-andor 7 | -fno-switch 8 | -fno-arrays 9 | -fno-const 10 | -fscope-then-label 11 | -fno-underscore-idents 12 | -fno-streamed-scripts 13 | -fno-text-label-vars 14 | -fno-skip-cutscene 15 | -ftimer-index=16 16 | -flocal-var-limit=16 17 | -fmission-var-begin=-1 18 | -fmission-var-limit=-1 19 | -fswitch-case-limit=-1 20 | -farray-elem-limit=-1 21 | -fconstant-checks 22 | --expect-var=scplayer,script_controlled_player:3 23 | --expect-var=player:2 24 | --expect-var=flag_player_on_mission:313 -------------------------------------------------------------------------------- /config/gtavc/extensions.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /deps/CMake/GetGitRevisionDescription.cmake.in: -------------------------------------------------------------------------------- 1 | # 2 | # Internal file for GetGitRevisionDescription.cmake 3 | # 4 | # Requires CMake 2.6 or newer (uses the 'function' command) 5 | # 6 | # Original Author: 7 | # 2009-2010 Ryan Pavlik 8 | # http://academic.cleardefinition.com 9 | # Iowa State University HCI Graduate Program/VRAC 10 | # 11 | # Copyright Iowa State University 2009-2010. 12 | # Distributed under the Boost Software License, Version 1.0. 13 | # (See accompanying file LICENSE_1_0.txt or copy at 14 | # http://www.boost.org/LICENSE_1_0.txt) 15 | 16 | set(HEAD_HASH) 17 | 18 | file(READ "@HEAD_FILE@" HEAD_CONTENTS LIMIT 1024) 19 | 20 | string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS) 21 | if(HEAD_CONTENTS MATCHES "ref") 22 | # named branch 23 | string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}") 24 | if(EXISTS "@GIT_DIR@/${HEAD_REF}") 25 | configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY) 26 | else() 27 | configure_file("@GIT_DIR@/packed-refs" "@GIT_DATA@/packed-refs" COPYONLY) 28 | file(READ "@GIT_DATA@/packed-refs" PACKED_REFS) 29 | if(${PACKED_REFS} MATCHES "([0-9a-z]*) ${HEAD_REF}") 30 | set(HEAD_HASH "${CMAKE_MATCH_1}") 31 | endif() 32 | endif() 33 | else() 34 | # detached HEAD 35 | configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY) 36 | endif() 37 | 38 | if(NOT HEAD_HASH) 39 | file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024) 40 | string(STRIP "${HEAD_HASH}" HEAD_HASH) 41 | endif() 42 | -------------------------------------------------------------------------------- /deps/SmallVector/LICENSE.TXT: -------------------------------------------------------------------------------- 1 | ============================================================================== 2 | LLVM Release License 3 | ============================================================================== 4 | University of Illinois/NCSA 5 | Open Source License 6 | 7 | Copyright (c) 2003-2016 University of Illinois at Urbana-Champaign. 8 | All rights reserved. 9 | 10 | Developed by: 11 | 12 | LLVM Team 13 | 14 | University of Illinois at Urbana-Champaign 15 | 16 | http://llvm.org 17 | 18 | Permission is hereby granted, free of charge, to any person obtaining a copy of 19 | this software and associated documentation files (the "Software"), to deal with 20 | the Software without restriction, including without limitation the rights to 21 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 22 | of the Software, and to permit persons to whom the Software is furnished to do 23 | so, subject to the following conditions: 24 | 25 | * Redistributions of source code must retain the above copyright notice, 26 | this list of conditions and the following disclaimers. 27 | 28 | * Redistributions in binary form must reproduce the above copyright notice, 29 | this list of conditions and the following disclaimers in the 30 | documentation and/or other materials provided with the distribution. 31 | 32 | * Neither the names of the LLVM Team, University of Illinois at 33 | Urbana-Champaign, nor the names of its contributors may be used to 34 | endorse or promote products derived from this Software without specific 35 | prior written permission. 36 | 37 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 38 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 39 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 40 | CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 41 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 42 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE 43 | SOFTWARE. 44 | -------------------------------------------------------------------------------- /deps/SmallVector/README.md: -------------------------------------------------------------------------------- 1 | # SmallVector 2 | 3 | This is [llvm::SmallVector](http://llvm.org/docs/doxygen/html/classllvm_1_1SmallVector.html) stripped from any LLVM dependency. 4 | -------------------------------------------------------------------------------- /deps/any/include/any/any.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thelink2012/gta3sc/43aeb35e1f714394cd7f0f3f60472ee072b7d72c/deps/any/include/any/any.hpp -------------------------------------------------------------------------------- /deps/cppformat/cppformat/.travis.yml: -------------------------------------------------------------------------------- 1 | language: cpp 2 | 3 | os: 4 | - linux 5 | - osx 6 | 7 | env: 8 | global: 9 | - secure: |- 10 | Gsnp9ERFnXt+diCfc7Vb72g+7HDn1MCHvw4zfUDdoBh9bxxFlLQRlzZZfwWhzni57lflrt 11 | 0QHXafu+oBVOJuNv6WauV3+ZyuWIQRmNGjZFNLvZsXHK/dyad2vGQBPvEkb+8l/aCyTpbr 12 | 6pxmyzLHSn1ZR7OX5rfPvwM3tOyZ3H0= 13 | matrix: 14 | - BUILD=Doc 15 | - BUILD=Debug 16 | - BUILD=Release 17 | 18 | matrix: 19 | exclude: 20 | - os: osx 21 | env: BUILD=Doc 22 | 23 | script: 24 | - support/travis-build.py 25 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/Android.mk: -------------------------------------------------------------------------------- 1 | LOCAL_PATH := $(call my-dir) 2 | include $(CLEAR_VARS) 3 | 4 | LOCAL_MODULE := cppformat_static 5 | LOCAL_MODULE_FILENAME := libcppformat 6 | 7 | LOCAL_SRC_FILES := format.cc 8 | 9 | LOCAL_C_INCLUDES := $(LOCAL_PATH) 10 | LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) 11 | 12 | LOCAL_CFLAGS += -std=c++11 -fexceptions 13 | 14 | include $(BUILD_STATIC_LIBRARY) 15 | 16 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/LICENSE.rst: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 - 2015, Victor Zverovich 2 | 3 | All rights reserved. 4 | 5 | Redistribution and use in source and binary forms, with or without 6 | modification, are permitted provided that the following conditions are met: 7 | 8 | 1. Redistributions of source code must retain the above copyright notice, this 9 | list of conditions and the following disclaimer. 10 | 2. Redistributions in binary form must reproduce the above copyright notice, 11 | this list of conditions and the following disclaimer in the documentation 12 | and/or other materials provided with the distribution. 13 | 14 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 15 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 16 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 17 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 18 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 19 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 20 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 21 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 23 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | find_program(DOXYGEN doxygen) 2 | if (NOT DOXYGEN) 3 | message(STATUS "Target 'doc' disabled (requires doxygen)") 4 | return () 5 | endif () 6 | 7 | add_custom_target(doc 8 | COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/build.py ${CPPFORMAT_VERSION}) 9 | 10 | install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/ 11 | DESTINATION share/doc/cppformat) 12 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/_static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thelink2012/gta3sc/43aeb35e1f714394cd7f0f3f60472ee072b7d72c/deps/cppformat/cppformat/doc/_static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/_static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thelink2012/gta3sc/43aeb35e1f714394cd7f0f3f60472ee072b7d72c/deps/cppformat/cppformat/doc/_static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/_static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thelink2012/gta3sc/43aeb35e1f714394cd7f0f3f60472ee072b7d72c/deps/cppformat/cppformat/doc/_static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/_templates/search.html: -------------------------------------------------------------------------------- 1 | {# 2 | basic/search.html 3 | ~~~~~~~~~~~~~~~~~ 4 | 5 | Template for the search page. 6 | 7 | :copyright: Copyright 2007-2015 by the Sphinx team, see AUTHORS. 8 | :license: BSD, see LICENSE for details. 9 | #} 10 | {%- extends "layout.html" %} 11 | {% set title = _('Search') %} 12 | {% set script_files = script_files + ['_static/searchtools.js'] %} 13 | {% block extrahead %} 14 | 17 | {# this is used when loading the search index using $.ajax fails, 18 | such as on Chrome for documents on localhost #} 19 | 20 | {{ super() }} 21 | {% endblock %} 22 | {% block body %} 23 |

{{ _('Search') }}

24 |
25 | 26 |

27 | {% trans %}Please activate JavaScript to enable the search 28 | functionality.{% endtrans %} 29 |

30 |
31 |

32 | {% trans %}From here you can search these documents. Enter your search 33 | words into the box below and click "search". Note that the search 34 | function will automatically search for all of the words. Pages 35 | containing fewer words won't appear in the result list.{% endtrans %} 36 |

37 | {{ searchform('form-inline', True) }} 38 | {% if search_performed %} 39 |

{{ _('Search Results') }}

40 | {% if not search_results %} 41 |

{{ _('Your search did not match any documents. Please make sure that all words are spelled correctly and that you\'ve selected enough categories.') }}

42 | {% endif %} 43 | {% endif %} 44 |
45 | {% if search_results %} 46 |
    47 | {% for href, caption, context in search_results %} 48 |
  • {{ caption }} 49 |
    {{ context|e }}
    50 |
  • 51 | {% endfor %} 52 |
53 | {% endif %} 54 |
55 | {% endblock %} 56 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/basic-bootstrap/README: -------------------------------------------------------------------------------- 1 | Sphinx basic theme with Bootstrap support. Modifications are kept to 2 | a minimum to simplify integration in case of changes to Sphinx theming. 3 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/basic-bootstrap/theme.conf: -------------------------------------------------------------------------------- 1 | [theme] 2 | inherit = basic 3 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/bootstrap/alerts.less: -------------------------------------------------------------------------------- 1 | // 2 | // Alerts 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base styles 7 | // ------------------------- 8 | 9 | .alert { 10 | padding: @alert-padding; 11 | margin-bottom: @line-height-computed; 12 | border: 1px solid transparent; 13 | border-radius: @alert-border-radius; 14 | 15 | // Headings for larger alerts 16 | h4 { 17 | margin-top: 0; 18 | // Specified for the h4 to prevent conflicts of changing @headings-color 19 | color: inherit; 20 | } 21 | 22 | // Provide class for links that match alerts 23 | .alert-link { 24 | font-weight: @alert-link-font-weight; 25 | } 26 | 27 | // Improve alignment and spacing of inner content 28 | > p, 29 | > ul { 30 | margin-bottom: 0; 31 | } 32 | 33 | > p + p { 34 | margin-top: 5px; 35 | } 36 | } 37 | 38 | // Dismissible alerts 39 | // 40 | // Expand the right padding and account for the close button's positioning. 41 | 42 | .alert-dismissable, // The misspelled .alert-dismissable was deprecated in 3.2.0. 43 | .alert-dismissible { 44 | padding-right: (@alert-padding + 20); 45 | 46 | // Adjust close link position 47 | .close { 48 | position: relative; 49 | top: -2px; 50 | right: -21px; 51 | color: inherit; 52 | } 53 | } 54 | 55 | // Alternate styles 56 | // 57 | // Generate contextual modifier classes for colorizing the alert. 58 | 59 | .alert-success { 60 | .alert-variant(@alert-success-bg; @alert-success-border; @alert-success-text); 61 | } 62 | 63 | .alert-info { 64 | .alert-variant(@alert-info-bg; @alert-info-border; @alert-info-text); 65 | } 66 | 67 | .alert-warning { 68 | .alert-variant(@alert-warning-bg; @alert-warning-border; @alert-warning-text); 69 | } 70 | 71 | .alert-danger { 72 | .alert-variant(@alert-danger-bg; @alert-danger-border; @alert-danger-text); 73 | } 74 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/bootstrap/badges.less: -------------------------------------------------------------------------------- 1 | // 2 | // Badges 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base class 7 | .badge { 8 | display: inline-block; 9 | min-width: 10px; 10 | padding: 3px 7px; 11 | font-size: @font-size-small; 12 | font-weight: @badge-font-weight; 13 | color: @badge-color; 14 | line-height: @badge-line-height; 15 | vertical-align: baseline; 16 | white-space: nowrap; 17 | text-align: center; 18 | background-color: @badge-bg; 19 | border-radius: @badge-border-radius; 20 | 21 | // Empty badges collapse automatically (not available in IE8) 22 | &:empty { 23 | display: none; 24 | } 25 | 26 | // Quick fix for badges in buttons 27 | .btn & { 28 | position: relative; 29 | top: -1px; 30 | } 31 | 32 | .btn-xs &, 33 | .btn-group-xs > .btn & { 34 | top: 0; 35 | padding: 1px 5px; 36 | } 37 | 38 | // Hover state, but only for links 39 | a& { 40 | &:hover, 41 | &:focus { 42 | color: @badge-link-hover-color; 43 | text-decoration: none; 44 | cursor: pointer; 45 | } 46 | } 47 | 48 | // Account for badges in navs 49 | .list-group-item.active > &, 50 | .nav-pills > .active > a > & { 51 | color: @badge-active-color; 52 | background-color: @badge-active-bg; 53 | } 54 | 55 | .list-group-item > & { 56 | float: right; 57 | } 58 | 59 | .list-group-item > & + & { 60 | margin-right: 5px; 61 | } 62 | 63 | .nav-pills > li > a > & { 64 | margin-left: 3px; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/bootstrap/bootstrap.less: -------------------------------------------------------------------------------- 1 | // Core variables and mixins 2 | @import "variables.less"; 3 | @import "mixins.less"; 4 | 5 | // Reset and dependencies 6 | @import "normalize.less"; 7 | @import "print.less"; 8 | @import "glyphicons.less"; 9 | 10 | // Core CSS 11 | @import "scaffolding.less"; 12 | @import "type.less"; 13 | @import "code.less"; 14 | @import "grid.less"; 15 | @import "tables.less"; 16 | @import "forms.less"; 17 | @import "buttons.less"; 18 | 19 | // Components 20 | @import "component-animations.less"; 21 | @import "dropdowns.less"; 22 | @import "button-groups.less"; 23 | @import "input-groups.less"; 24 | @import "navs.less"; 25 | @import "navbar.less"; 26 | @import "breadcrumbs.less"; 27 | @import "pagination.less"; 28 | @import "pager.less"; 29 | @import "labels.less"; 30 | @import "badges.less"; 31 | @import "jumbotron.less"; 32 | @import "thumbnails.less"; 33 | @import "alerts.less"; 34 | @import "progress-bars.less"; 35 | @import "media.less"; 36 | @import "list-group.less"; 37 | @import "panels.less"; 38 | @import "responsive-embed.less"; 39 | @import "wells.less"; 40 | @import "close.less"; 41 | 42 | // Components w/ JavaScript 43 | @import "modals.less"; 44 | @import "tooltip.less"; 45 | @import "popovers.less"; 46 | @import "carousel.less"; 47 | 48 | // Utility classes 49 | @import "utilities.less"; 50 | @import "responsive-utilities.less"; 51 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/bootstrap/breadcrumbs.less: -------------------------------------------------------------------------------- 1 | // 2 | // Breadcrumbs 3 | // -------------------------------------------------- 4 | 5 | 6 | .breadcrumb { 7 | padding: @breadcrumb-padding-vertical @breadcrumb-padding-horizontal; 8 | margin-bottom: @line-height-computed; 9 | list-style: none; 10 | background-color: @breadcrumb-bg; 11 | border-radius: @border-radius-base; 12 | 13 | > li { 14 | display: inline-block; 15 | 16 | + li:before { 17 | content: "@{breadcrumb-separator}\00a0"; // Unicode space added since inline-block means non-collapsing white-space 18 | padding: 0 5px; 19 | color: @breadcrumb-color; 20 | } 21 | } 22 | 23 | > .active { 24 | color: @breadcrumb-active-color; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/bootstrap/close.less: -------------------------------------------------------------------------------- 1 | // 2 | // Close icons 3 | // -------------------------------------------------- 4 | 5 | 6 | .close { 7 | float: right; 8 | font-size: (@font-size-base * 1.5); 9 | font-weight: @close-font-weight; 10 | line-height: 1; 11 | color: @close-color; 12 | text-shadow: @close-text-shadow; 13 | .opacity(.2); 14 | 15 | &:hover, 16 | &:focus { 17 | color: @close-color; 18 | text-decoration: none; 19 | cursor: pointer; 20 | .opacity(.5); 21 | } 22 | 23 | // Additional properties for button version 24 | // iOS requires the button element instead of an anchor tag. 25 | // If you want the anchor version, it requires `href="#"`. 26 | // See https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile 27 | button& { 28 | padding: 0; 29 | cursor: pointer; 30 | background: transparent; 31 | border: 0; 32 | -webkit-appearance: none; 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/bootstrap/code.less: -------------------------------------------------------------------------------- 1 | // 2 | // Code (inline and block) 3 | // -------------------------------------------------- 4 | 5 | 6 | // Inline and block code styles 7 | code, 8 | kbd, 9 | pre, 10 | samp { 11 | font-family: @font-family-monospace; 12 | } 13 | 14 | // Inline code 15 | code { 16 | padding: 2px 4px; 17 | font-size: 90%; 18 | color: @code-color; 19 | background-color: @code-bg; 20 | border-radius: @border-radius-base; 21 | } 22 | 23 | // User input typically entered via keyboard 24 | kbd { 25 | padding: 2px 4px; 26 | font-size: 90%; 27 | color: @kbd-color; 28 | background-color: @kbd-bg; 29 | border-radius: @border-radius-small; 30 | box-shadow: inset 0 -1px 0 rgba(0,0,0,.25); 31 | 32 | kbd { 33 | padding: 0; 34 | font-size: 100%; 35 | font-weight: bold; 36 | box-shadow: none; 37 | } 38 | } 39 | 40 | // Blocks of code 41 | pre { 42 | display: block; 43 | padding: ((@line-height-computed - 1) / 2); 44 | margin: 0 0 (@line-height-computed / 2); 45 | font-size: (@font-size-base - 1); // 14px to 13px 46 | line-height: @line-height-base; 47 | word-break: break-all; 48 | word-wrap: break-word; 49 | color: @pre-color; 50 | background-color: @pre-bg; 51 | border: 1px solid @pre-border-color; 52 | border-radius: @border-radius-base; 53 | 54 | // Account for some code outputs that place code tags in pre tags 55 | code { 56 | padding: 0; 57 | font-size: inherit; 58 | color: inherit; 59 | white-space: pre-wrap; 60 | background-color: transparent; 61 | border-radius: 0; 62 | } 63 | } 64 | 65 | // Enable scrollable blocks of code 66 | .pre-scrollable { 67 | max-height: @pre-scrollable-max-height; 68 | overflow-y: scroll; 69 | } 70 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/bootstrap/component-animations.less: -------------------------------------------------------------------------------- 1 | // 2 | // Component animations 3 | // -------------------------------------------------- 4 | 5 | // Heads up! 6 | // 7 | // We don't use the `.opacity()` mixin here since it causes a bug with text 8 | // fields in IE7-8. Source: https://github.com/twbs/bootstrap/pull/3552. 9 | 10 | .fade { 11 | opacity: 0; 12 | .transition(opacity .15s linear); 13 | &.in { 14 | opacity: 1; 15 | } 16 | } 17 | 18 | .collapse { 19 | display: none; 20 | 21 | &.in { display: block; } 22 | tr&.in { display: table-row; } 23 | tbody&.in { display: table-row-group; } 24 | } 25 | 26 | .collapsing { 27 | position: relative; 28 | height: 0; 29 | overflow: hidden; 30 | .transition-property(~"height, visibility"); 31 | .transition-duration(.35s); 32 | .transition-timing-function(ease); 33 | } 34 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/bootstrap/grid.less: -------------------------------------------------------------------------------- 1 | // 2 | // Grid system 3 | // -------------------------------------------------- 4 | 5 | 6 | // Container widths 7 | // 8 | // Set the container width, and override it for fixed navbars in media queries. 9 | 10 | .tb-container { 11 | .container-fixed(); 12 | 13 | @media (min-width: @screen-sm-min) { 14 | width: @container-sm; 15 | } 16 | @media (min-width: @screen-md-min) { 17 | width: @container-md; 18 | } 19 | @media (min-width: @screen-lg-min) { 20 | width: @container-lg; 21 | } 22 | } 23 | 24 | 25 | // Fluid container 26 | // 27 | // Utilizes the mixin meant for fixed width containers, but without any defined 28 | // width for fluid, full width layouts. 29 | 30 | .container-fluid { 31 | .container-fixed(); 32 | } 33 | 34 | 35 | // Row 36 | // 37 | // Rows contain and clear the floats of your columns. 38 | 39 | .row { 40 | .make-row(); 41 | } 42 | 43 | 44 | // Columns 45 | // 46 | // Common styles for small and large grid columns 47 | 48 | .make-grid-columns(); 49 | 50 | 51 | // Extra small grid 52 | // 53 | // Columns, offsets, pushes, and pulls for extra small devices like 54 | // smartphones. 55 | 56 | .make-grid(xs); 57 | 58 | 59 | // Small grid 60 | // 61 | // Columns, offsets, pushes, and pulls for the small device range, from phones 62 | // to tablets. 63 | 64 | @media (min-width: @screen-sm-min) { 65 | .make-grid(sm); 66 | } 67 | 68 | 69 | // Medium grid 70 | // 71 | // Columns, offsets, pushes, and pulls for the desktop device range. 72 | 73 | @media (min-width: @screen-md-min) { 74 | .make-grid(md); 75 | } 76 | 77 | 78 | // Large grid 79 | // 80 | // Columns, offsets, pushes, and pulls for the large desktop device range. 81 | 82 | @media (min-width: @screen-lg-min) { 83 | .make-grid(lg); 84 | } 85 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/bootstrap/jumbotron.less: -------------------------------------------------------------------------------- 1 | // 2 | // Jumbotron 3 | // -------------------------------------------------- 4 | 5 | 6 | .jumbotron { 7 | padding: @jumbotron-padding (@jumbotron-padding / 2); 8 | margin-bottom: @jumbotron-padding; 9 | color: @jumbotron-color; 10 | background-color: @jumbotron-bg; 11 | 12 | h1, 13 | .h1 { 14 | color: @jumbotron-heading-color; 15 | } 16 | 17 | p { 18 | margin-bottom: (@jumbotron-padding / 2); 19 | font-size: @jumbotron-font-size; 20 | font-weight: 200; 21 | } 22 | 23 | > hr { 24 | border-top-color: darken(@jumbotron-bg, 10%); 25 | } 26 | 27 | .tb-container &, 28 | .container-fluid & { 29 | border-radius: @border-radius-large; // Only round corners at higher resolutions if contained in a container 30 | } 31 | 32 | .tb-container { 33 | max-width: 100%; 34 | } 35 | 36 | @media screen and (min-width: @screen-sm-min) { 37 | padding: (@jumbotron-padding * 1.6) 0; 38 | 39 | .tb-container &, 40 | .container-fluid & { 41 | padding-left: (@jumbotron-padding * 2); 42 | padding-right: (@jumbotron-padding * 2); 43 | } 44 | 45 | h1, 46 | .h1 { 47 | font-size: (@font-size-base * 4.5); 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/bootstrap/labels.less: -------------------------------------------------------------------------------- 1 | // 2 | // Labels 3 | // -------------------------------------------------- 4 | 5 | .label { 6 | display: inline; 7 | padding: .2em .6em .3em; 8 | font-size: 75%; 9 | font-weight: bold; 10 | line-height: 1; 11 | color: @label-color; 12 | text-align: center; 13 | white-space: nowrap; 14 | vertical-align: baseline; 15 | border-radius: .25em; 16 | 17 | // Add hover effects, but only for links 18 | a& { 19 | &:hover, 20 | &:focus { 21 | color: @label-link-hover-color; 22 | text-decoration: none; 23 | cursor: pointer; 24 | } 25 | } 26 | 27 | // Empty labels collapse automatically (not available in IE8) 28 | &:empty { 29 | display: none; 30 | } 31 | 32 | // Quick fix for labels in buttons 33 | .btn & { 34 | position: relative; 35 | top: -1px; 36 | } 37 | } 38 | 39 | // Colors 40 | // Contextual variations (linked labels get darker on :hover) 41 | 42 | .label-default { 43 | .label-variant(@label-default-bg); 44 | } 45 | 46 | .label-primary { 47 | .label-variant(@label-primary-bg); 48 | } 49 | 50 | .label-success { 51 | .label-variant(@label-success-bg); 52 | } 53 | 54 | .label-info { 55 | .label-variant(@label-info-bg); 56 | } 57 | 58 | .label-warning { 59 | .label-variant(@label-warning-bg); 60 | } 61 | 62 | .label-danger { 63 | .label-variant(@label-danger-bg); 64 | } 65 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/bootstrap/media.less: -------------------------------------------------------------------------------- 1 | .media { 2 | // Proper spacing between instances of .media 3 | margin-top: 15px; 4 | 5 | &:first-child { 6 | margin-top: 0; 7 | } 8 | } 9 | 10 | .media, 11 | .media-body { 12 | zoom: 1; 13 | overflow: hidden; 14 | } 15 | 16 | .media-body { 17 | width: 10000px; 18 | } 19 | 20 | .media-object { 21 | display: block; 22 | } 23 | 24 | .media-right, 25 | .media > .pull-right { 26 | padding-left: 10px; 27 | } 28 | 29 | .media-left, 30 | .media > .pull-left { 31 | padding-right: 10px; 32 | } 33 | 34 | .media-left, 35 | .media-right, 36 | .media-body { 37 | display: table-cell; 38 | vertical-align: top; 39 | } 40 | 41 | .media-middle { 42 | vertical-align: middle; 43 | } 44 | 45 | .media-bottom { 46 | vertical-align: bottom; 47 | } 48 | 49 | // Reset margins on headings for tighter default spacing 50 | .media-heading { 51 | margin-top: 0; 52 | margin-bottom: 5px; 53 | } 54 | 55 | // Media list variation 56 | // 57 | // Undo default ul/ol styles 58 | .media-list { 59 | padding-left: 0; 60 | list-style: none; 61 | } 62 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/bootstrap/mixins.less: -------------------------------------------------------------------------------- 1 | // Mixins 2 | // -------------------------------------------------- 3 | 4 | // Utilities 5 | @import "mixins/hide-text.less"; 6 | @import "mixins/opacity.less"; 7 | @import "mixins/image.less"; 8 | @import "mixins/labels.less"; 9 | @import "mixins/reset-filter.less"; 10 | @import "mixins/resize.less"; 11 | @import "mixins/responsive-visibility.less"; 12 | @import "mixins/size.less"; 13 | @import "mixins/tab-focus.less"; 14 | @import "mixins/text-emphasis.less"; 15 | @import "mixins/text-overflow.less"; 16 | @import "mixins/vendor-prefixes.less"; 17 | 18 | // Components 19 | @import "mixins/alerts.less"; 20 | @import "mixins/buttons.less"; 21 | @import "mixins/panels.less"; 22 | @import "mixins/pagination.less"; 23 | @import "mixins/list-group.less"; 24 | @import "mixins/nav-divider.less"; 25 | @import "mixins/forms.less"; 26 | @import "mixins/progress-bar.less"; 27 | @import "mixins/table-row.less"; 28 | 29 | // Skins 30 | @import "mixins/background-variant.less"; 31 | @import "mixins/border-radius.less"; 32 | @import "mixins/gradients.less"; 33 | 34 | // Layout 35 | @import "mixins/clearfix.less"; 36 | @import "mixins/center-block.less"; 37 | @import "mixins/nav-vertical-align.less"; 38 | @import "mixins/grid-framework.less"; 39 | @import "mixins/grid.less"; 40 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/bootstrap/mixins/alerts.less: -------------------------------------------------------------------------------- 1 | // Alerts 2 | 3 | .alert-variant(@background; @border; @text-color) { 4 | background-color: @background; 5 | border-color: @border; 6 | color: @text-color; 7 | 8 | hr { 9 | border-top-color: darken(@border, 5%); 10 | } 11 | .alert-link { 12 | color: darken(@text-color, 10%); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/bootstrap/mixins/background-variant.less: -------------------------------------------------------------------------------- 1 | // Contextual backgrounds 2 | 3 | .bg-variant(@color) { 4 | background-color: @color; 5 | a&:hover { 6 | background-color: darken(@color, 10%); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/bootstrap/mixins/border-radius.less: -------------------------------------------------------------------------------- 1 | // Single side border-radius 2 | 3 | .border-top-radius(@radius) { 4 | border-top-right-radius: @radius; 5 | border-top-left-radius: @radius; 6 | } 7 | .border-right-radius(@radius) { 8 | border-bottom-right-radius: @radius; 9 | border-top-right-radius: @radius; 10 | } 11 | .border-bottom-radius(@radius) { 12 | border-bottom-right-radius: @radius; 13 | border-bottom-left-radius: @radius; 14 | } 15 | .border-left-radius(@radius) { 16 | border-bottom-left-radius: @radius; 17 | border-top-left-radius: @radius; 18 | } 19 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/bootstrap/mixins/buttons.less: -------------------------------------------------------------------------------- 1 | // Button variants 2 | // 3 | // Easily pump out default styles, as well as :hover, :focus, :active, 4 | // and disabled options for all buttons 5 | 6 | .button-variant(@color; @background; @border) { 7 | color: @color; 8 | background-color: @background; 9 | border-color: @border; 10 | 11 | &:hover, 12 | &:focus, 13 | &.focus, 14 | &:active, 15 | &.active, 16 | .open > .dropdown-toggle& { 17 | color: @color; 18 | background-color: darken(@background, 10%); 19 | border-color: darken(@border, 12%); 20 | } 21 | &:active, 22 | &.active, 23 | .open > .dropdown-toggle& { 24 | background-image: none; 25 | } 26 | &.disabled, 27 | &[disabled], 28 | fieldset[disabled] & { 29 | &, 30 | &:hover, 31 | &:focus, 32 | &.focus, 33 | &:active, 34 | &.active { 35 | background-color: @background; 36 | border-color: @border; 37 | } 38 | } 39 | 40 | .badge { 41 | color: @background; 42 | background-color: @color; 43 | } 44 | } 45 | 46 | // Button sizes 47 | .button-size(@padding-vertical; @padding-horizontal; @font-size; @line-height; @border-radius) { 48 | padding: @padding-vertical @padding-horizontal; 49 | font-size: @font-size; 50 | line-height: @line-height; 51 | border-radius: @border-radius; 52 | } 53 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/bootstrap/mixins/center-block.less: -------------------------------------------------------------------------------- 1 | // Center-align a block level element 2 | 3 | .center-block() { 4 | display: block; 5 | margin-left: auto; 6 | margin-right: auto; 7 | } 8 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/bootstrap/mixins/clearfix.less: -------------------------------------------------------------------------------- 1 | // Clearfix 2 | // 3 | // For modern browsers 4 | // 1. The space content is one way to avoid an Opera bug when the 5 | // contenteditable attribute is included anywhere else in the document. 6 | // Otherwise it causes space to appear at the top and bottom of elements 7 | // that are clearfixed. 8 | // 2. The use of `table` rather than `block` is only necessary if using 9 | // `:before` to contain the top-margins of child elements. 10 | // 11 | // Source: http://nicolasgallagher.com/micro-clearfix-hack/ 12 | 13 | .clearfix() { 14 | &:before, 15 | &:after { 16 | content: " "; // 1 17 | display: table; // 2 18 | } 19 | &:after { 20 | clear: both; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/bootstrap/mixins/hide-text.less: -------------------------------------------------------------------------------- 1 | // CSS image replacement 2 | // 3 | // Heads up! v3 launched with with only `.hide-text()`, but per our pattern for 4 | // mixins being reused as classes with the same name, this doesn't hold up. As 5 | // of v3.0.1 we have added `.text-hide()` and deprecated `.hide-text()`. 6 | // 7 | // Source: https://github.com/h5bp/html5-boilerplate/commit/aa0396eae757 8 | 9 | // Deprecated as of v3.0.1 (will be removed in v4) 10 | .hide-text() { 11 | font: ~"0/0" a; 12 | color: transparent; 13 | text-shadow: none; 14 | background-color: transparent; 15 | border: 0; 16 | } 17 | 18 | // New mixin to use as of v3.0.1 19 | .text-hide() { 20 | .hide-text(); 21 | } 22 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/bootstrap/mixins/image.less: -------------------------------------------------------------------------------- 1 | // Image Mixins 2 | // - Responsive image 3 | // - Retina image 4 | 5 | 6 | // Responsive image 7 | // 8 | // Keep images from scaling beyond the width of their parents. 9 | .img-responsive(@display: block) { 10 | display: @display; 11 | max-width: 100%; // Part 1: Set a maximum relative to the parent 12 | height: auto; // Part 2: Scale the height according to the width, otherwise you get stretching 13 | } 14 | 15 | 16 | // Retina image 17 | // 18 | // Short retina mixin for setting background-image and -size. Note that the 19 | // spelling of `min--moz-device-pixel-ratio` is intentional. 20 | .img-retina(@file-1x; @file-2x; @width-1x; @height-1x) { 21 | background-image: url("@{file-1x}"); 22 | 23 | @media 24 | only screen and (-webkit-min-device-pixel-ratio: 2), 25 | only screen and ( min--moz-device-pixel-ratio: 2), 26 | only screen and ( -o-min-device-pixel-ratio: 2/1), 27 | only screen and ( min-device-pixel-ratio: 2), 28 | only screen and ( min-resolution: 192dpi), 29 | only screen and ( min-resolution: 2dppx) { 30 | background-image: url("@{file-2x}"); 31 | background-size: @width-1x @height-1x; 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/bootstrap/mixins/labels.less: -------------------------------------------------------------------------------- 1 | // Labels 2 | 3 | .label-variant(@color) { 4 | background-color: @color; 5 | 6 | &[href] { 7 | &:hover, 8 | &:focus { 9 | background-color: darken(@color, 10%); 10 | } 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/bootstrap/mixins/list-group.less: -------------------------------------------------------------------------------- 1 | // List Groups 2 | 3 | .list-group-item-variant(@state; @background; @color) { 4 | .list-group-item-@{state} { 5 | color: @color; 6 | background-color: @background; 7 | 8 | a& { 9 | color: @color; 10 | 11 | .list-group-item-heading { 12 | color: inherit; 13 | } 14 | 15 | &:hover, 16 | &:focus { 17 | color: @color; 18 | background-color: darken(@background, 5%); 19 | } 20 | &.active, 21 | &.active:hover, 22 | &.active:focus { 23 | color: #fff; 24 | background-color: @color; 25 | border-color: @color; 26 | } 27 | } 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/bootstrap/mixins/nav-divider.less: -------------------------------------------------------------------------------- 1 | // Horizontal dividers 2 | // 3 | // Dividers (basically an hr) within dropdowns and nav lists 4 | 5 | .nav-divider(@color: #e5e5e5) { 6 | height: 1px; 7 | margin: ((@line-height-computed / 2) - 1) 0; 8 | overflow: hidden; 9 | background-color: @color; 10 | } 11 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/bootstrap/mixins/nav-vertical-align.less: -------------------------------------------------------------------------------- 1 | // Navbar vertical align 2 | // 3 | // Vertically center elements in the navbar. 4 | // Example: an element has a height of 30px, so write out `.navbar-vertical-align(30px);` to calculate the appropriate top margin. 5 | 6 | .navbar-vertical-align(@element-height) { 7 | margin-top: ((@navbar-height - @element-height) / 2); 8 | margin-bottom: ((@navbar-height - @element-height) / 2); 9 | } 10 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/bootstrap/mixins/opacity.less: -------------------------------------------------------------------------------- 1 | // Opacity 2 | 3 | .opacity(@opacity) { 4 | opacity: @opacity; 5 | // IE8 filter 6 | @opacity-ie: (@opacity * 100); 7 | filter: ~"alpha(opacity=@{opacity-ie})"; 8 | } 9 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/bootstrap/mixins/pagination.less: -------------------------------------------------------------------------------- 1 | // Pagination 2 | 3 | .pagination-size(@padding-vertical; @padding-horizontal; @font-size; @border-radius) { 4 | > li { 5 | > a, 6 | > span { 7 | padding: @padding-vertical @padding-horizontal; 8 | font-size: @font-size; 9 | } 10 | &:first-child { 11 | > a, 12 | > span { 13 | .border-left-radius(@border-radius); 14 | } 15 | } 16 | &:last-child { 17 | > a, 18 | > span { 19 | .border-right-radius(@border-radius); 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/bootstrap/mixins/panels.less: -------------------------------------------------------------------------------- 1 | // Panels 2 | 3 | .panel-variant(@border; @heading-text-color; @heading-bg-color; @heading-border) { 4 | border-color: @border; 5 | 6 | & > .panel-heading { 7 | color: @heading-text-color; 8 | background-color: @heading-bg-color; 9 | border-color: @heading-border; 10 | 11 | + .panel-collapse > .panel-body { 12 | border-top-color: @border; 13 | } 14 | .badge { 15 | color: @heading-bg-color; 16 | background-color: @heading-text-color; 17 | } 18 | } 19 | & > .panel-footer { 20 | + .panel-collapse > .panel-body { 21 | border-bottom-color: @border; 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/bootstrap/mixins/progress-bar.less: -------------------------------------------------------------------------------- 1 | // Progress bars 2 | 3 | .progress-bar-variant(@color) { 4 | background-color: @color; 5 | 6 | // Deprecated parent class requirement as of v3.2.0 7 | .progress-striped & { 8 | #gradient > .striped(); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/bootstrap/mixins/reset-filter.less: -------------------------------------------------------------------------------- 1 | // Reset filters for IE 2 | // 3 | // When you need to remove a gradient background, do not forget to use this to reset 4 | // the IE filter for IE9 and below. 5 | 6 | .reset-filter() { 7 | filter: e(%("progid:DXImageTransform.Microsoft.gradient(enabled = false)")); 8 | } 9 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/bootstrap/mixins/resize.less: -------------------------------------------------------------------------------- 1 | // Resize anything 2 | 3 | .resizable(@direction) { 4 | resize: @direction; // Options: horizontal, vertical, both 5 | overflow: auto; // Per CSS3 UI, `resize` only applies when `overflow` isn't `visible` 6 | } 7 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/bootstrap/mixins/responsive-visibility.less: -------------------------------------------------------------------------------- 1 | // Responsive utilities 2 | 3 | // 4 | // More easily include all the states for responsive-utilities.less. 5 | .responsive-visibility() { 6 | display: block !important; 7 | table& { display: table; } 8 | tr& { display: table-row !important; } 9 | th&, 10 | td& { display: table-cell !important; } 11 | } 12 | 13 | .responsive-invisibility() { 14 | display: none !important; 15 | } 16 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/bootstrap/mixins/size.less: -------------------------------------------------------------------------------- 1 | // Sizing shortcuts 2 | 3 | .size(@width; @height) { 4 | width: @width; 5 | height: @height; 6 | } 7 | 8 | .square(@size) { 9 | .size(@size; @size); 10 | } 11 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/bootstrap/mixins/tab-focus.less: -------------------------------------------------------------------------------- 1 | // WebKit-style focus 2 | 3 | .tab-focus() { 4 | // Default 5 | outline: thin dotted; 6 | // WebKit 7 | outline: 5px auto -webkit-focus-ring-color; 8 | outline-offset: -2px; 9 | } 10 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/bootstrap/mixins/table-row.less: -------------------------------------------------------------------------------- 1 | // Tables 2 | 3 | .table-row-variant(@state; @background) { 4 | // Exact selectors below required to override `.table-striped` and prevent 5 | // inheritance to nested tables. 6 | .table > thead > tr, 7 | .table > tbody > tr, 8 | .table > tfoot > tr { 9 | > td.@{state}, 10 | > th.@{state}, 11 | &.@{state} > td, 12 | &.@{state} > th { 13 | background-color: @background; 14 | } 15 | } 16 | 17 | // Hover states for `.table-hover` 18 | // Note: this is not available for cells or rows within `thead` or `tfoot`. 19 | .table-hover > tbody > tr { 20 | > td.@{state}:hover, 21 | > th.@{state}:hover, 22 | &.@{state}:hover > td, 23 | &:hover > .@{state}, 24 | &.@{state}:hover > th { 25 | background-color: darken(@background, 5%); 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/bootstrap/mixins/text-emphasis.less: -------------------------------------------------------------------------------- 1 | // Typography 2 | 3 | .text-emphasis-variant(@color) { 4 | color: @color; 5 | a&:hover { 6 | color: darken(@color, 10%); 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/bootstrap/mixins/text-overflow.less: -------------------------------------------------------------------------------- 1 | // Text overflow 2 | // Requires inline-block or block for proper styling 3 | 4 | .text-overflow() { 5 | overflow: hidden; 6 | text-overflow: ellipsis; 7 | white-space: nowrap; 8 | } 9 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/bootstrap/pager.less: -------------------------------------------------------------------------------- 1 | // 2 | // Pager pagination 3 | // -------------------------------------------------- 4 | 5 | 6 | .pager { 7 | padding-left: 0; 8 | margin: @line-height-computed 0; 9 | list-style: none; 10 | text-align: center; 11 | &:extend(.clearfix all); 12 | li { 13 | display: inline; 14 | > a, 15 | > span { 16 | display: inline-block; 17 | padding: 5px 14px; 18 | background-color: @pager-bg; 19 | border: 1px solid @pager-border; 20 | border-radius: @pager-border-radius; 21 | } 22 | 23 | > a:hover, 24 | > a:focus { 25 | text-decoration: none; 26 | background-color: @pager-hover-bg; 27 | } 28 | } 29 | 30 | .next { 31 | > a, 32 | > span { 33 | float: right; 34 | } 35 | } 36 | 37 | .previous { 38 | > a, 39 | > span { 40 | float: left; 41 | } 42 | } 43 | 44 | .disabled { 45 | > a, 46 | > a:hover, 47 | > a:focus, 48 | > span { 49 | color: @pager-disabled-color; 50 | background-color: @pager-bg; 51 | cursor: @cursor-disabled; 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/bootstrap/responsive-embed.less: -------------------------------------------------------------------------------- 1 | // Embeds responsive 2 | // 3 | // Credit: Nicolas Gallagher and SUIT CSS. 4 | 5 | .embed-responsive { 6 | position: relative; 7 | display: block; 8 | height: 0; 9 | padding: 0; 10 | overflow: hidden; 11 | 12 | .embed-responsive-item, 13 | iframe, 14 | embed, 15 | object, 16 | video { 17 | position: absolute; 18 | top: 0; 19 | left: 0; 20 | bottom: 0; 21 | height: 100%; 22 | width: 100%; 23 | border: 0; 24 | } 25 | } 26 | 27 | // Modifier class for 16:9 aspect ratio 28 | .embed-responsive-16by9 { 29 | padding-bottom: 56.25%; 30 | } 31 | 32 | // Modifier class for 4:3 aspect ratio 33 | .embed-responsive-4by3 { 34 | padding-bottom: 75%; 35 | } 36 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/bootstrap/thumbnails.less: -------------------------------------------------------------------------------- 1 | // 2 | // Thumbnails 3 | // -------------------------------------------------- 4 | 5 | 6 | // Mixin and adjust the regular image class 7 | .thumbnail { 8 | display: block; 9 | padding: @thumbnail-padding; 10 | margin-bottom: @line-height-computed; 11 | line-height: @line-height-base; 12 | background-color: @thumbnail-bg; 13 | border: 1px solid @thumbnail-border; 14 | border-radius: @thumbnail-border-radius; 15 | .transition(border .2s ease-in-out); 16 | 17 | > img, 18 | a > img { 19 | &:extend(.img-responsive); 20 | margin-left: auto; 21 | margin-right: auto; 22 | } 23 | 24 | // Add a hover state for linked versions only 25 | a&:hover, 26 | a&:focus, 27 | a&.active { 28 | border-color: @link-color; 29 | } 30 | 31 | // Image captions 32 | .caption { 33 | padding: @thumbnail-caption-padding; 34 | color: @thumbnail-caption-color; 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/bootstrap/utilities.less: -------------------------------------------------------------------------------- 1 | // 2 | // Utility classes 3 | // -------------------------------------------------- 4 | 5 | 6 | // Floats 7 | // ------------------------- 8 | 9 | .clearfix { 10 | .clearfix(); 11 | } 12 | .center-block { 13 | .center-block(); 14 | } 15 | .pull-right { 16 | float: right !important; 17 | } 18 | .pull-left { 19 | float: left !important; 20 | } 21 | 22 | 23 | // Toggling content 24 | // ------------------------- 25 | 26 | // Note: Deprecated .hide in favor of .hidden or .sr-only (as appropriate) in v3.0.1 27 | .hide { 28 | display: none !important; 29 | } 30 | .show { 31 | display: block !important; 32 | } 33 | .invisible { 34 | visibility: hidden; 35 | } 36 | .text-hide { 37 | .text-hide(); 38 | } 39 | 40 | 41 | // Hide from screenreaders and browsers 42 | // 43 | // Credit: HTML5 Boilerplate 44 | 45 | .hidden { 46 | display: none !important; 47 | } 48 | 49 | 50 | // For Affix plugin 51 | // ------------------------- 52 | 53 | .affix { 54 | position: fixed; 55 | } 56 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/bootstrap/wells.less: -------------------------------------------------------------------------------- 1 | // 2 | // Wells 3 | // -------------------------------------------------- 4 | 5 | 6 | // Base class 7 | .well { 8 | min-height: 20px; 9 | padding: 19px; 10 | margin-bottom: 20px; 11 | background-color: @well-bg; 12 | border: 1px solid @well-border; 13 | border-radius: @border-radius-base; 14 | .box-shadow(inset 0 1px 1px rgba(0,0,0,.05)); 15 | blockquote { 16 | border-color: #ddd; 17 | border-color: rgba(0,0,0,.15); 18 | } 19 | } 20 | 21 | // Sizes 22 | .well-lg { 23 | padding: 24px; 24 | border-radius: @border-radius-large; 25 | } 26 | .well-sm { 27 | padding: 9px; 28 | border-radius: @border-radius-small; 29 | } 30 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/contents.rst: -------------------------------------------------------------------------------- 1 | ######## 2 | Contents 3 | ######## 4 | 5 | .. toctree:: 6 | :maxdepth: 2 7 | 8 | usage 9 | api 10 | syntax 11 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/cppformat.less: -------------------------------------------------------------------------------- 1 | @import 'bootstrap.less'; 2 | 3 | @header-bg: #094d75; 4 | @icon-font-path: "fonts/"; 5 | 6 | html { 7 | overflow-y: scroll; 8 | } 9 | 10 | .navbar { 11 | border-radius: 0; 12 | margin-bottom: 0; 13 | background-color: darken(@header-bg, 10%); 14 | } 15 | 16 | .jumbotron { 17 | #gradient > .vertical(@header-bg; darken(@header-bg, 2%); 50%; 50%); 18 | background-size: 100% 4px; 19 | background-color: @header-bg; 20 | background-repeat: repeat-y; 21 | color: white; 22 | text-align: center; 23 | } 24 | 25 | div.sphinxsidebar { 26 | margin-left: 0; 27 | } 28 | 29 | // Keep content not too wide for better readability. 30 | .navbar-content, .content { 31 | .make-md-column-offset(1); 32 | .make-md-column(10); 33 | .make-lg-column-offset(2); 34 | .make-lg-column(8); 35 | } 36 | 37 | .footer { 38 | padding-top: 20px; 39 | padding-bottom: 20px; 40 | border-top: 1px solid @gray-lighter; 41 | text-align: center; 42 | } 43 | 44 | // Indent descriptions of classes, functions and macros. 45 | .class dd, .function dd, .macro dd { 46 | margin-left: 20px; 47 | } 48 | 49 | // Remove Bootstrap padding for Sphinx containers. 50 | .breathe-sectiondef.container { 51 | padding: 0; 52 | } 53 | 54 | // Remove Bootstrap padding for Sphinx code elements in API signatures. 55 | .descclassname, .descname { 56 | padding: 0; 57 | } 58 | 59 | p.rubric { 60 | margin-top: 10px; 61 | } 62 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/html/_sources/contents.txt: -------------------------------------------------------------------------------- 1 | ######## 2 | Contents 3 | ######## 4 | 5 | .. toctree:: 6 | :maxdepth: 2 7 | 8 | usage 9 | api 10 | syntax 11 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/html/_static/ajax-loader.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thelink2012/gta3sc/43aeb35e1f714394cd7f0f3f60472ee072b7d72c/deps/cppformat/cppformat/doc/html/_static/ajax-loader.gif -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/html/_static/comment-bright.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thelink2012/gta3sc/43aeb35e1f714394cd7f0f3f60472ee072b7d72c/deps/cppformat/cppformat/doc/html/_static/comment-bright.png -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/html/_static/comment-close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thelink2012/gta3sc/43aeb35e1f714394cd7f0f3f60472ee072b7d72c/deps/cppformat/cppformat/doc/html/_static/comment-close.png -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/html/_static/comment.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thelink2012/gta3sc/43aeb35e1f714394cd7f0f3f60472ee072b7d72c/deps/cppformat/cppformat/doc/html/_static/comment.png -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/html/_static/down-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thelink2012/gta3sc/43aeb35e1f714394cd7f0f3f60472ee072b7d72c/deps/cppformat/cppformat/doc/html/_static/down-pressed.png -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/html/_static/down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thelink2012/gta3sc/43aeb35e1f714394cd7f0f3f60472ee072b7d72c/deps/cppformat/cppformat/doc/html/_static/down.png -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/html/_static/file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thelink2012/gta3sc/43aeb35e1f714394cd7f0f3f60472ee072b7d72c/deps/cppformat/cppformat/doc/html/_static/file.png -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/html/_static/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thelink2012/gta3sc/43aeb35e1f714394cd7f0f3f60472ee072b7d72c/deps/cppformat/cppformat/doc/html/_static/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/html/_static/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thelink2012/gta3sc/43aeb35e1f714394cd7f0f3f60472ee072b7d72c/deps/cppformat/cppformat/doc/html/_static/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/html/_static/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thelink2012/gta3sc/43aeb35e1f714394cd7f0f3f60472ee072b7d72c/deps/cppformat/cppformat/doc/html/_static/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/html/_static/minus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thelink2012/gta3sc/43aeb35e1f714394cd7f0f3f60472ee072b7d72c/deps/cppformat/cppformat/doc/html/_static/minus.png -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/html/_static/plus.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thelink2012/gta3sc/43aeb35e1f714394cd7f0f3f60472ee072b7d72c/deps/cppformat/cppformat/doc/html/_static/plus.png -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/html/_static/up-pressed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thelink2012/gta3sc/43aeb35e1f714394cd7f0f3f60472ee072b7d72c/deps/cppformat/cppformat/doc/html/_static/up-pressed.png -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/html/_static/up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thelink2012/gta3sc/43aeb35e1f714394cd7f0f3f60472ee072b7d72c/deps/cppformat/cppformat/doc/html/_static/up.png -------------------------------------------------------------------------------- /deps/cppformat/cppformat/doc/html/objects.inv: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thelink2012/gta3sc/43aeb35e1f714394cd7f0f3f60472ee072b7d72c/deps/cppformat/cppformat/doc/html/objects.inv -------------------------------------------------------------------------------- /deps/cppformat/cppformat/support/README: -------------------------------------------------------------------------------- 1 | This directory contains build support files such as 2 | 3 | * CMake modules 4 | * Build scripts 5 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/support/appveyor-build.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # Build the project on AppVeyor. 3 | 4 | import os 5 | from subprocess import check_call 6 | 7 | build = os.environ['BUILD'] 8 | config = os.environ['CONFIGURATION'] 9 | platform = os.environ.get('PLATFORM') 10 | path = os.environ['PATH'] 11 | cmake_command = ['cmake', '-DFMT_PEDANTIC=ON', '-DCMAKE_BUILD_TYPE=' + config] 12 | if build == 'mingw': 13 | cmake_command.append('-GMinGW Makefiles') 14 | build_command = ['mingw32-make', '-j4'] 15 | test_command = ['mingw32-make', 'test'] 16 | # Remove the path to Git bin directory from $PATH because it breaks MinGW config. 17 | path = path.replace(r'C:\Program Files (x86)\Git\bin', '') 18 | os.environ['PATH'] = r'C:\MinGW\bin;' + path 19 | else: 20 | # Add MSBuild 14.0 to PATH as described in 21 | # http://help.appveyor.com/discussions/problems/2229-v140-not-found-on-vs2105rc. 22 | os.environ['PATH'] = r'C:\Program Files (x86)\MSBuild\14.0\Bin;' + path 23 | generator = 'Visual Studio 14 2015' 24 | if platform == 'x64': 25 | generator += ' Win64' 26 | cmake_command.append('-G' + generator) 27 | build_command = ['msbuild', '/m:4', '/p:Config=' + config, 'FORMAT.sln'] 28 | test_command = ['msbuild', 'RUN_TESTS.vcxproj'] 29 | 30 | check_call(cmake_command) 31 | check_call(build_command) 32 | check_call(test_command) 33 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/support/appveyor.yml: -------------------------------------------------------------------------------- 1 | configuration: 2 | - Debug 3 | - Release 4 | 5 | environment: 6 | CTEST_OUTPUT_ON_FAILURE: 1 7 | matrix: 8 | - BUILD: msvc 9 | - BUILD: msvc 10 | PLATFORM: x64 11 | - BUILD: mingw 12 | 13 | before_build: 14 | # Workaround for CMake not wanting sh.exe on PATH for MinGW. 15 | - set PATH=%PATH:C:\Program Files\Git\usr\bin;=% 16 | 17 | build_script: 18 | - python support/appveyor-build.py 19 | 20 | on_failure: 21 | - appveyor PushArtifact Testing/Temporary/LastTest.log 22 | - appveyor AddTest test 23 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/support/biicode-build.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # Build the project with Biicode. 3 | 4 | import glob, os, shutil 5 | from subprocess import check_call 6 | 7 | project_dir = 'biicode_project' 8 | check_call(['bii', 'init', project_dir]) 9 | cppformat_dir = os.path.join(project_dir, 'blocks/vitaut/cppformat') 10 | shutil.copytree('.', cppformat_dir, ignore=shutil.ignore_patterns(project_dir)) 11 | for f in glob.glob('support/biicode/*'): 12 | shutil.copy(f, cppformat_dir) 13 | check_call(['bii', 'cpp:build'], cwd=project_dir) 14 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/support/biicode/biicode.conf: -------------------------------------------------------------------------------- 1 | # Biicode configuration file 2 | 3 | [paths] 4 | # Local directories to look for headers (within block) 5 | / 6 | 7 | [dependencies] 8 | # Manual adjust file implicit dependencies, add (+), remove (-), or overwrite (=) 9 | CMakeLists.txt + cmake/FindSetEnv.cmake 10 | format.h = format.cc 11 | format.cc - test/* posix.cc 12 | support/biicode/sample.cc - test/* 13 | 14 | [mains] 15 | # Manual adjust of files that define an executable 16 | !test/test-main.cc 17 | 18 | [parent] 19 | vitaut/cppformat: 0 -------------------------------------------------------------------------------- /deps/cppformat/cppformat/support/biicode/ignore.bii: -------------------------------------------------------------------------------- 1 | doc/* 2 | breathe/* 3 | gmock/* 4 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/support/biicode/sample.cc: -------------------------------------------------------------------------------- 1 | #include "vitaut/cppformat/format.h" 2 | 3 | class Date { 4 | int year_, month_, day_; 5 | public: 6 | Date(int year, int month, int day) : year_(year), month_(month), day_(day) {} 7 | 8 | friend std::ostream &operator<<(std::ostream &os, const Date &d) { 9 | return os << d.year_ << '-' << d.month_ << '-' << d.day_; 10 | } 11 | }; 12 | 13 | int main() { 14 | std::string s = fmt::format("The date is {}", Date(2012, 12, 9)); 15 | fmt::print("Hello, {}!", "world"); // uses Python-like format string syntax 16 | fmt::printf("\n%s", s); // uses printf format string syntax 17 | } 18 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/support/cmake/FindSetEnv.cmake: -------------------------------------------------------------------------------- 1 | # A CMake script to find SetEnv.cmd. 2 | 3 | find_program(WINSDK_SETENV NAMES SetEnv.cmd 4 | PATHS "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows;CurrentInstallFolder]/bin") 5 | if (WINSDK_SETENV AND PRINT_PATH) 6 | execute_process(COMMAND ${CMAKE_COMMAND} -E echo "${WINSDK_SETENV}") 7 | endif () 8 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/support/cmake/biicode.cmake: -------------------------------------------------------------------------------- 1 | # Initializes block variables 2 | INIT_BIICODE_BLOCK() 3 | 4 | # Actually create targets: EXEcutables and libraries. 5 | ADD_BIICODE_TARGETS() 6 | 7 | target_include_directories(${BII_BLOCK_TARGET} INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}) 8 | 9 | if (HAVE_OPEN) 10 | target_compile_definitions(${BII_BLOCK_TARGET} INTERFACE -DFMT_USE_FILE_DESCRIPTORS=1) 11 | endif () 12 | 13 | if (CMAKE_COMPILER_IS_GNUCXX) 14 | target_compile_options(${BII_BLOCK_TARGET} INTERFACE -Wall -Wextra -Wshadow -pedantic) 15 | endif () 16 | if (CPP11_FLAG AND FMT_PEDANTIC) 17 | target_compile_options(${BII_BLOCK_TARGET} INTERFACE ${CPP11_FLAG}) 18 | endif () 19 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/support/cmake/run-cmake.bat: -------------------------------------------------------------------------------- 1 | @echo on 2 | rem This scripts configures build environment and runs CMake. 3 | rem Use it instead of running CMake directly when building with 4 | rem the Microsoft SDK toolchain rather than Visual Studio. 5 | rem It is used in the same way as cmake, for example: 6 | rem 7 | rem run-cmake -G "Visual Studio 10 Win64" . 8 | 9 | for /F "delims=" %%i IN ('cmake "-DPRINT_PATH=1" -P %~dp0/FindSetEnv.cmake') DO set setenv=%%i 10 | if NOT "%setenv%" == "" call "%setenv%" 11 | cmake %* 12 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/support/download.py: -------------------------------------------------------------------------------- 1 | # A file downloader. 2 | 3 | import contextlib, os, tempfile, timer, urllib2, urlparse 4 | 5 | class Downloader: 6 | def __init__(self, dir=None): 7 | self.dir = dir 8 | 9 | # Downloads a file and removes it when exiting a block. 10 | # Usage: 11 | # d = Downloader() 12 | # with d.download(url) as f: 13 | # use_file(f) 14 | def download(self, url, cookie=None): 15 | suffix = os.path.splitext(urlparse.urlsplit(url)[2])[1] 16 | fd, filename = tempfile.mkstemp(suffix=suffix, dir=self.dir) 17 | os.close(fd) 18 | with timer.print_time('Downloading', url, 'to', filename): 19 | opener = urllib2.build_opener() 20 | if cookie: 21 | opener.addheaders.append(('Cookie', cookie)) 22 | num_tries = 2 23 | for i in range(num_tries): 24 | try: 25 | f = opener.open(url) 26 | except urllib2.URLError, e: 27 | print('Failed to open url', url) 28 | continue 29 | length = f.headers.get('content-length') 30 | if not length: 31 | print('Failed to get content-length') 32 | continue 33 | length = int(length) 34 | with open(filename, 'wb') as out: 35 | count = 0 36 | while count < length: 37 | data = f.read(1024 * 1024) 38 | count += len(data) 39 | out.write(data) 40 | @contextlib.contextmanager 41 | def remove(filename): 42 | try: 43 | yield filename 44 | finally: 45 | os.remove(filename) 46 | return remove(filename) 47 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/support/rtd/conf.py: -------------------------------------------------------------------------------- 1 | # Sphinx configuration for readthedocs. 2 | 3 | import os, sys 4 | 5 | master_doc = 'index' 6 | html_theme = 'theme' 7 | html_theme_path = ["."] 8 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/support/rtd/index.rst: -------------------------------------------------------------------------------- 1 | If you are not redirected automatically, follow the 2 | `link to the C++ Format documentation `_. 3 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/support/rtd/theme/layout.html: -------------------------------------------------------------------------------- 1 | {% extends "basic/layout.html" %} 2 | 3 | {% block extrahead %} 4 | 5 | 6 | 9 | Page Redirection 10 | {% endblock %} 11 | 12 | {% block document %} 13 | If you are not redirected automatically, follow the link to the C++ Format documentation. 14 | {% endblock %} 15 | 16 | {% block footer %} 17 | {% endblock %} 18 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/support/rtd/theme/theme.conf: -------------------------------------------------------------------------------- 1 | [theme] 2 | inherit = basic 3 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/support/timer.py: -------------------------------------------------------------------------------- 1 | # A with statement based timer. 2 | 3 | from __future__ import print_function 4 | from contextlib import contextmanager 5 | import timeit 6 | 7 | class Timer: 8 | """ 9 | A with statement based timer. 10 | Usage: 11 | t = Timer() 12 | with t: 13 | do_something() 14 | time = t.time 15 | """ 16 | 17 | def __enter__(self): 18 | self.start = timeit.default_timer() 19 | 20 | def __exit__(self, type, value, traceback): 21 | finish = timeit.default_timer() 22 | self.time = finish - self.start 23 | 24 | @contextmanager 25 | def print_time(*args): 26 | """ 27 | Measures and prints the time taken to execute nested code. 28 | args: Additional arguments to print. 29 | """ 30 | t = Timer() 31 | print(*args) 32 | with t: 33 | yield 34 | print(*args, end=' ') 35 | print('finished in {0:.2f} second(s)'.format(t.time)) 36 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/support/update-converity-branch.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # Update the coverity branch from the master branch. 3 | # It is not done automatically because Coverity Scan limits 4 | # the number of submissions per day. 5 | 6 | from __future__ import print_function 7 | import shutil, tempfile 8 | from subprocess import check_output, STDOUT 9 | 10 | class Git: 11 | def __init__(self, dir): 12 | self.dir = dir 13 | 14 | def __call__(self, *args): 15 | output = check_output(['git'] + list(args), cwd=self.dir, stderr=STDOUT) 16 | print(output) 17 | return output 18 | 19 | dir = tempfile.mkdtemp() 20 | try: 21 | git = Git(dir) 22 | git('clone', '-b', 'coverity', 'git@github.com:cppformat/cppformat.git', dir) 23 | output = git('merge', '-X', 'theirs', '--no-commit', 'origin/master') 24 | if 'Fast-forward' not in output: 25 | git('reset', 'HEAD', '.travis.yml') 26 | git('checkout', '--', '.travis.yml') 27 | git('commit', '-m', 'Update coverity branch') 28 | git('push') 29 | finally: 30 | shutil.rmtree(dir) 31 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/test/assert-test.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Assertion tests 3 | 4 | Copyright (c) 2015, Victor Zverovich 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include "format.h" 29 | #include "gtest/gtest.h" 30 | 31 | #if GTEST_HAS_DEATH_TEST 32 | # define EXPECT_DEBUG_DEATH_IF_SUPPORTED(statement, regex) \ 33 | EXPECT_DEBUG_DEATH(statement, regex) 34 | #else 35 | # define EXPECT_DEBUG_DEATH_IF_SUPPORTED(statement, regex) \ 36 | GTEST_UNSUPPORTED_DEATH_TEST_(statement, regex, ) 37 | #endif 38 | 39 | TEST(AssertTest, Fail) { 40 | EXPECT_DEBUG_DEATH_IF_SUPPORTED(FMT_ASSERT(false, "don't panic!"), "don't panic!"); 41 | } 42 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/test/compile-test/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Test if compile errors are produced where necessary. 2 | 3 | cmake_minimum_required(VERSION 2.8) 4 | 5 | include(CheckCXXSourceCompiles) 6 | set(CMAKE_REQUIRED_INCLUDES ${CMAKE_CURRENT_SOURCE_DIR}/../..) 7 | 8 | function (expect_compile_error code) 9 | check_cxx_source_compiles(" 10 | #include \"format.cc\" 11 | #include \"posix.h\" 12 | int main() { 13 | ${code} 14 | } 15 | " compiles) 16 | set (does_compile ${compiles}) 17 | # Unset the CMake cache variable compiles. Otherwise the compile test will 18 | # just use cached information next time it runs. 19 | unset(compiles CACHE) 20 | if (does_compile) 21 | message(FATAL_ERROR "No compile error for: ${code}") 22 | endif () 23 | endfunction () 24 | 25 | # MakeArg doesn't accept [const] volatile char *. 26 | expect_compile_error("volatile char s[] = \"test\"; (fmt::internal::MakeArg)(s);") 27 | expect_compile_error("const volatile char s[] = \"test\"; (fmt::internal::MakeArg)(s);") 28 | 29 | # MakeArg doesn't accept wchar_t. 30 | expect_compile_error("fmt::internal::MakeValue(L'a');") 31 | expect_compile_error("fmt::internal::MakeValue(L\"test\");") 32 | 33 | # Writing a wide character to a character stream Writer is forbidden. 34 | expect_compile_error("fmt::MemoryWriter() << L'a';") 35 | expect_compile_error("fmt::MemoryWriter() << fmt::pad(\"abc\", 5, L' ');") 36 | expect_compile_error("fmt::MemoryWriter() << fmt::pad(42, 5, L' ');") 37 | 38 | # Formatting a wide character with a narrow format string is forbidden. 39 | expect_compile_error("fmt::format(\"{}\", L'a';") 40 | 41 | expect_compile_error("FMT_STATIC_ASSERT(0 > 1, \"oops\");") 42 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/test/header-only-test.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Header-only configuration test 3 | 4 | Copyright (c) 2014, Victor Zverovich 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include "format.h" 29 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/test/header-only-test2.cc: -------------------------------------------------------------------------------- 1 | /* 2 | Additional translation unit for the header-only configuration test 3 | 4 | Copyright (c) 2014, Victor Zverovich 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #include "format.h" 29 | -------------------------------------------------------------------------------- /deps/cppformat/cppformat/test/test-assert.h: -------------------------------------------------------------------------------- 1 | /* 2 | Test version of FMT_ASSERT 3 | 4 | Copyright (c) 2015, Victor Zverovich 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 17 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 18 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR 20 | ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 21 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 22 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 23 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 25 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | */ 27 | 28 | #ifndef FMT_TEST_ASSERT_H 29 | #define FMT_TEST_ASSERT_H 30 | 31 | #include 32 | 33 | class AssertionFailure : public std::logic_error { 34 | public: 35 | explicit AssertionFailure(const char *message) : std::logic_error(message) {} 36 | }; 37 | 38 | #define FMT_ASSERT(condition, message) \ 39 | if (!(condition)) throw AssertionFailure(message); 40 | 41 | #include "gtest-extra.h" 42 | 43 | // Expects an assertion failure. 44 | #define EXPECT_ASSERT(stmt, message) \ 45 | EXPECT_THROW_MSG(stmt, AssertionFailure, message) 46 | 47 | #endif // FMT_TEST_ASSERT_H 48 | -------------------------------------------------------------------------------- /deps/expected/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Martin Moene 4 | Copyright (c) 2015 Microsoft Corporation. All rights reserved. 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | 24 | -------------------------------------------------------------------------------- /deps/expected/include/nonstd/expected.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thelink2012/gta3sc/43aeb35e1f714394cd7f0f3f60472ee072b7d72c/deps/expected/include/nonstd/expected.hpp -------------------------------------------------------------------------------- /deps/optional/LICENSE_1_0.txt: -------------------------------------------------------------------------------- 1 | Boost Software License - Version 1.0 - August 17th, 2003 2 | 3 | Permission is hereby granted, free of charge, to any person or organization 4 | obtaining a copy of the software and accompanying documentation covered by 5 | this license (the "Software") to use, reproduce, display, distribute, 6 | execute, and transmit the Software, and to prepare derivative works of the 7 | Software, and to permit third-parties to whom the Software is furnished to 8 | do so, all subject to the following: 9 | 10 | The copyright notices in the Software and this entire statement, including 11 | the above license grant, this restriction and the following disclaimer, 12 | must be included in all copies of the Software, in whole or in part, and 13 | all derivative works of the Software, unless such copies or derivative 14 | works are solely in the form of machine-executable object code generated by 15 | a source language processor. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 20 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 21 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 22 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 23 | DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /deps/string_view/README.md: -------------------------------------------------------------------------------- 1 | # std::basic_string_view 2 | 3 | This is a implementation of `std::basic_string_view`. 4 | 5 | It's simply the implementation on libcxx repository with licxx-specific stuff replaced (or *expanded*, for macros) with a compiled independent counterpart. 6 | 7 | `std::hash<>` specialization and `std::quoted` overload were removed since we can't really implement those in a natural but compiler independent way. 8 | -------------------------------------------------------------------------------- /deps/variant/LICENSE.txt: -------------------------------------------------------------------------------- 1 | Boost Software License - Version 1.0 - August 17th, 2003 2 | 3 | Permission is hereby granted, free of charge, to any person or organization 4 | obtaining a copy of the software and accompanying documentation covered by 5 | this license (the "Software") to use, reproduce, display, distribute, 6 | execute, and transmit the Software, and to prepare derivative works of the 7 | Software, and to permit third-parties to whom the Software is furnished to 8 | do so, all subject to the following: 9 | 10 | The copyright notices in the Software and this entire statement, including 11 | the above license grant, this restriction and the following disclaimer, 12 | must be included in all copies of the Software, in whole or in part, and 13 | all derivative works of the Software, unless such copies or derivative 14 | works are solely in the form of machine-executable object code generated by 15 | a source language processor. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT 20 | SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE 21 | FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, 22 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 23 | DEALINGS IN THE SOFTWARE. 24 | -------------------------------------------------------------------------------- /deps/variant/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thelink2012/gta3sc/43aeb35e1f714394cd7f0f3f60472ee072b7d72c/deps/variant/README.md -------------------------------------------------------------------------------- /deps/variant/cmake/eggs.variant-config.cmake.in: -------------------------------------------------------------------------------- 1 | # Eggs.Variant 2 | # 3 | # Copyright Agustin K-ballo Berge, Fusion Fenix 2014-2018 4 | # 5 | # Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | # file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | 8 | # - Config file for Eggs.Variant 9 | # 10 | # EGGS_VARIANT_INCLUDE_DIRS - include directories 11 | # EGGS_VARIANT_LIBRARIES - libraries to link against 12 | # 13 | # The following `IMPORTED` target is also defined: 14 | # 15 | # Eggs::Variant 16 | 17 | get_filename_component( 18 | EGGS_VARIANT_CMAKE_DIR "${CMAKE_CURRENT_LIST_DIR}" ABSOLUTE) 19 | 20 | include("${EGGS_VARIANT_CMAKE_DIR}/eggs.variant-targets.cmake") 21 | 22 | get_target_property( 23 | _eggs_variant_include_dirs 24 | Eggs::Variant INTERFACE_INCLUDE_DIRECTORIES) 25 | set(EGGS_VARIANT_INCLUDE_DIRS ${_eggs_variant_include_dirs}) 26 | foreach (_eggs_variant_include_dir ${_eggs_variant_include_dirs}) 27 | if (NOT EXISTS "${_eggs_variant_include_dir}") 28 | message(FATAL_ERROR 29 | "Directory ${_eggs_variant_include_dir} referenced by" 30 | " variable \${EGGS_VARIANT_INCLUDE_DIRS} does not exist!") 31 | endif() 32 | endforeach() 33 | 34 | set(EGGS_VARIANT_LIBRARIES Eggs::Variant) 35 | -------------------------------------------------------------------------------- /deps/variant/docs/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thelink2012/gta3sc/43aeb35e1f714394cd7f0f3f60472ee072b7d72c/deps/variant/docs/README.md -------------------------------------------------------------------------------- /deps/variant/docs/config.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thelink2012/gta3sc/43aeb35e1f714394cd7f0f3f60472ee072b7d72c/deps/variant/docs/config.md -------------------------------------------------------------------------------- /deps/variant/docs/css/img/bgcode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thelink2012/gta3sc/43aeb35e1f714394cd7f0f3f60472ee072b7d72c/deps/variant/docs/css/img/bgcode.png -------------------------------------------------------------------------------- /deps/variant/docs/css/img/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thelink2012/gta3sc/43aeb35e1f714394cd7f0f3f60472ee072b7d72c/deps/variant/docs/css/img/favicon.png -------------------------------------------------------------------------------- /deps/variant/docs/css/normalize.css: -------------------------------------------------------------------------------- 1 | /*! normalize.css v2.0.1 | MIT License | git.io/normalize */ 2 | article,aside,details,figcaption,figure,footer,header,hgroup,nav,section,summary{display:block} 3 | audio,canvas,video{display:inline-block} 4 | audio:not([controls]){display:none;height:0} 5 | [hidden]{display:none} 6 | html{font-family:sans-serif;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%} 7 | a:focus{outline:thin dotted} 8 | a:active,a:hover{outline:0} 9 | h1{font-size:2em} 10 | abbr[title]{border-bottom:1px dotted} 11 | b,strong{font-weight:700} 12 | dfn{font-style:italic} 13 | mark{background:#ff0;color:#000} 14 | code,kbd,pre,samp{font-family:monospace, serif;font-size:1em} 15 | pre{white-space:pre-wrap;word-wrap:break-word} 16 | q{quotes:\201C \201D \2018 \2019} 17 | small{font-size:80%} 18 | sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline} 19 | sup{top:-.5em} 20 | sub{bottom:-.25em} 21 | img{border:0} 22 | svg:not(:root){overflow:hidden} 23 | fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em} 24 | button,input,select,textarea{font-family:inherit;font-size:100%;margin:0} 25 | button,input{line-height:normal} 26 | button,html input[type=button],/* 1 */ 27 | input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer} 28 | button[disabled],input[disabled]{cursor:default} 29 | input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0} 30 | input[type=search]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box} 31 | input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none} 32 | textarea{overflow:auto;vertical-align:top} 33 | table{border-collapse:collapse;border-spacing:0} 34 | body,figure{margin:0} 35 | legend,button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0} -------------------------------------------------------------------------------- /deps/variant/docs/design.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thelink2012/gta3sc/43aeb35e1f714394cd7f0f3f60472ee072b7d72c/deps/variant/docs/design.md -------------------------------------------------------------------------------- /deps/variant/docs/index.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thelink2012/gta3sc/43aeb35e1f714394cd7f0f3f60472ee072b7d72c/deps/variant/docs/index.md -------------------------------------------------------------------------------- /deps/variant/docs/introduction.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thelink2012/gta3sc/43aeb35e1f714394cd7f0f3f60472ee072b7d72c/deps/variant/docs/introduction.md -------------------------------------------------------------------------------- /deps/variant/docs/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thelink2012/gta3sc/43aeb35e1f714394cd7f0f3f60472ee072b7d72c/deps/variant/docs/logo.png -------------------------------------------------------------------------------- /deps/variant/include/eggs/variant.hpp: -------------------------------------------------------------------------------- 1 | //! \file eggs/variant.hpp 2 | // Eggs.Variant 3 | // 4 | // Copyright Agustin K-ballo Berge, Fusion Fenix 2014-2018 5 | // 6 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 7 | // file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 8 | 9 | #ifndef EGGS_VARIANT_HPP 10 | #define EGGS_VARIANT_HPP 11 | 12 | #include "variant/bad_variant_access.hpp" 13 | #include "variant/variant.hpp" 14 | 15 | #include 16 | 17 | #include "variant/detail/config/prefix.hpp" 18 | 19 | namespace eggs 20 | { 21 | //! using variants::variant; 22 | using variants::variant; 23 | 24 | //! using variants::variant_size; 25 | using variants::variant_size; 26 | #if EGGS_CXX14_HAS_VARIABLE_TEMPLATES 27 | //! using variants::variant_size_v; 28 | using variants::variant_size_v; 29 | #endif 30 | 31 | //! using variants::variant_element; 32 | using variants::variant_element; 33 | //! using variants::variant_element_t; 34 | using variants::variant_element_t; 35 | 36 | //! constexpr std::size_t variant_npos = std::size_t(-1); 37 | EGGS_CXX11_CONSTEXPR std::size_t const variant_npos = std::size_t(-1); 38 | 39 | //! using variants::bad_variant_access; 40 | using variants::bad_variant_access; 41 | 42 | //! using variants::get; 43 | using variants::get; 44 | 45 | //! using variants::get_if; 46 | using variants::get_if; 47 | 48 | //! using variants::apply; 49 | using variants::apply; 50 | } 51 | 52 | #include "variant/detail/config/suffix.hpp" 53 | 54 | #endif /*EGGS_VARIANT_HPP*/ 55 | -------------------------------------------------------------------------------- /deps/variant/include/eggs/variant/bad_variant_access.hpp: -------------------------------------------------------------------------------- 1 | //! \file eggs/variant/bad_variant_access.hpp 2 | // Eggs.Variant 3 | // 4 | // Copyright Agustin K-ballo Berge, Fusion Fenix 2014-2018 5 | // 6 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 7 | // file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 8 | 9 | #ifndef EGGS_VARIANT_BAD_VARIANT_ACCESS_HPP 10 | #define EGGS_VARIANT_BAD_VARIANT_ACCESS_HPP 11 | 12 | #include 13 | 14 | #include "detail/config/prefix.hpp" 15 | 16 | namespace eggs { namespace variants 17 | { 18 | /////////////////////////////////////////////////////////////////////////// 19 | //! class bad_variant_access : public std::exception 20 | //! 21 | //! Objects of type `bad_variant_access` are thrown to report attempts to 22 | //! access an inactive member of a `variant` object. 23 | class bad_variant_access 24 | : public std::exception 25 | { 26 | public: 27 | //! bad_variant_access() noexcept; 28 | //! 29 | //! \effects Constructs a `bad_variant_access` object. 30 | bad_variant_access() noexcept 31 | {} 32 | 33 | //! char const* what() const noexcept override; 34 | //! 35 | //! \returns An implementation-defined NTBS. 36 | char const* what() const noexcept /*override*/ 37 | { 38 | return "bad_variant_access"; 39 | } 40 | }; 41 | 42 | namespace detail 43 | { 44 | /////////////////////////////////////////////////////////////////////// 45 | template 46 | EGGS_CXX11_NORETURN inline T throw_bad_variant_access() 47 | { 48 | #if EGGS_CXX98_HAS_EXCEPTIONS 49 | throw bad_variant_access{}; 50 | #else 51 | std::terminate(); 52 | #endif 53 | } 54 | } 55 | }} 56 | 57 | #include "detail/config/suffix.hpp" 58 | 59 | #endif /*EGGS_VARIANT_BAD_VARIANT_ACCESS_HPP*/ 60 | -------------------------------------------------------------------------------- /deps/variant/test/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thelink2012/gta3sc/43aeb35e1f714394cd7f0f3f60472ee072b7d72c/deps/variant/test/README.md -------------------------------------------------------------------------------- /deps/variant/test/catch.cpp: -------------------------------------------------------------------------------- 1 | // Eggs.Variant 2 | // 3 | // Copyright Agustin K-ballo Berge, Fusion Fenix 2014-2018 4 | // 5 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | // file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | 8 | #define CATCH_CONFIG_MAIN 9 | #include "catch.hpp" 10 | -------------------------------------------------------------------------------- /deps/variant/test/cnstr.default.cpp: -------------------------------------------------------------------------------- 1 | // Eggs.Variant 2 | // 3 | // Copyright Agustin K-ballo Berge, Fusion Fenix 2014-2018 4 | // 5 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | // file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | 8 | #include 9 | #include 10 | 11 | #include 12 | 13 | #include "catch.hpp" 14 | #include "constexpr.hpp" 15 | 16 | TEST_CASE("variant::variant()", "[variant.cnstr]") 17 | { 18 | eggs::variant v; 19 | 20 | CHECK(bool(v) == false); 21 | CHECK(v.which() == eggs::variant_npos); 22 | CHECK(v.target() == nullptr); 23 | 24 | #if EGGS_CXX98_HAS_RTTI 25 | CHECK(v.target_type() == typeid(void)); 26 | #endif 27 | 28 | CHECK(noexcept(eggs::variant()) == true); 29 | 30 | #if EGGS_CXX11_HAS_CONSTEXPR 31 | // constexpr 32 | { 33 | constexpr eggs::variant v; 34 | } 35 | #endif 36 | } 37 | 38 | TEST_CASE("variant<>::variant()", "[variant.cnstr]") 39 | { 40 | eggs::variant<> v; 41 | 42 | CHECK(bool(v) == false); 43 | CHECK(v.which() == eggs::variant_npos); 44 | CHECK(v.target() == nullptr); 45 | 46 | #if EGGS_CXX98_HAS_RTTI 47 | CHECK(v.target_type() == typeid(void)); 48 | #endif 49 | 50 | CHECK(noexcept(eggs::variant<>()) == true); 51 | 52 | #if EGGS_CXX11_HAS_CONSTEXPR 53 | // constexpr 54 | { 55 | constexpr eggs::variant<> v; 56 | } 57 | #endif 58 | } 59 | -------------------------------------------------------------------------------- /deps/variant/test/constexpr.hpp: -------------------------------------------------------------------------------- 1 | // Eggs.Variant 2 | // 3 | // Copyright Agustin K-ballo Berge, Fusion Fenix 2014-2018 4 | // 5 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | // file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | 8 | #ifndef EGGS_VARIANT_TEST_CONSTEXPR_HPP 9 | #define EGGS_VARIANT_TEST_CONSTEXPR_HPP 10 | 11 | #include 12 | #include 13 | 14 | #include 15 | 16 | #if EGGS_CXX11_HAS_CONSTEXPR 17 | struct Constexpr 18 | { 19 | int x; 20 | 21 | constexpr Constexpr() : x(0) {} 22 | constexpr Constexpr(int i) : x(i) {} 23 | # if EGGS_CXX14_HAS_CONSTEXPR 24 | constexpr Constexpr(std::initializer_list is) : x(*is.begin()) {} 25 | # endif 26 | 27 | constexpr Constexpr(Constexpr const& rhs) : x(rhs.x) {} // not trivially copyable 28 | 29 | constexpr bool operator==(Constexpr rhs) const { return x == rhs.x; } 30 | constexpr bool operator!=(Constexpr rhs) const { return x != rhs.x; } 31 | constexpr bool operator<(Constexpr rhs) const { return x < rhs.x; } 32 | constexpr bool operator>(Constexpr rhs) const { return x > rhs.x; } 33 | constexpr bool operator<=(Constexpr rhs) const { return x <= rhs.x; } 34 | constexpr bool operator>=(Constexpr rhs) const { return x >= rhs.x; } 35 | }; 36 | 37 | # if !EGGS_CXX11_STD_HAS_IS_TRIVIALLY_DESTRUCTIBLE 38 | namespace eggs { namespace variants { namespace detail 39 | { 40 | template <> struct is_trivially_destructible : std::true_type {}; 41 | }}} 42 | # endif 43 | 44 | struct ConstexprTrivial 45 | { 46 | constexpr ConstexprTrivial() {} 47 | constexpr ConstexprTrivial(int) {} 48 | # if EGGS_CXX14_HAS_CONSTEXPR 49 | constexpr ConstexprTrivial(std::initializer_list) {} 50 | # endif 51 | }; 52 | 53 | # if !EGGS_CXX11_STD_HAS_IS_TRIVIALLY_COPYABLE || !EGGS_CXX11_STD_HAS_IS_TRIVIALLY_DESTRUCTIBLE 54 | namespace eggs { namespace variants { namespace detail 55 | { 56 | template <> struct is_trivially_copyable : std::true_type {}; 57 | template <> struct is_trivially_destructible : std::true_type {}; 58 | }}} 59 | # endif 60 | #endif 61 | 62 | #endif /*EGGS_VARIANT_TEST_CONSTEXPR_HPP*/ 63 | -------------------------------------------------------------------------------- /deps/variant/test/dtor.cpp: -------------------------------------------------------------------------------- 1 | // Eggs.Variant 2 | // 3 | // Copyright Agustin K-ballo Berge, Fusion Fenix 2014-2018 4 | // 5 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | // file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | 8 | #include 9 | #include 10 | 11 | #include 12 | 13 | #include "catch.hpp" 14 | #include "dtor.hpp" 15 | 16 | struct Y 17 | { 18 | Y() {} 19 | Y(Y const&) {}; 20 | ~Y() = default; 21 | }; 22 | 23 | TEST_CASE("variant::~variant()", "[variant.dtor]") 24 | { 25 | { 26 | { 27 | eggs::variant v; 28 | v.emplace<1>(); 29 | 30 | REQUIRE(Dtor::calls == 0u); 31 | } 32 | CHECK(Dtor::calls == 1u); 33 | } 34 | Dtor::calls = 0u; 35 | 36 | // trivially_destructible 37 | { 38 | eggs::variant v1; 39 | eggs::variant v2; 40 | 41 | #if EGGS_CXX11_STD_HAS_IS_TRIVIALLY_DESTRUCTIBLE 42 | CHECK(std::is_trivially_destructible::value == true); 43 | CHECK(std::is_trivially_destructible::value == true); 44 | #endif 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /deps/variant/test/dtor.hpp: -------------------------------------------------------------------------------- 1 | // Eggs.Variant 2 | // 3 | // Copyright Agustin K-ballo Berge, Fusion Fenix 2014-2018 4 | // 5 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | // file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | 8 | #ifndef EGGS_VARIANT_TEST_DTOR_HPP 9 | #define EGGS_VARIANT_TEST_DTOR_HPP 10 | 11 | #include 12 | 13 | struct Dtor 14 | { 15 | static std::size_t calls; 16 | Dtor() {} 17 | ~Dtor() { ++calls; } 18 | }; 19 | 20 | std::size_t Dtor::calls = 0u; 21 | 22 | void swap(Dtor&, Dtor&) {} 23 | 24 | #endif /*EGGS_VARIANT_TEST_DTOR_HPP*/ 25 | -------------------------------------------------------------------------------- /deps/variant/test/obs.bool.cpp: -------------------------------------------------------------------------------- 1 | // Eggs.Variant 2 | // 3 | // Copyright Agustin K-ballo Berge, Fusion Fenix 2014-2018 4 | // 5 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | // file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | 8 | #include 9 | #include 10 | 11 | #include 12 | 13 | #include "catch.hpp" 14 | #include "constexpr.hpp" 15 | 16 | TEST_CASE("variant::operator bool()", "[variant.obs]") 17 | { 18 | // non-empty 19 | { 20 | eggs::variant const v(42); 21 | 22 | CHECK(bool(v) == true); 23 | 24 | CHECK(noexcept(bool(v)) == true); 25 | 26 | #if EGGS_CXX11_HAS_CONSTEXPR 27 | // constexpr 28 | { 29 | constexpr eggs::variant v(42); 30 | constexpr bool vb = bool(v); 31 | } 32 | #endif 33 | } 34 | 35 | // empty 36 | { 37 | eggs::variant const v; 38 | 39 | CHECK(bool(v) == false); 40 | 41 | CHECK(noexcept(bool(v)) == true); 42 | 43 | #if EGGS_CXX11_HAS_CONSTEXPR 44 | // constexpr 45 | { 46 | constexpr eggs::variant v; 47 | constexpr bool vb = bool(v); 48 | } 49 | #endif 50 | } 51 | } 52 | 53 | TEST_CASE("variant<>::operator bool()", "[variant.obs]") 54 | { 55 | eggs::variant<> const v; 56 | 57 | CHECK(bool(v) == false); 58 | 59 | CHECK(noexcept(bool(v)) == true); 60 | 61 | #if EGGS_CXX11_HAS_CONSTEXPR 62 | // constexpr 63 | { 64 | constexpr eggs::variant<> v; 65 | constexpr bool vb = bool(v); 66 | } 67 | #endif 68 | } 69 | -------------------------------------------------------------------------------- /deps/variant/test/obs.target_type.cpp: -------------------------------------------------------------------------------- 1 | // Eggs.Variant 2 | // 3 | // Copyright Agustin K-ballo Berge, Fusion Fenix 2014-2018 4 | // 5 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | // file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | #include 13 | 14 | #include "catch.hpp" 15 | #include "constexpr.hpp" 16 | 17 | #if EGGS_CXX98_HAS_RTTI 18 | TEST_CASE("variant::target_type()", "[variant.obs]") 19 | { 20 | // non-empty 21 | { 22 | eggs::variant const v(42); 23 | 24 | CHECK(v.target_type() == typeid(int)); 25 | 26 | CHECK(noexcept(v.target_type()) == true); 27 | 28 | #if EGGS_CXX11_HAS_CONSTEXPR_RTTI 29 | // constexpr 30 | { 31 | constexpr eggs::variant v(42); 32 | constexpr std::type_info const& vtt = v.target_type(); 33 | } 34 | #endif 35 | } 36 | 37 | // empty 38 | { 39 | eggs::variant const v; 40 | 41 | CHECK(v.target_type() == typeid(void)); 42 | 43 | CHECK(noexcept(v.target_type()) == true); 44 | 45 | #if EGGS_CXX11_HAS_CONSTEXPR_RTTI 46 | // constexpr 47 | { 48 | constexpr eggs::variant v; 49 | constexpr std::type_info const& vtt = v.target_type(); 50 | } 51 | #endif 52 | } 53 | } 54 | 55 | TEST_CASE("variant<>::target_type()", "[variant.obs]") 56 | { 57 | eggs::variant<> const v; 58 | 59 | CHECK(v.target_type() == typeid(void)); 60 | 61 | CHECK(noexcept(v.target_type()) == true); 62 | 63 | #if EGGS_CXX11_HAS_CONSTEXPR_RTTI 64 | // constexpr 65 | { 66 | constexpr eggs::variant<> v; 67 | constexpr std::type_info const& vtt = v.target_type(); 68 | } 69 | #endif 70 | } 71 | #endif 72 | -------------------------------------------------------------------------------- /deps/variant/test/obs.which.cpp: -------------------------------------------------------------------------------- 1 | // Eggs.Variant 2 | // 3 | // Copyright Agustin K-ballo Berge, Fusion Fenix 2014-2018 4 | // 5 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | // file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | 8 | #include 9 | #include 10 | 11 | #include 12 | 13 | #include "catch.hpp" 14 | #include "constexpr.hpp" 15 | 16 | TEST_CASE("variant::which()", "[variant.obs]") 17 | { 18 | // non-empty 19 | { 20 | eggs::variant const v(42); 21 | 22 | CHECK(v.which() == 0); 23 | 24 | CHECK(noexcept(v.which()) == true); 25 | 26 | #if EGGS_CXX11_HAS_CONSTEXPR 27 | // constexpr 28 | { 29 | constexpr eggs::variant v(42); 30 | constexpr std::size_t vw = v.which(); 31 | } 32 | #endif 33 | } 34 | 35 | // empty 36 | { 37 | eggs::variant const v; 38 | 39 | CHECK(v.which() == eggs::variant_npos); 40 | 41 | CHECK(noexcept(v.which()) == true); 42 | 43 | #if EGGS_CXX11_HAS_CONSTEXPR 44 | // constexpr 45 | { 46 | constexpr eggs::variant v; 47 | constexpr std::size_t vw = v.which(); 48 | } 49 | #endif 50 | } 51 | } 52 | 53 | TEST_CASE("variant<>::which()", "[variant.obs]") 54 | { 55 | eggs::variant<> const v; 56 | 57 | CHECK(v.which() == eggs::variant_npos); 58 | 59 | CHECK(noexcept(v.which()) == true); 60 | 61 | #if EGGS_CXX11_HAS_CONSTEXPR 62 | // constexpr 63 | { 64 | constexpr eggs::variant<> v; 65 | constexpr std::size_t vw = v.which(); 66 | } 67 | #endif 68 | } 69 | -------------------------------------------------------------------------------- /deps/variant/test/throw.hpp: -------------------------------------------------------------------------------- 1 | // Eggs.Variant 2 | // 3 | // Copyright Agustin K-ballo Berge, Fusion Fenix 2014-2018 4 | // 5 | // Distributed under the Boost Software License, Version 1.0. (See accompanying 6 | // file LICENSE.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 7 | 8 | #ifndef EGGS_VARIANT_TEST_THROW_HPP 9 | #define EGGS_VARIANT_TEST_THROW_HPP 10 | 11 | #include 12 | 13 | #include 14 | 15 | #if EGGS_CXX98_HAS_EXCEPTIONS 16 | struct Throw 17 | { 18 | Throw() {} 19 | Throw(int) { throw 0; } 20 | Throw(std::initializer_list) { throw 0; } 21 | Throw(Throw const&) { throw 0; } 22 | Throw(Throw&&) { throw 0; } 23 | Throw& operator=(Throw const&) { throw 0; } 24 | Throw& operator=(Throw&&) { throw 0; } 25 | ~Throw() {} 26 | }; 27 | #endif 28 | 29 | #endif /*EGGS_VARIANT_TEST_THROW_HPP*/ 30 | -------------------------------------------------------------------------------- /git-sha1.cpp.in: -------------------------------------------------------------------------------- 1 | /// 2 | /// This file is generated at $build/git-sha1.cpp with proper values replaced everytime a git commit happens. 3 | /// See CMakeLists.txt for details. 4 | /// 5 | #include 6 | 7 | const char* GTA3SC_GIT_SHA1 = "@GIT_SHA1@"; 8 | const char* GTA3SC_GIT_BRANCH = "@GIT_BRANCH@"; 9 | const char* GTA3SC_GIT_DESCRIBE_TAG = "@GIT_DESCRIBE_TAG@"; 10 | -------------------------------------------------------------------------------- /src/annotation.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include "commands.hpp" 4 | 5 | struct TextLabelAnnotation 6 | { 7 | bool is_varlen; 8 | bool preserve_case; 9 | std::string string; 10 | }; 11 | 12 | struct String128Annotation 13 | { 14 | std::string string; 15 | }; 16 | 17 | // not used 18 | struct VarAnnotation 19 | { 20 | shared_ptr base; 21 | optional>> index; // int32_t index is 0-based 22 | }; 23 | 24 | struct ArrayAnnotation 25 | { 26 | shared_ptr base; 27 | variant> index; // int32_t index is 0-based 28 | }; 29 | 30 | struct ModelAnnotation 31 | { 32 | weak_ptr where; // weak to avoid circular reference 33 | uint32_t id; 34 | }; 35 | 36 | struct RepeatAnnotation 37 | { 38 | const Command& set_var_to_zero; 39 | const Command& add_var_with_one; 40 | const Command& is_var_geq_times; 41 | // numbers compatible with set_var_to_times and add_var_with_int 42 | Commands::MatchArgument number_zero; 43 | Commands::MatchArgument number_one; 44 | }; 45 | 46 | struct SwitchAnnotation 47 | { 48 | size_t num_cases; 49 | bool has_default; 50 | }; 51 | 52 | struct SwitchCaseAnnotation 53 | { 54 | const Command* is_var_eq_int; // may be `nullptr` for SWITCH_START/CONTINUED instead. 55 | }; 56 | 57 | struct IncDecAnnotation 58 | { 59 | const Command& op_var_with_one; 60 | Commands::MatchArgument number_one; 61 | }; 62 | 63 | // Instead of a const Command&, annotate this on commands that do not compile to anything. 64 | struct DummyCommandAnnotation 65 | { 66 | }; 67 | 68 | // When a command is replaced by another command. 69 | struct ReplacedCommandAnnotation 70 | { 71 | const Command& command; 72 | std::vector params; 73 | }; 74 | 75 | // Assigned to the node during parse. 76 | struct DumpAnnotation 77 | { 78 | std::vector bytes; 79 | }; 80 | -------------------------------------------------------------------------------- /src/cdimage.hpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | struct alignas(4) CdHeader 5 | { 6 | char magic[4]; 7 | uint32_t num_entries; 8 | }; 9 | 10 | struct alignas(4) CdEntry 11 | { 12 | uint32_t offset; // in sectors 13 | uint16_t streaming_size; // in sectors 14 | uint16_t size_in_archive = 0; // in sectors 15 | char filename[24]; 16 | }; 17 | -------------------------------------------------------------------------------- /src/cpp/any.hpp: -------------------------------------------------------------------------------- 1 | /// Library Fundamentals v1 : Any 2 | /// 3 | /// http://en.cppreference.com/w/cpp/experimental/any 4 | /// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4480.html 5 | /// 6 | #pragma once 7 | #define ANY_IMPL_FAST_TYPE_INFO_COMPARE 8 | #include 9 | 10 | using linb::any; 11 | using linb::any_cast; 12 | using linb::bad_any_cast; 13 | -------------------------------------------------------------------------------- /src/cpp/contracts.hpp: -------------------------------------------------------------------------------- 1 | /// Contracts, Unreachable and Assertion 2 | /// 3 | /// https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Ri-expects 4 | /// https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Ri-ensures 5 | /// 6 | #pragma once 7 | #include 8 | 9 | // Assert 10 | #include 11 | 12 | // http://stackoverflow.com/a/19343239/2679626 13 | #ifndef STRINGIFY 14 | # define STRINGIFY_DETAIL(x) #x 15 | # define STRINGIFY(x) STRINGIFY_DETAIL(x) 16 | #endif 17 | 18 | #ifndef NDEBUG 19 | 20 | struct broken_contract : std::runtime_error 21 | { 22 | broken_contract(const char* msg) 23 | : std::runtime_error(msg) 24 | {} 25 | }; 26 | 27 | struct unreachable_exception : std::runtime_error 28 | { 29 | unreachable_exception(const char* msg) 30 | : std::runtime_error(msg) 31 | {} 32 | }; 33 | 34 | /// I.6: Prefer Expects() for expressing preconditions. 35 | /// See https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Ri-expects 36 | #define Expects(cond) \ 37 | ((cond)? void(0) : throw broken_contract("Precondition failure at " __FILE__ "(" STRINGIFY(__LINE__) "): " #cond ".")) 38 | 39 | /// I.8: Prefer Ensures() for expressing postconditions. 40 | /// See https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#Ri-ensures 41 | #define Ensures(cond) \ 42 | ((cond)? void(0) : throw broken_contract("Postcondition failure at " __FILE__ "(" STRINGIFY(__LINE__) "): " #cond ".")) 43 | 44 | /// Unreachable code must be marked with this. 45 | #define Unreachable() \ 46 | (throw unreachable_exception("Unreachable code reached at " __FILE__ "(" STRINGIFY(__LINE__) ").")) 47 | 48 | #else 49 | 50 | #define Expects(cond) void(0) 51 | #define Ensures(cond) void(0) 52 | #define Unreachable() \ 53 | (throw std::runtime_error("Unreachable code reached")) 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /src/cpp/expected.hpp: -------------------------------------------------------------------------------- 1 | /// 2 | /// Expected Monad Type 3 | /// 4 | /// https://github.com/martinmoene/expected-lite 5 | /// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4109.pdf 6 | /// 7 | #pragma once 8 | #include 9 | using namespace nonstd; -------------------------------------------------------------------------------- /src/cpp/filesystem.hpp: -------------------------------------------------------------------------------- 1 | /// Filesystem Technical Specification 2 | /// 3 | /// http://en.cppreference.com/w/cpp/experimental/fs 4 | /// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4100.pdf 5 | /// 6 | #pragma once 7 | #include 8 | namespace fs = std::filesystem; 9 | -------------------------------------------------------------------------------- /src/cpp/icompare.hpp: -------------------------------------------------------------------------------- 1 | /// Case-Insensitive Compare 2 | /// 3 | #pragma once 4 | #include 5 | #include 6 | 7 | #if defined(_MSC_VER) 8 | inline int strcasecmp(const char* a, const char* b) 9 | { 10 | return _stricmp(a, b); 11 | } 12 | 13 | inline int strncasecmp(const char* a, const char* b, size_t count) 14 | { 15 | return _strnicmp(a, b, count); 16 | } 17 | #elif defined (__unix__) || (__MINGW32__) || (defined (__APPLE__) && defined (__MACH__)) 18 | // Already has strcasecmp and strncasecmp 19 | #else 20 | # error 21 | #endif 22 | 23 | /// std::less but case insensitive 24 | struct iless 25 | { 26 | using is_transparent = int; 27 | 28 | bool operator()(const string_view& left, const string_view& right) const 29 | { 30 | auto ans = strncasecmp(left.data(), right.data(), (std::min)(left.size(), right.size())); 31 | return ans == 0? (left.size() < right.size()) : (ans < 0); 32 | } 33 | }; 34 | 35 | /// std::equal_to but case insensitive 36 | struct iequal_to 37 | { 38 | using is_transparent = int; 39 | 40 | bool operator()(const string_view& left, const string_view& right) const 41 | { 42 | if(left.size() != right.size()) 43 | return false; 44 | return strncasecmp(left.data(), right.data(), left.size()) == 0; 45 | } 46 | }; 47 | -------------------------------------------------------------------------------- /src/cpp/optional.hpp: -------------------------------------------------------------------------------- 1 | /// Library Fundamentals v1 : Optional 2 | /// 3 | /// http://en.cppreference.com/w/cpp/experimental/optional 4 | /// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4480.html 5 | /// 6 | #pragma once 7 | #include 8 | 9 | template 10 | using optional = std::experimental::optional; 11 | 12 | using nullopt_t = std::experimental::nullopt_t; 13 | constexpr nullopt_t nullopt = std::experimental::nullopt; 14 | 15 | using bad_optional_access = std::experimental::bad_optional_access; 16 | -------------------------------------------------------------------------------- /src/cpp/scope_guard.hpp: -------------------------------------------------------------------------------- 1 | /// Scope Guard - Execute something at the end of the scope 2 | /// 3 | #pragma once 4 | #include 5 | #include 6 | 7 | /// Ensures something gets run at the end of a scope. 8 | template 9 | class scope_guard final 10 | { 11 | public: 12 | static_assert(std::is_nothrow_move_constructible::value, "Functor must be NoThrow MoveConstructible"); 13 | 14 | scope_guard(Functor f) 15 | : fun(std::move(f)), dismissed(false) 16 | {} 17 | 18 | ~scope_guard() noexcept 19 | { 20 | this->execute(); 21 | } 22 | 23 | scope_guard(const scope_guard&) = delete; 24 | scope_guard(scope_guard&& rhs) noexcept 25 | : dismissed(rhs.dismissed), fun(std::move(rhs.fun)) 26 | { 27 | rhs.dismiss(); 28 | } 29 | 30 | scope_guard& operator=(scope_guard const&) = delete; 31 | scope_guard& operator=(scope_guard&&) = delete; 32 | 33 | /// Don't call the guard at the end of the scope anymore. 34 | void dismiss() noexcept 35 | { 36 | this->dismissed = true; 37 | } 38 | 39 | // Executes the guard now instead of at the end of the scope. 40 | void execute() noexcept 41 | { 42 | if(!this->dismissed) 43 | { 44 | this->fun(); 45 | this->dismiss(); 46 | } 47 | } 48 | 49 | private: 50 | Functor fun; 51 | bool dismissed; 52 | }; 53 | 54 | /// Executes the functor `f` at the end of the outer scope. 55 | template 56 | inline auto make_scope_guard(Functor f) -> scope_guard 57 | { 58 | return scope_guard(std::move(f)); 59 | } 60 | -------------------------------------------------------------------------------- /src/cpp/small_vector.hpp: -------------------------------------------------------------------------------- 1 | /// Vector with small stack storage. 2 | /// 3 | /// http://llvm.org/docs/doxygen/html/classllvm_1_1SmallVector.html 4 | /// 5 | #pragma once 6 | #include 7 | 8 | template 9 | using small_vector = llvm_vecsmall::SmallVector; 10 | -------------------------------------------------------------------------------- /src/cpp/string_view.hpp: -------------------------------------------------------------------------------- 1 | /// Zero-cost string slice 2 | /// 3 | /// http://en.cppreference.com/w/cpp/string/basic_string_view 4 | /// 5 | #pragma once 6 | #include 7 | using namespace libcxx_strviewclone; -------------------------------------------------------------------------------- /src/cpp/variant.hpp: -------------------------------------------------------------------------------- 1 | /// 2 | /// Variant : A Type Safe Union 3 | /// 4 | /// http://eggs-cpp.github.io/variant/ 5 | /// http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4542.pdf (unrelated to eggs::variant) 6 | /// 7 | /// 8 | #pragma once 9 | #include 10 | using namespace eggs::variants; 11 | 12 | /// Visits the currently active object on the [Vs]ariants by using F. 13 | template 14 | constexpr auto visit(F&& f, Vs&&... vs) 15 | -> decltype(eggs::variants::apply(std::forward(f), std::forward(vs)...)) 16 | { 17 | return eggs::variants::apply(std::forward(f), std::forward(vs)...); 18 | } 19 | 20 | /// Visits the currently active object on the [V]ariant by using F. 21 | template 22 | constexpr auto visit_one(V&& v, F&& f) 23 | -> decltype(eggs::variants::apply(std::forward(f), std::forward(v))) 24 | { 25 | return eggs::variants::apply(std::forward(f), std::forward(v)); 26 | } 27 | 28 | /// Checks whether the currently active object on the Variant is of type T. 29 | template 30 | constexpr bool is(const Variant& variant) 31 | { 32 | return visit_one(variant, [](const auto& obj) { 33 | return std::is_same>::value; 34 | }); 35 | } 36 | -------------------------------------------------------------------------------- /src/stdinc.cpp: -------------------------------------------------------------------------------- 1 | #include -------------------------------------------------------------------------------- /src/system.hpp: -------------------------------------------------------------------------------- 1 | /// 2 | /// Platform-Specific Details. 3 | /// 4 | #pragma once 5 | #include "cpp/filesystem.hpp" 6 | 7 | /// Returns the path that static configuration is in. 8 | extern const fs::path& config_path(); 9 | 10 | /// Allocates size for a file. 11 | /// \warning the behaviour is undefined if the file isn't empty. 12 | /// \note the file offset after this call is at the top of the file. 13 | extern bool allocate_file(FILE*, uint64_t); 14 | -------------------------------------------------------------------------------- /test/Checksum.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | md5sum "$1" | grep "$2" >/dev/null || { 3 | echo "checksum: file $1 checksum is not $2" >&2 4 | exit 1 5 | } -------------------------------------------------------------------------------- /test/Discard.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | # 3 | # Discards the exit code of another program, except for crashing programs. 4 | # 5 | "$@" 6 | if [ $? -gt 1 ]; then 7 | exit $? 8 | else 9 | exit 0 10 | fi -------------------------------------------------------------------------------- /test/GTA3ScriptTest.py: -------------------------------------------------------------------------------- 1 | import lit.formats 2 | 3 | # Configuration file for the 'lit' test runner. 4 | 5 | # Our own getTestsInDirectory to avoid too avoid reading subscripts. 6 | class GTA3ScriptTest(lit.formats.ShTest): 7 | def __init__(self, execute_external = False): 8 | super(GTA3ScriptTest, self).__init__(execute_external=execute_external) 9 | 10 | 11 | def getTestsInDirectory(self, testSuite, path_in_suite, 12 | litConfig, localConfig): 13 | # Only allow one level of recursion in the test paths 14 | if len(path_in_suite) == 1: 15 | return super(GTA3ScriptTest, self).getTestsInDirectory(testSuite, path_in_suite, litConfig, localConfig) 16 | return [] 17 | -------------------------------------------------------------------------------- /test/Not.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | # 3 | # Negates the exit code of another program 4 | # 5 | # Do note we're checking for exit code 1, not 0. 6 | # That's because we want to still exit 1 in case of a crash 7 | # (which isn't exit code 1, likely 3 or a bigger number). 8 | # 9 | "$@" 10 | if [ $? -eq 1 ]; then 11 | exit 0 12 | else 13 | exit 1 14 | fi -------------------------------------------------------------------------------- /test/README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/thelink2012/gta3sc/43aeb35e1f714394cd7f0f3f60472ee072b7d72c/test/README.md -------------------------------------------------------------------------------- /test/codegen/0001-var-offset.sc: -------------------------------------------------------------------------------- 1 | // Regression Test 1 2 | // Checks whether a mission script which is the first to declare global vars 3 | // (i.e. main script has no globals) properly starts at &8 offset. 4 | // 5 | // RUN: %gta3sc %s --config=gta3 -emit-ir2 -o - | %FileCheck %s 6 | // 7 | LOAD_AND_LAUNCH_MISSION mission.sc 8 | TERMINATE_THIS_SCRIPT 9 | 10 | // mission.sc 11 | // CHECK-L: SCRIPT_NAME 'MISS1' 12 | // CHECK-NEXT-L: SET_VAR_INT &8 2 13 | -------------------------------------------------------------------------------- /test/codegen/0001-var-offset/mission.sc: -------------------------------------------------------------------------------- 1 | MISSION_START 2 | VAR_INT x 3 | SCRIPT_NAME miss1 4 | x = 2 5 | MISSION_END -------------------------------------------------------------------------------- /test/codegen/0002-multifile-local-offsets.sc: -------------------------------------------------------------------------------- 1 | // Regression Test 2 2 | // Checks whether multifiles compiled with -mlocal-offsets produces proper offsets. 3 | // 4 | // RUN: %gta3sc %s --config=gta3 -mlocal-offsets -emit-ir2 -o - | %FileCheck %s 5 | // 6 | LAUNCH_MISSION subscript.sc 7 | LOAD_AND_LAUNCH_MISSION miss1.sc 8 | main_label: 9 | GOTO main_label 10 | TERMINATE_THIS_SCRIPT 11 | 12 | // CHECK-NEXT-L: LAUNCH_MISSION %MAIN_2 13 | // CHECK-NEXT-L: LOAD_AND_LAUNCH_MISSION_INTERNAL 0i8 14 | // CHECK-NEXT-L: MAIN_1: 15 | // CHECK-NEXT-L: GOTO %MAIN_1 16 | // CHECK-NEXT-L: TERMINATE_THIS_SCRIPT 17 | // CHECK-NEXT-L: MAIN_2: 18 | // CHECK-NEXT-L: SCRIPT_NAME 'SUBSC' 19 | // CHECK-NEXT-L: MAIN_3: 20 | // CHECK-NEXT-L: GOTO %MAIN_3 21 | // CHECK-NEXT-L: TERMINATE_THIS_SCRIPT 22 | // CHECK-NEXT-L: #MISSION_BLOCK_START 0 23 | // CHECK-NEXT-L: SCRIPT_NAME 'MISS1' 24 | // CHECK-NEXT-L: MISSION_0_1: 25 | // CHECK-NEXT-L: GOTO %MISSION_0_1 26 | // CHECK-NEXT-L: TERMINATE_THIS_SCRIPT 27 | // CHECK-NEXT-L: #MISSION_BLOCK_END 28 | -------------------------------------------------------------------------------- /test/codegen/0002-multifile-local-offsets/miss1.sc: -------------------------------------------------------------------------------- 1 | MISSION_START 2 | SCRIPT_NAME miss1 3 | miss1_label: 4 | GOTO miss1_label 5 | MISSION_END -------------------------------------------------------------------------------- /test/codegen/0002-multifile-local-offsets/subscript.sc: -------------------------------------------------------------------------------- 1 | MISSION_START 2 | SCRIPT_NAME subsc 3 | subscript_label: 4 | GOTO subscript_label 5 | MISSION_END -------------------------------------------------------------------------------- /test/codegen/0003-call-scope-fix.sc: -------------------------------------------------------------------------------- 1 | // Regression Test 3 2 | // Checks whether call scopes in SA Missions have their local vars starting at 0. 3 | // 4 | // RUN: %gta3sc %s --config=gtasa --guesser --cm -emit-ir2 -o - | %FileCheck %s 5 | // 6 | MISSION_START 7 | { 8 | LVAR_INT x 9 | // CHECK-L: CLEO_CALL %MAIN_1 1i8 34@ 34@ 10 | CLEO_CALL proc1 0 x x 11 | } 12 | MISSION_END 13 | 14 | { 15 | proc1: 16 | LVAR_INT x 17 | // CHECK-L: CLEO_RETURN 1i8 0@ 18 | CLEO_RETURN 0 x 19 | } 20 | -------------------------------------------------------------------------------- /test/codegen/0004-includers-label.sc: -------------------------------------------------------------------------------- 1 | // Regression Test 4 2 | // Ensures file includers when used from subscripts onwards uses labels. 3 | // 4 | // RUN: %gta3sc %s --config=gta3 -emit-ir2 -o - | %FileCheck %s 5 | // 6 | LAUNCH_MISSION subscript.sc 7 | LOAD_AND_LAUNCH_MISSION miss1.sc 8 | TERMINATE_THIS_SCRIPT 9 | 10 | // CHECK-NEXT-L: LAUNCH_MISSION @MAIN_1 11 | // CHECK-NEXT-L: LOAD_AND_LAUNCH_MISSION_INTERNAL 0i8 12 | // CHECK-NEXT-L: TERMINATE_THIS_SCRIPT 13 | // CHECK-NEXT-L: MAIN_1: 14 | // CHECK-NEXT-L: SCRIPT_NAME 'SUBSC' 15 | // CHECK-NEXT-L: GOSUB_FILE @MAIN_2 @MAIN_2 16 | // CHECK-NEXT-L: LAUNCH_MISSION @MAIN_2 17 | // CHECK-NEXT-L: TERMINATE_THIS_SCRIPT 18 | // CHECK-NEXT-L: MAIN_2: 19 | // CHECK-NEXT-L: GOTO @MAIN_2 20 | // CHECK-NEXT-L: #MISSION_BLOCK_START 0 21 | // CHECK-NEXT-L: SCRIPT_NAME 'MISS1' 22 | // CHECK-NEXT-L: GOSUB_FILE %MISSION_0_1 %MISSION_0_1 23 | // CHECK-NEXT-L: LAUNCH_MISSION %MISSION_0_1 24 | // CHECK-NEXT-L: TERMINATE_THIS_SCRIPT 25 | // CHECK-NEXT-L: MISSION_0_1: 26 | // CHECK-NEXT-L: GOTO %MISSION_0_1 27 | // CHECK-NEXT-L: #MISSION_BLOCK_END 28 | -------------------------------------------------------------------------------- /test/codegen/0004-includers-label/miss1.sc: -------------------------------------------------------------------------------- 1 | MISSION_START 2 | SCRIPT_NAME miss1 3 | GOSUB_FILE miss1_label miss1_label 4 | LAUNCH_MISSION miss1_label 5 | MISSION_END 6 | 7 | miss1_label: 8 | GOTO miss1_label 9 | -------------------------------------------------------------------------------- /test/codegen/0004-includers-label/subscript.sc: -------------------------------------------------------------------------------- 1 | MISSION_START 2 | SCRIPT_NAME subsc 3 | GOSUB_FILE subsc_label subsc_label 4 | LAUNCH_MISSION subsc_label 5 | MISSION_END 6 | 7 | subsc_label: 8 | GOTO subsc_label 9 | -------------------------------------------------------------------------------- /test/codegen/0005-mission-vars-header.sc: -------------------------------------------------------------------------------- 1 | // Regression Test 5 2 | // Ensures the multifile header contains the maximum local variable used in a mission. 3 | // 4 | // # Check SCM Header 5 | // RUN: mkdir "%/T/0005" || echo _ 6 | // RUN: %gta3sc %s --config=gtasa --guesser -o "%/T/0005/main.scm" 7 | // RUN: %checksum "%T/0005/main.scm" bf59e9794dfd10dbc1cbb8209c052aff 8 | // 9 | LOAD_AND_LAUNCH_MISSION miss1.sc 10 | LOAD_AND_LAUNCH_MISSION miss2.sc 11 | TERMINATE_THIS_SCRIPT -------------------------------------------------------------------------------- /test/codegen/0005-mission-vars-header/miss1.sc: -------------------------------------------------------------------------------- 1 | MISSION_START 2 | { 3 | LVAR_INT x y z i j k // 34@ 35@ 36@ 37@ 38@ 39@ 4 | } 5 | MISSION_END 6 | -------------------------------------------------------------------------------- /test/codegen/0005-mission-vars-header/miss2.sc: -------------------------------------------------------------------------------- 1 | MISSION_START 2 | { 3 | LVAR_INT x y z // 34@ 35@ 36@ 4 | } 5 | MISSION_END 6 | -------------------------------------------------------------------------------- /test/codegen/0006-require-label-offset.sc: -------------------------------------------------------------------------------- 1 | // Regression Test 6 2 | // Checks whether local offsets of required scripts (second require in special) are correct. 3 | // 4 | // RUN: %gta3sc %s --config=gtasa --guesser --cs -emit-ir2 -o - | %FileCheck %s 5 | 6 | SCRIPT_START 7 | REQUIRE a.sc 8 | REQUIRE b.sc 9 | // CHECK-L: GOSUB %MAIN_1 10 | GOSUB label_here 11 | // CHECK-L: GOSUB %MAIN_2 12 | GOSUB alabel 13 | // CHECK-L: GOSUB %MAIN_3 14 | GOSUB blabel 15 | SCRIPT_END 16 | 17 | // CHECK--L: MAIN_1: 18 | label_here: 19 | // CHECK-L: RETURN 20 | RETURN 21 | 22 | // from a.sc 23 | // CHECK-L: MAIN_2: 24 | // CHECK-L: RETURN 25 | 26 | // from b.sc 27 | // CHECK-L: MAIN_3: 28 | // CHECK-L: RETURN 29 | -------------------------------------------------------------------------------- /test/codegen/0006-require-label-offset/a.sc: -------------------------------------------------------------------------------- 1 | alabel: 2 | RETURN 3 | -------------------------------------------------------------------------------- /test/codegen/0006-require-label-offset/b.sc: -------------------------------------------------------------------------------- 1 | blabel: 2 | RETURN 3 | -------------------------------------------------------------------------------- /test/codegen/andor.sc: -------------------------------------------------------------------------------- 1 | // RUN: %gta3sc %s --config=gta3 -emit-ir2 -o - | %FileCheck %s 2 | 3 | VAR_INT x 4 | 5 | // CHECK-NEXT-L: ANDOR 0i8 6 | // CHECK-NEXT-L: IS_INT_VAR_EQUAL_TO_NUMBER &8 0i8 7 | // CHECK-NEXT-L: GOTO_IF_FALSE @MAIN_1 8 | IF x = 0 9 | // CHECK-NEXT-L: WAIT 1i8 10 | WAIT 1 11 | ENDIF 12 | 13 | // CHECK-NEXT-L: MAIN_1: 14 | // CHECK-NEXT-L: ANDOR 2i8 15 | // CHECK-NEXT-L: IS_INT_VAR_EQUAL_TO_NUMBER &8 1i8 16 | // CHECK-NEXT-L: IS_INT_VAR_EQUAL_TO_NUMBER &8 2i8 17 | // CHECK-NEXT-L: IS_INT_VAR_EQUAL_TO_NUMBER &8 3i8 18 | // CHECK-NEXT-L: GOTO_IF_FALSE @MAIN_2 19 | IF x = 1 20 | AND x = 2 21 | AND x = 3 22 | // CHECK-NEXT-L: WAIT 3i8 23 | WAIT 3 24 | ENDIF 25 | 26 | // CHECK-NEXT-L: MAIN_2: 27 | // CHECK-NEXT-L: ANDOR 22i8 28 | // CHECK-NEXT-L: IS_INT_VAR_EQUAL_TO_NUMBER &8 1i8 29 | // CHECK-NEXT-L: IS_INT_VAR_EQUAL_TO_NUMBER &8 2i8 30 | // CHECK-NEXT-L: IS_INT_VAR_EQUAL_TO_NUMBER &8 3i8 31 | // CHECK-NEXT-L: GOTO_IF_FALSE @MAIN_3 32 | IF x = 1 33 | OR x = 2 34 | OR x = 3 35 | // CHECK-NEXT-L: WAIT 2i8 36 | WAIT 2 37 | ENDIF 38 | 39 | // CHECK-NEXT-L: MAIN_3: 40 | // CHECK-L: IS_INT_VAR_EQUAL_TO_NUMBER &8 1i8 41 | // CHECK-NEXT-L: NOT IS_INT_VAR_EQUAL_TO_NUMBER &8 2i8 42 | IF x = 1 43 | OR NOT x = 2 44 | WAIT 0 45 | ENDIF 46 | 47 | TERMINATE_THIS_SCRIPT -------------------------------------------------------------------------------- /test/codegen/cheader_multifile.sc: -------------------------------------------------------------------------------- 1 | // This is a test about custom headers in multifiles. The sample header used is OATC. 2 | // 3 | // # Check IR2 with and without OATC 4 | // RUN: %gta3sc %s --config=gtasa --guesser -emit-ir2 -o - -fcleo | %FileCheck %s 5 | // RUN: %gta3sc %s --config=gtasa --guesser -emit-ir2 -o - -fcleo -moatc | %FileCheck %s 6 | // 7 | // # Check the binary representation 8 | // RUN: mkdir "%/T/cheader_multifile" || echo _ 9 | // RUN: %gta3sc %s --config=gtasa --guesser -o "%/T/cheader_multifile/main.scm" -fcleo -moatc 10 | // RUN: %checksum "%/T/cheader_multifile/main.scm" 0a46a795e750d46c61d358a9546a0454 11 | // RUN: %checksum "%/T/cheader_multifile/script.img" 6c406015e6f70f9dc11571136a80b71a 12 | // 13 | VAR_INT v2 14 | 15 | // CHECK-NEXT-L: #DEFINE_STREAM STREAM1 0 16 | // CHECK-NEXT-L: #DEFINE_STREAM AAA 1 17 | 18 | // CHECK-NEXT-L: MAIN_1: 19 | main_label: 20 | 21 | LAUNCH_MISSION subscript1.sc 22 | LOAD_AND_LAUNCH_MISSION miss1.sc 23 | REGISTER_STREAMED_SCRIPT stream1 stream1.sc 24 | 25 | // CHECK-L: IS_GAME_VERSION_ORIGINAL 26 | IS_GAME_VERSION_ORIGINAL 27 | // CHECK-NEXT-L: GET_LABEL_POINTER @MAIN_1 &8 28 | GET_LABEL_POINTER main_label v2 29 | 30 | // CHECK-NEXT-L: TERMINATE_THIS_SCRIPT 31 | TERMINATE_THIS_SCRIPT 32 | 33 | 34 | // subscript1.sc 35 | // CHECK-NEXT-L: MAIN_2: 36 | // CHECK-NEXT-L: GET_THIS_SCRIPT_STRUCT &12 37 | // CHECK-NEXT-L: TERMINATE_THIS_SCRIPT 38 | 39 | // miss1.sc 40 | // CHECK-NEXT-L: #MISSION_BLOCK_START 0 41 | // CHECK-NEXT-L: SCRIPT_NAME 'MISS1' 42 | // CHECK-NEXT-L: MISSION_0_1: 43 | // CHECK-NEXT-L: IS_CAR_SIREN_ON 0i8 44 | // CHECK-NEXT-L: GOSUB_IF_FALSE %MISSION_0_1 45 | // CHECK-NEXT-L: TERMINATE_THIS_SCRIPT 46 | // CHECK-NEXT-L: #MISSION_BLOCK_END 47 | 48 | // stream1.sc 49 | // CHECK-NEXT-L: #STREAMED_BLOCK_START 0 50 | // CHECK-NEXT-L: SCRIPT_NAME 'STREAM1' 51 | // CHECK-NEXT-L: STREAM_0_1: 52 | // CHECK-NEXT-L: IS_KEY_PRESSED 0i8 53 | // CHECK-NEXT-L: GOSUB_IF_FALSE %STREAM_0_1 54 | // CHECK-NEXT-L: TERMINATE_THIS_SCRIPT 55 | // CHECK-NEXT-L: #STREAMED_BLOCK_END 56 | -------------------------------------------------------------------------------- /test/codegen/cheader_multifile/miss1.sc: -------------------------------------------------------------------------------- 1 | MISSION_START 2 | SCRIPT_NAME miss1 3 | miss1_label: 4 | IS_CAR_SIREN_ON 0 5 | GOSUB_IF_FALSE miss1_label 6 | MISSION_END -------------------------------------------------------------------------------- /test/codegen/cheader_multifile/stream1.sc: -------------------------------------------------------------------------------- 1 | SCRIPT_START 2 | SCRIPT_NAME stream1 3 | stream1_label: 4 | IS_KEY_PRESSED 0 5 | GOSUB_IF_FALSE stream1_label 6 | SCRIPT_END -------------------------------------------------------------------------------- /test/codegen/cheader_multifile/subscript1.sc: -------------------------------------------------------------------------------- 1 | MISSION_START 2 | VAR_INT ptr_sub1 3 | GET_THIS_SCRIPT_STRUCT ptr_sub1 4 | MISSION_END -------------------------------------------------------------------------------- /test/codegen/cheader_oatc.sc: -------------------------------------------------------------------------------- 1 | // # Check IR2 with and without OATC 2 | // RUN: %gta3sc %s --config=gtasa --guesser -emit-ir2 -o - -fcleo | %FileCheck %s 3 | // RUN: %gta3sc %s --config=gtasa --guesser -emit-ir2 -o - --cs -D CS | %FileCheck %s 4 | // RUN: %gta3sc %s --config=gtasa --guesser -emit-ir2 -o - --cm -D CM | %FileCheck %s 5 | // RUN: %gta3sc %s --config=gtasa --guesser -emit-ir2 -o - -fcleo -moatc | %FileCheck %s 6 | // RUN: %gta3sc %s --config=gtasa --guesser -emit-ir2 -o - --cs -D CS -moatc | %FileCheck %s 7 | // RUN: %gta3sc %s --config=gtasa --guesser -emit-ir2 -o - --cm -D CM -moatc | %FileCheck %s 8 | // 9 | // # Check the binary representation 10 | // RUN: mkdir "%/T/cheader_oatc" || echo _ 11 | // RUN: %gta3sc %s --config=gtasa --guesser -o "%/T/cheader_oatc/c1.cs" --cs -D CS -moatc 12 | // RUN: %checksum "%/T/cheader_oatc/c1.cs" 7e42cec2b9d51489e8c87ad4987759ed 13 | // 14 | #ifdef CS 15 | SCRIPT_START 16 | #endif 17 | #ifdef CM 18 | MISSION_START 19 | #endif 20 | { 21 | LVAR_INT x 22 | 23 | // Skip SCM Header 24 | // CHECK: WAIT 100i8 25 | WAIT 100 26 | 27 | // CHECK-NEXT-L: WRITE_MEMORY 0i8 1i8 0i8 0i8 28 | WRITE_MEMORY 0 1 0 FALSE 29 | 30 | // CHECK-NEXT-L: MAIN_1: 31 | loop1: 32 | // CHECK-NEXT-L: WAIT 0i8 33 | WAIT 0 34 | // CHECK-NEXT-L: IS_GAME_VERSION_ORIGINAL 35 | IS_GAME_VERSION_ORIGINAL 36 | // CHECK-NEXT-L: IS_GAME_VERSION_ORIGINAL 37 | IS_GAME_VERSION_ORIGINAL // using the same command twice shouldn't put it in the header twice 38 | // CHECK-NEXT: GOTO_IF_FALSE [@%]MAIN_1 39 | GOTO_IF_FALSE loop1 40 | 41 | // CHECK-NEXT-L: MAIN_2: 42 | loop2: 43 | // CHECK-NEXT: GET_LABEL_POINTER [@%]MAIN_1 \d+@ 44 | GET_LABEL_POINTER loop1 x 45 | // CHECK-NEXT: GOTO [@%]MAIN_2 46 | GOTO loop2 47 | } 48 | #ifdef CM 49 | MISSION_END 50 | #endif 51 | #ifdef CS 52 | SCRIPT_END 53 | #endif -------------------------------------------------------------------------------- /test/codegen/cleo_call.sc: -------------------------------------------------------------------------------- 1 | // RUN: %gta3sc %s --config=gtasa --guesser --cs -emit-ir2 -o - | %FileCheck %s 2 | SCRIPT_START 3 | { 4 | LVAR_INT a 5 | LVAR_TEXT_LABEL text 6 | LVAR_INT i 7 | LVAR_FLOAT f 8 | 9 | // CHECK-L: CLEO_CALL %MAIN_1 2i8 5i8 5i8 0@ 10 | CLEO_CALL sum 0 5 5 a 11 | 12 | // /////CHECK-L: CLEO_CALL %MAIN_1 2i8 "TEXT" 1@s 0@ 13 | //CLEO_CALL sum 0 text $text a // sums two pointers 14 | 15 | // /////CHECK-L: CLEO_CALL %MAIN_1 2i8 "Test Case" 1@s 0@ 16 | //CLEO_CALL sum 0 "Test Case" $text a // sums two pointers 17 | 18 | // CHECK-L: CLEO_CALL %MAIN_2 0i8 3@ 4@ 19 | CLEO_CALL test_110 0 i f 20 | 21 | TERMINATE_THIS_CUSTOM_SCRIPT 22 | } 23 | 24 | { 25 | sum: 26 | LVAR_INT a b c 27 | c = a + b 28 | // CHECK-L: CLEO_RETURN 1i8 2@ 29 | CLEO_RETURN 0 c 30 | } 31 | 32 | { 33 | test_110: // regression test for #110 34 | LVAR_INT a 35 | LVAR_FLOAT b 36 | // CHECK-L: CLEO_RETURN 2i8 0@ 1@ 37 | CLEO_RETURN 0 a b 38 | } 39 | 40 | SCRIPT_END -------------------------------------------------------------------------------- /test/codegen/cleo_mission.sc: -------------------------------------------------------------------------------- 1 | // RUN: %gta3sc %s --config=gtasa --guesser --cm -emit-ir2 -o - | %FileCheck %s 2 | 3 | MISSION_START 4 | // CHECK-NEXT-L: GOSUB %MAIN_1 5 | GOSUB test_offset 6 | // CHECK-NEXT-L: TERMINATE_THIS_SCRIPT 7 | MISSION_END 8 | 9 | { 10 | // CHECK-NEXT-L: MAIN_1: 11 | test_offset: 12 | 13 | LVAR_INT i j k 14 | 15 | // CHECK-NEXT-L: SET_LVAR_INT 32@ 0i8 16 | timera = 0 17 | 18 | // CHECK-NEXT-L: SET_LVAR_INT 34@ 100i8 19 | i = 100 20 | 21 | // CHECK-NEXT-L: TERMINATE_THIS_SCRIPT 22 | TERMINATE_THIS_SCRIPT // testing if terminate is allowed 23 | } 24 | -------------------------------------------------------------------------------- /test/codegen/cleo_param.sc: -------------------------------------------------------------------------------- 1 | // RUN: %gta3sc %s --config=gtasa --guesser --cs -emit-ir2 -o - | %FileCheck %s 2 | SCRIPT_START 3 | { 4 | LVAR_INT i r 5 | LVAR_FLOAT f 6 | LVAR_TEXT_LABEL text8 7 | LVAR_TEXT_LABEL16 text16 8 | 9 | // CHECK-NEXT-L: CALL_FUNCTION_RETURN 0i8 4i8 4i8 0@ 2@ "TEXT8" "TEXT16" 1@ 10 | CALL_FUNCTION_RETURN 0 4 4 i f text8 text16 r 11 | 12 | // CHECK-NEXT-L: CALL_FUNCTION_RETURN 0i8 4i8 4i8 0@ 2@ 3@s 5@v 1@ 13 | CALL_FUNCTION_RETURN 0 4 4 i f $text8 $text16 r 14 | 15 | // CHECK-NEXT-L: CALL_FUNCTION_RETURN 0i8 1i8 1i8 "Test Case" 1@ 16 | CALL_FUNCTION_RETURN 0 1 1 "Test Case" r 17 | 18 | // NOTE: Using a label or text label variable in the last argument of this family of commands is ill-formed! 19 | // CALL_FUNCTION_RETURN 0 0 0 text8 20 | 21 | TERMINATE_THIS_CUSTOM_SCRIPT 22 | } 23 | SCRIPT_END -------------------------------------------------------------------------------- /test/codegen/cleo_script.sc: -------------------------------------------------------------------------------- 1 | // RUN: %gta3sc %s --config=gtasa --guesser --cs -emit-ir2 -o - | %FileCheck %s 2 | SCRIPT_START 3 | // CHECK-NEXT-L: GOSUB %MAIN_1 4 | GOSUB test_offset 5 | // CHECK-NEXT-L: TERMINATE_THIS_CUSTOM_SCRIPT 6 | SCRIPT_END 7 | 8 | { 9 | // CHECK-NEXT-L: MAIN_1: 10 | test_offset: 11 | 12 | LVAR_INT i j k 13 | 14 | // CHECK-NEXT-L: SET_LVAR_INT 32@ 0i8 15 | timera = 0 16 | 17 | // CHECK-NEXT-L: SET_LVAR_INT 0@ 100i8 18 | i = 100 19 | 20 | // CHECK-NEXT-L: TERMINATE_THIS_CUSTOM_SCRIPT 21 | TERMINATE_THIS_CUSTOM_SCRIPT 22 | } 23 | -------------------------------------------------------------------------------- /test/codegen/cleo_string.sc: -------------------------------------------------------------------------------- 1 | // RUN: %gta3sc %s --config=gtasa --guesser --cs -emit-ir2 -o - | %FileCheck %s 2 | SCRIPT_START 3 | { 4 | LVAR_INT ptr1 ptr2 5 | LVAR_TEXT_LABEL16 text16 6 | 7 | // CHECK-NEXT-L: COPY_FILE "PTR1" "PTR2" 8 | COPY_FILE ptr1 ptr2 9 | // CHECK-NEXT-L: COPY_FILE 0@ 1@ 10 | COPY_FILE $ptr1 $ptr2 11 | // CHECK-NEXT-L: COPY_FILE "Preserve Case" 2@v 12 | COPY_FILE "Preserve Case" $text16 13 | 14 | TERMINATE_THIS_CUSTOM_SCRIPT 15 | } 16 | SCRIPT_END -------------------------------------------------------------------------------- /test/codegen/cleo_string_3vc.sc: -------------------------------------------------------------------------------- 1 | // RUN: %gta3sc %s --config=gta3 --cs -emit-ir2 -o - | %FileCheck %s 2 | // RUN: %gta3sc %s --config=gtavc --cs -emit-ir2 -o - | %FileCheck %s 3 | SCRIPT_START 4 | { 5 | LVAR_INT ptr1 ptr2 6 | //LVAR_TEXT_LABEL16 text16 7 | 8 | // CHECK-NEXT-L: COPY_FILE "PTR1" "PTR2" 9 | COPY_FILE ptr1 ptr2 10 | // CHECK-NEXT-L: COPY_FILE 0@ 1@ 11 | COPY_FILE $ptr1 $ptr2 12 | // CHECK-NEXT-L: COPY_FILE "Preserve Case" 0@ 13 | COPY_FILE "Preserve Case" $ptr1 // test changed from SA 14 | 15 | TERMINATE_THIS_CUSTOM_SCRIPT 16 | } 17 | SCRIPT_END 18 | -------------------------------------------------------------------------------- /test/codegen/collectables.sc: -------------------------------------------------------------------------------- 1 | // RUN: %gta3sc %s --config=gta3 -emit-ir2 -o - | %FileCheck %s 2 | 3 | // CHECK-L: SET_COLLECTABLE1_TOTAL 6i8 4 | SET_COLLECTABLE1_TOTAL 0 5 | 6 | CREATE_COLLECTABLE1 1.0 0.0 0.0 7 | CREATE_COLLECTABLE1 2.0 0.0 0.0 8 | CREATE_COLLECTABLE1 3.0 0.0 0.0 9 | CREATE_COLLECTABLE1 4.0 0.0 0.0 10 | CREATE_COLLECTABLE1 5.0 0.0 0.0 11 | CREATE_COLLECTABLE1 6.0 0.0 0.0 12 | 13 | TERMINATE_THIS_SCRIPT -------------------------------------------------------------------------------- /test/codegen/const.sc: -------------------------------------------------------------------------------- 1 | // RUN: %gta3sc %s --config=gtasa --guesser -emit-ir2 -o - | %FileCheck %s 2 | 3 | VAR_INT i 4 | VAR_FLOAT f 5 | 6 | // CHECK-L: WAIT 101i8 7 | WAIT my_int_const 8 | 9 | // CHECK-L: SET_TIME_SCALE 0x1.800000p+0f 10 | SET_TIME_SCALE my_flt_const 11 | 12 | // CHECK-L: SET_VAR_INT &8 101i8 13 | i = MY_INT_CONST 14 | 15 | // CHECK-L: SET_VAR_FLOAT &12 0x1.800000p+0f 16 | f = MY_FLT_CONST 17 | 18 | // CHECK-NOT: CONST_INT.* 19 | CONST_INT my_int_const 101 20 | 21 | // CHECK-NOT: CONST_FLOAT.* 22 | CONST_FLOAT my_flt_const 1.5 23 | 24 | TERMINATE_THIS_SCRIPT -------------------------------------------------------------------------------- /test/codegen/constant_precedence.sc: -------------------------------------------------------------------------------- 1 | // Constants takes precedence over variables! 2 | // RUN: %gta3sc %s --config=gtavc -fno-constant-checks --datadir=../semantics/Inputs/data -emit-ir2 -o - | %FileCheck %s 3 | 4 | VAR_INT on 5 | VAR_INT red 6 | VAR_INT cheetah 7 | VAR_INT lv_object 8 | 9 | // CHECK-NEXT-L: #DEFINE_MODEL LV_OBJECT -1 10 | // CHECK-NEXT-L: CREATE_OBJECT -1i8 0x0.000000p+0f 0x0.000000p+0f 0x0.000000p+0f &20 11 | CREATE_OBJECT lv_object 0.0 0.0 0.0 lv_object 12 | 13 | // CHECK-NEXT-L: CREATE_CAR 400i16 0x0.000000p+0f 0x0.000000p+0f 0x0.000000p+0f &16 14 | CREATE_CAR cheetah 0.0 0.0 0.0 cheetah 15 | 16 | // CHECK-NEXT-L: CREATE_PLAYER 0i8 0x0.000000p+0f 0x0.000000p+0f 0x0.000000p+0f 1i8 17 | CREATE_PLAYER 0 0.0 0.0 0.0 on // global constant 18 | 19 | // CHECK-NEXT-L: ADD_BLIP_FOR_CAR &16 &12 20 | ADD_BLIP_FOR_CAR cheetah red 21 | 22 | // CHECK-NEXT-L: CHANGE_BLIP_COLOUR &12 0i8 23 | CHANGE_BLIP_COLOUR red red 24 | 25 | // CHECK-NEXT-L: SET_PLAYER_CONTROL 1i8 1i8 26 | SET_PLAYER_CONTROL on on // global constant 27 | 28 | TERMINATE_THIS_SCRIPT -------------------------------------------------------------------------------- /test/codegen/control_flow.sc: -------------------------------------------------------------------------------- 1 | // RUN: %gta3sc %s --config=gtavc -emit-ir2 -o - | %FileCheck %s 2 | 3 | VAR_INT x 4 | 5 | // CHECK-NEXT-L: ANDOR 0i8 6 | // CHECK-NEXT-L: IS_INT_VAR_EQUAL_TO_NUMBER &8 0i8 7 | // CHECK-NEXT-L: GOTO_IF_FALSE @MAIN_1 8 | IF x = 0 9 | // CHECK-NEXT-L: WAIT 1i8 10 | // CHECK-NEXT-L: NOP 11 | WAIT 1 12 | NOP 13 | ENDIF 14 | 15 | // CHECK-NEXT-L: MAIN_1: 16 | // CHECK-NEXT-L: ANDOR 0i8 17 | // CHECK-NEXT-L: IS_INT_VAR_EQUAL_TO_NUMBER &8 0i8 18 | // CHECK-NEXT-L: GOTO_IF_FALSE @MAIN_2 19 | IF x = 0 20 | // CHECK-NEXT-L: WAIT 2i8 21 | // CHECK-NEXT-L: NOP 22 | // CHECK-NEXT-L: GOTO @MAIN_3 23 | WAIT 2 24 | NOP 25 | ELSE 26 | // CHECK-NEXT-L: MAIN_2: 27 | // CHECK-NEXT-L: WAIT 3i8 28 | // CHECK-NEXT-L: NOP 29 | WAIT 3 30 | NOP 31 | ENDIF 32 | 33 | // CHECK-NEXT-L: MAIN_3: 34 | // CHECK-NEXT-L: ANDOR 0i8 35 | // CHECK-NEXT-L: IS_INT_VAR_EQUAL_TO_NUMBER &8 0i8 36 | // CHECK-NEXT-L: GOTO_IF_FALSE @MAIN_4 37 | WHILE x = 0 38 | // CHECK-NEXT-L: WAIT 10i8 39 | // CHECK-NEXT-L: NOP 40 | // CHECK-NEXT-L: GOTO @MAIN_3 41 | WAIT 10 42 | NOP 43 | ENDWHILE 44 | 45 | // CHECK-NEXT-L: MAIN_4: 46 | // CHECK-NEXT-L: SET_VAR_INT &8 0i8 47 | REPEAT 10 x 48 | // CHECK-NEXT-L: MAIN_5: 49 | // CHECK-NEXT-L: WAIT 11i8 50 | // CHECK-NEXT-L: NOP 51 | WAIT 11 52 | NOP 53 | // CHECK-NEXT-L: ADD_VAL_TO_INT_VAR &8 1i8 54 | // CHECK-NEXT-L: IS_INT_VAR_GREATER_OR_EQUAL_TO_NUMBER &8 10i8 55 | // CHECK-NEXT-L: GOTO_IF_FALSE @MAIN_5 56 | ENDREPEAT 57 | 58 | // CHECK-NEXT-L: TERMINATE_THIS_SCRIPT 59 | TERMINATE_THIS_SCRIPT -------------------------------------------------------------------------------- /test/codegen/dump.sc: -------------------------------------------------------------------------------- 1 | // RUN: %gta3sc %s --config=gta3 -emit-ir2 -o - | %FileCheck %s 2 | 3 | DUMP 4 | // CHECK-NEXT-L: WAIT 127i8 5 | 0100 04 7F 6 | // CHECK-NEXT-L: WAIT -1i8 7 | 01 00 04 FF 8 | // CHECK-NEXT-L: WAIT -110i8 9 | 01 00 04 92 10 | // CHECK-NEXT-L: SHAKE_CAM 0x0.000000p+0f 11 | 0300 060000 12 | ENDDUMP 13 | 14 | DUMP 15 | // CHECK-NEXT-L: PRINT_WITH_2_NUMBERS_BIG 'TeST1234' 1011709285i32 107i8 108i8 17716i16 16 | "m" 03 // 0x036D 17 | "TeST1234" // ... 18 | 01 "euM<" // 01 0x3C4D7565 19 | 04 "k" // 04 0x6B 20 | 04 "l" // 04 0x6C 21 | 05 "4E" // 05 0x4534 22 | ENDDUMP 23 | 24 | // CHECK-NEXT-L: TERMINATE_THIS_SCRIPT 25 | TERMINATE_THIS_SCRIPT 26 | -------------------------------------------------------------------------------- /test/codegen/expr.sc: -------------------------------------------------------------------------------- 1 | // RUN: %gta3sc %s --config=gtavc -emit-ir2 -o - | %FileCheck %s 2 | 3 | // TODO test all the expression alternators (maybe in alternators.sc) 4 | 5 | VAR_INT i j k 6 | VAR_FLOAT x y z 7 | 8 | // Test commutation property 9 | { 10 | // CHECK-L: MULT_INT_VAR_BY_VAL &8 2i8 11 | i = 2 * i 12 | // CHECK-NEXT-L: MULT_INT_VAR_BY_VAL &8 2i8 13 | i = i * 2 14 | // CHECK-NEXT-L: ADD_VAL_TO_INT_VAR &8 2i8 15 | i = 2 + i 16 | // CHECK-NEXT-L: ADD_VAL_TO_INT_VAR &8 2i8 17 | i = i + 2 18 | } 19 | 20 | // 21 | { 22 | // CHECK-NEXT: SUB_INT_VAR_FROM_INT_VAR &8 &8 23 | i = i - i 24 | // CHECK-NEXT: SUB_VAL_FROM_INT_VAR &8 4i8 25 | i = i - 4 26 | // CHECK-NEXT: SET_VAR_INT_TO_VAR_INT &8 &12 27 | // CHECK-NEXT: SUB_VAL_FROM_INT_VAR &8 5i8 28 | i = j - 5 29 | } 30 | 31 | // Test VAR = CONST 32 | { 33 | // CHECK: IS_INT_VAR_GREATER_THAN_CONSTANT &16 [\di]+ 34 | // CHECK: IS_INT_VAR_EQUAL_TO_CONSTANT &16 [\di]+ 35 | IF k > FBI 36 | OR k = ARMY 37 | // CHECK: SET_VAR_INT_TO_CONSTANT &16 [\di]+ 38 | k = SWAT 39 | ENDIF 40 | } 41 | 42 | // Test Increment/Decrement 43 | { 44 | // CHECK-L: ADD_VAL_TO_INT_VAR &8 1i8 45 | ++i 46 | // CHECK-NEXT-L: SUB_VAL_FROM_INT_VAR &8 1i8 47 | --i 48 | } 49 | 50 | TERMINATE_THIS_SCRIPT -------------------------------------------------------------------------------- /test/codegen/extension_lvar_eq_var.sc: -------------------------------------------------------------------------------- 1 | // RUN: %gta3sc %s --config=gta3 -emit-ir2 -o - | %FileCheck %s 2 | // RUN: %gta3sc %s --config=gtavc -emit-ir2 -o - | %FileCheck %s 3 | // RUN: %not %gta3sc %s --config=gta3 -emit-ir2 -o - -pedantic-errors 4 | // RUN: %not %gta3sc %s --config=gtavc -emit-ir2 -o - -pedantic-errors 5 | { 6 | VAR_INT gi 7 | LVAR_INT li 8 | VAR_FLOAT gf 9 | LVAR_FLOAT lf 10 | 11 | // CHECK-L: ANDOR 21i8 12 | // CHECK-NEXT: IS_INT_VAR_EQUAL_TO_INT_VAR 0@ &8 13 | // CHECK-NEXT: IS_FLOAT_VAR_EQUAL_TO_FLOAT_VAR 1@ &12 14 | IF li = gi 15 | OR lf = gf 16 | NOP 17 | ENDIF 18 | 19 | TERMINATE_THIS_SCRIPT 20 | } -------------------------------------------------------------------------------- /test/codegen/extension_repeat_lvar.sc: -------------------------------------------------------------------------------- 1 | // RUN: %gta3sc %s --config=gta3 -emit-ir2 -o - | %FileCheck %s 2 | // RUN: %gta3sc %s --config=gtavc -emit-ir2 -o - | %FileCheck %s 3 | // RUN: %gta3sc %s --config=gtasa --guesser -emit-ir2 -o - | %FileCheck %s 4 | // RUN: %not %gta3sc %s --config=gta3 -emit-ir2 -o - -pedantic-errors 5 | // RUN: %not %gta3sc %s --config=gtavc -emit-ir2 -o - -pedantic-errors 6 | // RUN: %not %gta3sc %s --config=gtasa --guesser -emit-ir2 -o - -pedantic-errors 7 | { 8 | LVAR_INT lvar 9 | 10 | // CHECK-L: ADD_VAL_TO_INT_LVAR 0@ 1i8 11 | // CHECK-L: IS_INT_LVAR_GREATER_OR_EQUAL_TO_NUMBER 0@ 5i8 12 | 13 | REPEAT 5 lvar 14 | NOP 15 | ENDREPEAT 16 | 17 | TERMINATE_THIS_SCRIPT 18 | } -------------------------------------------------------------------------------- /test/codegen/models.sc: -------------------------------------------------------------------------------- 1 | // 2 | // Testing of the models header is performed by test/main-test-gta3. 3 | // 4 | // RUN: echo _ -------------------------------------------------------------------------------- /test/codegen/multifile.sc: -------------------------------------------------------------------------------- 1 | // RUN: %gta3sc %s --config=gta3 -emit-ir2 -o - | %FileCheck %s 2 | // # SCM Header, Alignment and such performed by test/main-test-gta3/ 3 | 4 | // Put declarations out of order, so we can ensure miss2 ordering. 5 | 6 | // CHECK-NEXT-L: GOSUB @MAIN_3 7 | GOSUB gosub2 8 | 9 | // CHECK-NEXT-L: GOSUB_FILE @MAIN_2 @MAIN_2 10 | GOSUB_FILE gosub1 gosub1.sc 11 | 12 | // CHECK-NEXT-L: LAUNCH_MISSION @MAIN_5 13 | LAUNCH_MISSION subscript1.sc 14 | 15 | // CHECK-NEXT-L: LOAD_AND_LAUNCH_MISSION_INTERNAL 0i8 16 | LOAD_AND_LAUNCH_MISSION mission1.sc 17 | 18 | // CHECK-NEXT-L: LAUNCH_MISSION @MAIN_6 19 | LAUNCH_MISSION subscript2.sc 20 | 21 | // CHECK-NEXT-L: GOSUB_FILE @MAIN_3 @MAIN_3 22 | GOSUB_FILE gosub2 gosub2.sc 23 | 24 | // CHECK-NEXT-L: LOAD_AND_LAUNCH_MISSION_INTERNAL 1i8 25 | LOAD_AND_LAUNCH_MISSION mission2.sc 26 | 27 | // CHECK-NEXT-L: TERMINATE_THIS_SCRIPT 28 | TERMINATE_THIS_SCRIPT 29 | 30 | // gosub1.sc 31 | // CHECK-NEXT-L: MAIN_1: 32 | // CHECK-NEXT-L: RETURN 33 | // CHECK-NEXT-L: MAIN_2: 34 | // CHECK-NEXT-L: PRINT_HELP 'GOSUB1' 35 | // CHECK-NEXT-L: GOTO @MAIN_1 36 | 37 | // gosub2.sc 38 | // CHECK-NEXT-L: MAIN_3: 39 | // CHECK-NEXT-L: PRINT_HELP 'GOSUB2' 40 | // CHECK-NEXT-L: GOSUB_FILE @MAIN_4 @MAIN_4 41 | // CHECK-NEXT-L: RETURN 42 | 43 | // gosub3.sc 44 | // CHECK-NEXT-L: MAIN_4: 45 | // CHECK-NEXT-L: PRINT_HELP 'GOSUB3' 46 | // CHECK-NEXT-L: LOAD_AND_LAUNCH_MISSION_INTERNAL 2i8 47 | // CHECK-NEXT-L: RETURN 48 | 49 | // subscript1.sc 50 | // CHECK-NEXT-L: MAIN_5: 51 | // CHECK-NEXT-L: PRINT_HELP 'SUBSC1' 52 | // CHECK-NEXT-L: TERMINATE_THIS_SCRIPT 53 | 54 | // subscript2.sc 55 | // CHECK-NEXT-L: MAIN_6: 56 | // CHECK-NEXT-L: PRINT_HELP 'SUBSC2' 57 | // CHECK-NEXT-L: TERMINATE_THIS_SCRIPT 58 | 59 | // mission1.sc 60 | // CHECK-NEXT-L: #MISSION_BLOCK_START 0 61 | // CHECK-NEXT-L: PRINT_HELP 'MISS1' 62 | // CHECK-NEXT-L: TERMINATE_THIS_SCRIPT 63 | // CHECK-NEXT-L: #MISSION_BLOCK_END 64 | 65 | // mission2.sc 66 | // CHECK-NEXT-L: #MISSION_BLOCK_START 1 67 | // CHECK-NEXT-L: PRINT_HELP 'MISS2' 68 | // CHECK-NEXT-L: TERMINATE_THIS_SCRIPT 69 | // CHECK-NEXT-L: #MISSION_BLOCK_END 70 | 71 | // mission3.sc 72 | // CHECK-NEXT-L: #MISSION_BLOCK_START 2 73 | // CHECK-NEXT-L: PRINT_HELP 'MISS3' 74 | // CHECK-NEXT-L: TERMINATE_THIS_SCRIPT 75 | // CHECK-NEXT-L: #MISSION_BLOCK_END 76 | -------------------------------------------------------------------------------- /test/codegen/multifile/gosub1.sc: -------------------------------------------------------------------------------- 1 | 2 | before_gosub1: 3 | RETURN 4 | 5 | gosub1: 6 | PRINT_HELP gosub1 7 | GOTO before_gosub1 8 | -------------------------------------------------------------------------------- /test/codegen/multifile/gosub2.sc: -------------------------------------------------------------------------------- 1 | 2 | gosub2: 3 | PRINT_HELP gosub2 4 | GOSUB_FILE gosub3 gosub3.sc 5 | RETURN 6 | -------------------------------------------------------------------------------- /test/codegen/multifile/gosub3.sc: -------------------------------------------------------------------------------- 1 | 2 | gosub3: 3 | PRINT_HELP gosub3 4 | LOAD_AND_LAUNCH_MISSION mission3.sc 5 | RETURN 6 | -------------------------------------------------------------------------------- /test/codegen/multifile/subdir/mission1/mission1.sc: -------------------------------------------------------------------------------- 1 | MISSION_START 2 | PRINT_HELP miss1 3 | MISSION_END -------------------------------------------------------------------------------- /test/codegen/multifile/subdir/mission2/mission2.sc: -------------------------------------------------------------------------------- 1 | MISSION_START 2 | PRINT_HELP miss2 3 | MISSION_END -------------------------------------------------------------------------------- /test/codegen/multifile/subdir/mission3.sc: -------------------------------------------------------------------------------- 1 | MISSION_START 2 | PRINT_HELP miss3 3 | MISSION_END -------------------------------------------------------------------------------- /test/codegen/multifile/subdir/subscript2.sc: -------------------------------------------------------------------------------- 1 | MISSION_START 2 | PRINT_HELP subsc2 3 | MISSION_END -------------------------------------------------------------------------------- /test/codegen/multifile/subscript1.sc: -------------------------------------------------------------------------------- 1 | MISSION_START 2 | PRINT_HELP subsc1 3 | MISSION_END -------------------------------------------------------------------------------- /test/codegen/offsets/gosub1.sc: -------------------------------------------------------------------------------- 1 | gosub1: 2 | PRINT_HELP gosub1 3 | 4 | gosub1_label1: 5 | IS_BUTTON_PRESSED PAD1 RIGHTSHOCK 6 | GOTO_IF_FALSE gosub1_label2 7 | GOTO gosub1_label3 8 | 9 | gosub1_label2: 10 | WAIT 0 11 | GOTO gosub1_label1 12 | 13 | gosub1_label3: 14 | RETURN 15 | -------------------------------------------------------------------------------- /test/codegen/offsets/mission1.sc: -------------------------------------------------------------------------------- 1 | MISSION_START 2 | PRINT_HELP miss1 3 | 4 | miss1_label1: 5 | IS_BUTTON_PRESSED PAD1 RIGHTSHOCK 6 | GOTO_IF_FALSE miss1_label2 7 | GOTO miss1_label3 8 | 9 | miss1_label2: 10 | WAIT 0 11 | GOTO miss1_label1 12 | 13 | miss1_label3: 14 | MISSION_END -------------------------------------------------------------------------------- /test/codegen/offsets/stream1.sc: -------------------------------------------------------------------------------- 1 | SCRIPT_START 2 | PRINT_HELP stream1 3 | 4 | stream1_label1: 5 | IS_BUTTON_PRESSED PAD1 RIGHTSHOCK 6 | GOTO_IF_FALSE stream1_label2 7 | GOTO stream1_label3 8 | 9 | stream1_label2: 10 | WAIT 0 11 | GOTO stream1_label1 12 | 13 | stream1_label3: 14 | SCRIPT_END -------------------------------------------------------------------------------- /test/codegen/offsets/subscript1.sc: -------------------------------------------------------------------------------- 1 | MISSION_START 2 | PRINT_HELP subsc1 3 | 4 | subsc1_label1: 5 | IS_BUTTON_PRESSED PAD1 RIGHTSHOCK 6 | GOTO_IF_FALSE subsc1_label2 7 | GOTO subsc1_label3 8 | 9 | subsc1_label2: 10 | WAIT 0 11 | GOTO subsc1_label1 12 | 13 | subsc1_label3: 14 | MISSION_END -------------------------------------------------------------------------------- /test/codegen/optimize_andor.sc: -------------------------------------------------------------------------------- 1 | // RUN: %gta3sc %s --config=gta3 -moptimize-andor -emit-ir2 -o - | %FileCheck %s 2 | 3 | VAR_INT x 4 | 5 | // CHECK-NOT-L: ANDOR 0i8 6 | // CHECK-L: IS_INT_VAR_EQUAL_TO_NUMBER &8 0i8 7 | IF x = 0 8 | WAIT 0 9 | ENDIF 10 | 11 | // CHECK-NOT-L: ANDOR 0i8 12 | // CHECK-L: IS_INT_VAR_EQUAL_TO_NUMBER &8 0i8 13 | WHILE x = 0 14 | WAIT 0 15 | ENDWHILE 16 | 17 | TERMINATE_THIS_SCRIPT 18 | 19 | -------------------------------------------------------------------------------- /test/codegen/optimize_zero.sc: -------------------------------------------------------------------------------- 1 | // RUN: %gta3sc %s --config=gtavc -moptimize-zero -emit-ir2 -o - | %FileCheck %s 2 | 3 | // CHECK-L: SET_TIME_SCALE 0i8 4 | SET_TIME_SCALE 0.0 5 | 6 | TERMINATE_THIS_SCRIPT -------------------------------------------------------------------------------- /test/codegen/progress.sc: -------------------------------------------------------------------------------- 1 | // RUN: %gta3sc %s --config=gtasa --guesser -emit-ir2 -o - | %FileCheck %s 2 | 3 | // CHECK-L: SET_TOTAL_NUMBER_OF_MISSIONS 3i8 4 | SET_TOTAL_NUMBER_OF_MISSIONS 0 5 | // CHECK-L: SET_PROGRESS_TOTAL 17i8 6 | SET_PROGRESS_TOTAL 0 7 | // CHECK-L: SET_MISSION_RESPECT_TOTAL 34i8 8 | SET_MISSION_RESPECT_TOTAL 0 9 | 10 | GOSUB prog10 11 | LOAD_AND_LAUNCH_MISSION prog2.sc 12 | LOAD_AND_LAUNCH_MISSION prog5.sc 13 | 14 | TERMINATE_THIS_SCRIPT 15 | 16 | prog10: 17 | PLAYER_MADE_PROGRESS 10 18 | AWARD_PLAYER_MISSION_RESPECT 20 19 | REGISTER_MISSION_PASSED prog10 20 | RETURN 21 | 22 | -------------------------------------------------------------------------------- /test/codegen/progress/prog2.sc: -------------------------------------------------------------------------------- 1 | MISSION_START 2 | PLAYER_MADE_PROGRESS 2 3 | AWARD_PLAYER_MISSION_RESPECT 4 4 | REGISTER_ODDJOB_MISSION_PASSED 5 | MISSION_END -------------------------------------------------------------------------------- /test/codegen/progress/prog5.sc: -------------------------------------------------------------------------------- 1 | MISSION_START 2 | PLAYER_MADE_PROGRESS 5 3 | AWARD_PLAYER_MISSION_RESPECT 10 4 | REGISTER_MISSION_PASSED prog5 5 | MISSION_END -------------------------------------------------------------------------------- /test/codegen/ranges.sc: -------------------------------------------------------------------------------- 1 | // RUN: %gta3sc %s --config=gta3 -emit-ir2 -o - | %FileCheck %s 2 | 3 | // CHECK-NEXT-L: WAIT 0i8 4 | WAIT 0 5 | // CHECK-NEXT-L: WAIT -2147483647i32 6 | WAIT -2147483647 7 | // CHECK-NEXT-L: WAIT 2147483647i32 8 | WAIT 2147483647 9 | // CHECK-NEXT-L: WAIT 0i8 10 | WAIT 0x0 11 | // CHECK-NEXT-L: WAIT 2147483647i32 12 | WAIT 0x7FFFFFFF 13 | // CHECK-NEXT-L: WAIT -1i8 14 | WAIT 0xFFFFFFFF 15 | 16 | TERMINATE_THIS_SCRIPT 17 | -------------------------------------------------------------------------------- /test/codegen/require/miss1.sc: -------------------------------------------------------------------------------- 1 | MISSION_START 2 | 3 | REQUIRE req4_from_miss1.sc 4 | REQUIRE req6_from_everywhere.sc 5 | 6 | PRINT_HELP miss1 7 | 8 | VAR_INT miss1_var 9 | CREATE_OBJECT miss1_obj .0 .0 .0 miss1_var 10 | 11 | miss1_label1: 12 | GOSUB req4_label1 13 | GOTO miss1_label1 14 | 15 | MISSION_END -------------------------------------------------------------------------------- /test/codegen/require/requires/req1_from_main.sc: -------------------------------------------------------------------------------- 1 | 2 | req1_label1: 3 | PRINT_HELP req1 4 | 5 | VAR_INT req1_var 6 | CREATE_OBJECT req1_obj .0 .0 .0 req1_var 7 | 8 | req1_label2: 9 | GOTO req1_label1 10 | -------------------------------------------------------------------------------- /test/codegen/require/requires/req2_from_extscript.sc: -------------------------------------------------------------------------------- 1 | 2 | req2_label1: 3 | PRINT_HELP req2 4 | 5 | VAR_INT req2_var 6 | CREATE_OBJECT req2_obj .0 .0 .0 req2_var 7 | 8 | req2_label2: 9 | GOTO req2_label1 10 | -------------------------------------------------------------------------------- /test/codegen/require/requires/req3_from_subscript.sc: -------------------------------------------------------------------------------- 1 | 2 | req3_label1: 3 | PRINT_HELP req3 4 | 5 | VAR_INT req3_var 6 | CREATE_OBJECT req3_obj .0 .0 .0 req3_var 7 | 8 | req3_label2: 9 | GOTO req3_label1 10 | -------------------------------------------------------------------------------- /test/codegen/require/requires/req4_from_miss1.sc: -------------------------------------------------------------------------------- 1 | 2 | req4_label1: 3 | PRINT_HELP req4 4 | 5 | VAR_INT req4_var 6 | CREATE_OBJECT req4_obj .0 .0 .0 req4_var 7 | 8 | req4_label2: 9 | GOTO req4_label1 10 | -------------------------------------------------------------------------------- /test/codegen/require/requires/req5_from_stream1.sc: -------------------------------------------------------------------------------- 1 | 2 | req5_label1: 3 | PRINT_HELP req5 4 | 5 | VAR_INT req5_var 6 | CREATE_OBJECT req5_obj .0 .0 .0 req5_var 7 | 8 | req5_label2: 9 | GOTO req5_label1 10 | -------------------------------------------------------------------------------- /test/codegen/require/requires/req6_from_everywhere.sc: -------------------------------------------------------------------------------- 1 | 2 | req6_label1: 3 | PRINT_HELP req6 4 | 5 | VAR_INT req6_var 6 | CREATE_OBJECT req6_obj .0 .0 .0 req6_var 7 | 8 | req6_label2: 9 | GOTO req6_label1 10 | -------------------------------------------------------------------------------- /test/codegen/require/requires/req7_from_subscript.sc: -------------------------------------------------------------------------------- 1 | 2 | req7_label1: 3 | PRINT_HELP req7 4 | 5 | VAR_INT req7_var 6 | CREATE_OBJECT req7_obj .0 .0 .0 req7_var 7 | 8 | req7_label2: 9 | GOTO req7_label1 10 | -------------------------------------------------------------------------------- /test/codegen/require/stream1.sc: -------------------------------------------------------------------------------- 1 | SCRIPT_START 2 | REQUIRE req5_from_stream1.sc 3 | REQUIRE req6_from_everywhere.sc 4 | 5 | PRINT_HELP stream1 6 | 7 | VAR_INT stream1_var 8 | CREATE_OBJECT stream1_obj .0 .0 .0 stream1_var 9 | 10 | stream1_label1: 11 | GOSUB req5_label1 12 | GOTO stream1_label1 13 | 14 | SCRIPT_END -------------------------------------------------------------------------------- /test/codegen/require/subscript.sc: -------------------------------------------------------------------------------- 1 | MISSION_START 2 | REQUIRE req3_from_subscript.sc 3 | REQUIRE req6_from_everywhere.sc 4 | REQUIRE req7_from_subscript.sc 5 | 6 | PRINT_HELP subsc 7 | 8 | VAR_INT subscript_var 9 | CREATE_OBJECT subscript_obj .0 .0 .0 subscript_var 10 | 11 | subscript_label1: 12 | GOTO subscript_label1 13 | 14 | MISSION_END -------------------------------------------------------------------------------- /test/codegen/require_cleo.sc: -------------------------------------------------------------------------------- 1 | // RUN: %gta3sc %s --config=gtasa --guesser -emit-ir2 -o - --cs -D CS | %FileCheck %s 2 | // RUN: %gta3sc %s --config=gtasa --guesser -emit-ir2 -o - --cm -D CM | %FileCheck %s 3 | #ifdef CS 4 | SCRIPT_START 5 | #else 6 | MISSION_START 7 | #endif 8 | { 9 | REQUIRE req1.sc 10 | PRINT_HELP top 11 | } 12 | #ifdef CS 13 | SCRIPT_END 14 | #else 15 | MISSION_END 16 | #endif 17 | 18 | // CHECK-NEXT-L: PRINT_HELP 'TOP' 19 | // CHECK-NEXT: TERMINATE_THIS_(CUSTOM_)?SCRIPT 20 | // CHECK-NEXT-L: PRINT_HELP 'REQ1' 21 | -------------------------------------------------------------------------------- /test/codegen/require_cleo/req1.sc: -------------------------------------------------------------------------------- 1 | PRINT_HELP req1 -------------------------------------------------------------------------------- /test/codegen/save_string_to_debug_file.sc: -------------------------------------------------------------------------------- 1 | // RUN: %gta3sc %s --config=gtasa --guesser -emit-ir2 -o - | %FileCheck %s 2 | 3 | // CHECK-L: SAVE_STRING_TO_DEBUG_FILE b"THE QUICK BROWN FOX JUMPS OVER THE LAZY DOG" 4 | SAVE_STRING_TO_DEBUG_FILE "The quick brown fox jumps over the lazy dog" 5 | 6 | TERMINATE_THIS_SCRIPT -------------------------------------------------------------------------------- /test/codegen/scope.sc: -------------------------------------------------------------------------------- 1 | // RUN: %gta3sc %s --config=gta3 -emit-ir2 -o - | %FileCheck %s 2 | 3 | { 4 | VAR_INT a b c 5 | LVAR_INT x y z 6 | 7 | // CHECK-NEXT-L: SET_LVAR_INT_TO_LVAR_INT 0@ 2@ 8 | x = z 9 | // CHECK-NEXT-L: SET_VAR_INT_TO_VAR_INT &8 &16 10 | a = c 11 | } 12 | 13 | { 14 | VAR_INT d e f 15 | LVAR_INT i j k 16 | 17 | // CHECK-NEXT-L: SET_LVAR_INT_TO_LVAR_INT 0@ 2@ 18 | i = k 19 | // CHECK-NEXT-L: SET_VAR_INT_TO_VAR_INT &20 &28 20 | d = f 21 | } 22 | 23 | TERMINATE_THIS_SCRIPT -------------------------------------------------------------------------------- /test/codegen/skip_cutscene.sc: -------------------------------------------------------------------------------- 1 | // RUN: %gta3sc %s --config=gtasa --guesser -emit-ir2 -o - | %FileCheck %s 2 | 3 | // CHECK-L: SKIP_CUTSCENE_START_INTERNAL @MAIN_1 4 | SKIP_CUTSCENE_START 5 | // CHECK-NEXT-L: WAIT 2i8 6 | // CHECK-NEXT-L: WAIT 3i8 7 | WAIT 2 8 | WAIT 3 9 | // CHECK-NEXT-L: MAIN_1: 10 | // CHECK-NEXT-L: SKIP_CUTSCENE_END 11 | SKIP_CUTSCENE_END 12 | 13 | // CHECK-NEXT-L: TERMINATE_THIS_SCRIPT 14 | TERMINATE_THIS_SCRIPT 15 | -------------------------------------------------------------------------------- /test/codegen/streaming/attractor1.sc: -------------------------------------------------------------------------------- 1 | SCRIPT_START 2 | PRINT_HELP attr1 3 | SCRIPT_END -------------------------------------------------------------------------------- /test/codegen/streaming/brain1.sc: -------------------------------------------------------------------------------- 1 | SCRIPT_START 2 | PRINT_HELP brain1 3 | SCRIPT_END -------------------------------------------------------------------------------- /test/codegen/streaming/missions/mission1.sc: -------------------------------------------------------------------------------- 1 | MISSION_START 2 | PRINT_HELP miss1 3 | MISSION_END -------------------------------------------------------------------------------- /test/codegen/streaming/missions/mission2.sc: -------------------------------------------------------------------------------- 1 | MISSION_START 2 | PRINT_HELP miss2 3 | MISSION_END -------------------------------------------------------------------------------- /test/codegen/streaming/object1.sc: -------------------------------------------------------------------------------- 1 | SCRIPT_START 2 | { 3 | LVAR_INT count 4 | PRINT_HELP obj1 5 | GET_NUMBER_OF_INSTANCES_OF_STREAMED_SCRIPT OBJKT1 count 6 | } 7 | SCRIPT_END -------------------------------------------------------------------------------- /test/codegen/streaming/ped1.sc: -------------------------------------------------------------------------------- 1 | SCRIPT_START 2 | PRINT_HELP ped1 3 | SCRIPT_END -------------------------------------------------------------------------------- /test/codegen/streaming/stream1.sc: -------------------------------------------------------------------------------- 1 | SCRIPT_START 2 | PRINT_HELP stream1 3 | SCRIPT_END -------------------------------------------------------------------------------- /test/codegen/switch_3vc_fail.sc: -------------------------------------------------------------------------------- 1 | // RUN: %dis %gta3sc %s --config=gta3 -fswitch --guesser -emit-ir2 -o - 2>&1 | %verify %s 2 | // RUN: %dis %gta3sc %s --config=gtavc -fswitch --guesser -emit-ir2 -o - 2>&1 | %verify %s 3 | VAR_INT n 4 | 5 | SWITCH n // expected-error {{more than 8 cases}} 6 | CASE 1 7 | CASE 2 8 | CASE 3 9 | CASE 4 10 | CASE 5 11 | CASE 6 12 | CASE 7 13 | CASE 8 14 | CASE 9 15 | BREAK 16 | ENDSWITCH 17 | 18 | TERMINATE_THIS_SCRIPT -------------------------------------------------------------------------------- /test/codegen/text_label.sc: -------------------------------------------------------------------------------- 1 | // RUN: %gta3sc %s --config=gtasa --guesser -emit-ir2 -o - | %FileCheck %s 2 | 3 | VAR_TEXT_LABEL label 4 | VAR_TEXT_LABEL16 text16 5 | 6 | // CHECK-L: PRINT_HELP 'LABEL' 7 | PRINT_HELP label 8 | // CHECK-L: PRINT_HELP s&8 9 | PRINT_HELP $label 10 | 11 | // CHECK-L: STRING_CAT16 "LABEL" s&8 v&16 12 | STRING_CAT16 label $label text16 13 | 14 | TERMINATE_THIS_SCRIPT -------------------------------------------------------------------------------- /test/codegen/timers_3vc.sc: -------------------------------------------------------------------------------- 1 | // RUN: %gta3sc %s --config=gta3 -emit-ir2 -o - | %FileCheck %s 2 | // RUN: %gta3sc %s --config=gtavc -emit-ir2 -o - | %FileCheck %s 3 | 4 | { 5 | // CHECK-L: SET_LVAR_INT 16@ 1i8 6 | timera = 1 7 | // CHECK-L: SET_LVAR_INT 17@ 2i8 8 | timerb = 2 9 | } 10 | 11 | TERMINATE_THIS_SCRIPT -------------------------------------------------------------------------------- /test/codegen/timers_sa.sc: -------------------------------------------------------------------------------- 1 | // RUN: %gta3sc %s --config=gtasa --guesser -emit-ir2 -o - | %FileCheck %s 2 | 3 | { 4 | // CHECK-L: SET_LVAR_INT 32@ 1i8 5 | timera = 1 6 | // CHECK-L: SET_LVAR_INT 33@ 2i8 7 | timerb = 2 8 | } 9 | 10 | TERMINATE_THIS_SCRIPT -------------------------------------------------------------------------------- /test/codegen/uppercase.sc: -------------------------------------------------------------------------------- 1 | // Tests the codegeneration of expressions. 2 | // RUN: %gta3sc %s --config=gta3 -emit-ir2 -o - | %FileCheck %s 3 | 4 | // CHECK-L: PRINT_HELP 'UPPER' 5 | PRINT_HELP upper 6 | 7 | TERMINATE_THIS_SCRIPT -------------------------------------------------------------------------------- /test/frontend/Inputs/override.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/frontend/Inputs/test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /test/frontend/add_config.sc: -------------------------------------------------------------------------------- 1 | // Tests the --add-config flag. 2 | // RUN: %gta3sc %s --config=gta3 -fsyntax-only --add-config=./Inputs/test.xml 2>&1 3 | // RUN: %not %gta3sc %s --config=gta3 -fsyntax-only --add-config=Inputs/test.xml 2>&1 | grep "could not open file" 4 | 5 | TEST_COMMAND 0 0 6 | -------------------------------------------------------------------------------- /test/frontend/override_config.sc: -------------------------------------------------------------------------------- 1 | // Tests the --add-config flag. 2 | // RUN: %gta3sc %s --config=gta3 -fsyntax-only --add-config=./Inputs/test.xml --add-config=./Inputs/override.xml 2>&1 3 | 4 | TEST_COMMAND 1.0 1.0 5 | -------------------------------------------------------------------------------- /test/frontend/switch.sc: -------------------------------------------------------------------------------- 1 | // Tests the -fswitch flag. 2 | // RUN: %dis %gta3sc %s --config=gta3 -fsyntax-only 2>&1 | %verify %s 3 | // RUN: %not %gta3sc %s --config=gta3 -fsyntax-only -fswitch 2>&1 | grep "guesser mode" 4 | // RUN: %gta3sc %s --config=gta3 -fsyntax-only -fswitch --guesser 2>&1 5 | // RUN: %gta3sc %s --config=gtasa -fsyntax-only --guesser 2>&1 6 | VAR_INT n 7 | SWITCH n // expected-error {{[-fswitch]}} 8 | CASE 1 9 | BREAK 10 | ENDSWITCH 11 | TERMINATE_THIS_SCRIPT -------------------------------------------------------------------------------- /test/lexer/commands.sc: -------------------------------------------------------------------------------- 1 | // RUN: %dis %gta3sc %s --config=gta3 -fsyntax-only 2>&1 | %verify %s 2 | 3 | IF { // expected-error {{unexpected token}} 4 | OR ELSE // expected-error {{unexpected token}} 5 | OR LVAR_INT // expected-error {{unexpected token}} 6 | ENDIF 7 | 8 | TERMINATE_THIS_SCRIPT -------------------------------------------------------------------------------- /test/lexer/comments.sc: -------------------------------------------------------------------------------- 1 | // RUN: %dis %gta3sc %s --config=gta3 -fsyntax-only 2>&1 | %verify %s 2 | 3 | VAR_INT x 4 | 5 | // SAVE_STRING_TO_DEBUG_FILE "no error expected 6 | 7 | SAVE_STRING_TO_DEBUG_FILE "// expected-error {{terminating}} 8 | /* 9 | SAVE_STRING_TO_DEBUG_FILE "no error expected 10 | /* 11 | SAVE_STRING_TO_DEBUG_FILE "no error expected 12 | /* 13 | SAVE_STRING_TO_DEBUG_FILE "no error expected 14 | */ 15 | SAVE_STRING_TO_DEBUG_FILE "no error expected 16 | */ 17 | SAVE_STRING_TO_DEBUG_FILE "no error expected 18 | */ 19 | 20 | /* 0 */ x = /* ?? */ 0 /* + ?? */ 21 | x = 0 // + ?? 22 | 23 | TERMINATE_THIS_SCRIPT 24 | 25 | */ // expected-error {{no comment to close}} 26 | 27 | /* 28 | // expected-error@comments.sc:0 {{unterminated /* comment}} 29 | -------------------------------------------------------------------------------- /test/lexer/dump.sc: -------------------------------------------------------------------------------- 1 | // RUN: %dis %gta3sc %s --config=gta3 -fsyntax-only 2>&1 | %verify %s 2 | 3 | DUMP 4 | FF 00 00 7F 5 | FF00007F 6 | F // expected-error {{hexadecimal tokens must have pairs of two digits}} 7 | 7A7 // expected-error {{hexadecimal tokens must have pairs of two digits}} 8 | AQ // expected-error {{invalid hexadecimal token}} 9 | AFAQ09 // expected-error {{invalid hexadecimal token}} 10 | ENDDUMP 11 | 12 | TERMINATE_THIS_SCRIPT 13 | -------------------------------------------------------------------------------- /test/lexer/expr.sc: -------------------------------------------------------------------------------- 1 | // RUN: %dis %gta3sc %s --config=gta3 -fsyntax-only 2>&1 | %verify %s 2 | 3 | VAR_INT y 4 | 5 | y = 4 -5 // expected-error {{expected newline after this token}} 6 | y = 4 - 5 7 | y = 4 - -5 8 | y = 4 +5 9 | y = 4 /5 10 | 11 | TERMINATE_THIS_SCRIPT -------------------------------------------------------------------------------- /test/lexer/label.sc: -------------------------------------------------------------------------------- 1 | // RUN: %dis %gta3sc %s --config=gta3 -fsyntax-only 2>&1 | %verify %s 2 | 3 | // expected-no-diagnostics 4 | 5 | foo: GOTO foo 6 | bar: 7 | GOTO bar 8 | 9 | TERMINATE_THIS_SCRIPT -------------------------------------------------------------------------------- /test/lexer/tokens.sc: -------------------------------------------------------------------------------- 1 | // RUN: %dis %gta3sc %s --config=gtasa --guesser -fsyntax-only 2>&1 | %verify %s 2 | 3 | VAR_TEXT_LABEL ab3 4 | 5 | // Integer Tokens 6 | WAIT 1 7 | WAIT -1 8 | WAIT 5-2 // valid, same as 5 9 | 10 | // Float Tokens 11 | SET_TIME_SCALE .0 12 | SET_TIME_SCALE 1.0 13 | SET_TIME_SCALE 1.0f 14 | SET_TIME_SCALE 1.0F 15 | SET_TIME_SCALE -1.0 16 | SET_TIME_SCALE 1.0.9 // valid, same as 1.0 17 | SET_TIME_SCALE 1.0f9 // valid, same as 1.0 18 | SET_TIME_SCALE 1.0-9 // e//xpected-error {{invalid identifier}} 19 | // the token above is not a float! 20 | // also commented the error expect because that check is on semantic analyzes 21 | 22 | // Text Tokens 23 | PRINT_HELP ab3 24 | PRINT_HELP ab3^? 25 | PRINT_HELP WHILE 26 | 27 | // String Tokens 28 | SAVE_STRING_TO_DEBUG_FILE "A string to rule them all" 29 | SAVE_STRING_TO_DEBUG_FILE "abc // expected-error-re {{missing terminating '.' character}} 30 | 31 | TERMINATE_THIS_SCRIPT -------------------------------------------------------------------------------- /test/lexer/whitespaces.sc: -------------------------------------------------------------------------------- 1 | // RUN: %dis %gta3sc %s --config=gta3 -fsyntax-only 2>&1 | %verify %s 2 | 3 | // expected-no-diagnostics 4 | 5 | (,, 6 | ), 7 | ,( ()),) )( ((),) () 8 | ,,))) )( ,,,, ,), (, 9 | 10 | ( 11 | ) 12 | ( ,, ),(() 13 | ( 14 | ,(() ( ) 15 | (, ,,, 16 | , 17 | 18 | TERMINATE_THIS_SCRIPT 19 | 20 | // To generate the random tokens: 21 | // tr -dc "(), \n\t" < /dev/urandom | head -c 100 -------------------------------------------------------------------------------- /test/lit.cfg: -------------------------------------------------------------------------------- 1 | # -*- Python -*- 2 | 3 | import os 4 | import sys 5 | sys.path.insert(0, os.path.dirname(__file__)) 6 | import GTA3ScriptTest 7 | 8 | def infer_gta3sc(PATH): 9 | gta3sc = os.getenv('GTA3SC') or lit.util.which('gta3sc', PATH) 10 | if not gta3sc: 11 | lit_config.fatal("couldn't find 'gta3sc' program, try setting " 12 | "GTA3SC in your environment") 13 | return gta3sc 14 | 15 | # name: The name of this test suite. 16 | config.name = 'gta3sc' 17 | 18 | # testFormat: The test format to use to interpret tests. 19 | execute_external = (not sys.platform in ['win32']) 20 | config.test_format = GTA3ScriptTest.GTA3ScriptTest(execute_external=execute_external) 21 | 22 | # suffixes: A list of file extensions to treat as test files. 23 | config.suffixes = ['.sc', '.test'] 24 | 25 | # excludes: A list of individual files to exclude. 26 | config.excludes = ['Inputs'] 27 | 28 | # test_source_root: The root path where tests are located. 29 | config.test_source_root = os.path.dirname(__file__) 30 | config.test_exec_root = config.test_source_root 31 | 32 | config.target_triple = '(unused)' 33 | 34 | config.gta3sc = infer_gta3sc(config.environment['PATH']).replace('\\', '/') 35 | config.Checksum = os.path.join(config.test_source_root, "Checksum.sh").replace('\\', '/') 36 | config.Not = os.path.join(config.test_source_root, "Not.sh").replace('\\', '/') 37 | config.Discard = os.path.join(config.test_source_root, "Discard.sh").replace('\\', '/') 38 | config.Verify = os.path.join(config.test_source_root, "VerifyDiagnosticConsumer.py").replace('\\', '/') 39 | config.substitutions.append(('%gta3sc', '%s -Wno-expect-var' % config.gta3sc)) 40 | config.substitutions.append(('%checksum', 'sh "%s"' % config.Checksum)) 41 | config.substitutions.append(('%verify', 'python "%s"' % config.Verify)) 42 | config.substitutions.append(('%not', 'sh "%s"' % config.Not)) 43 | config.substitutions.append(('%dis', 'sh "%s"' % config.Discard)) 44 | config.substitutions.append(('%FileCheck', 'OutputCheck --comment=//')) 45 | -------------------------------------------------------------------------------- /test/main/gta3.test: -------------------------------------------------------------------------------- 1 | RUN: mkdir "%/T/gta3" || echo _ 2 | RUN: curl -L https://www.dropbox.com/s/765m1jwbgf6hsvu/gta3_main.tar.gz?dl=1 -o "%/T/gta3/gta3_main.tar.gz" 3 | RUN: tar -xzf "%/T/gta3/gta3_main.tar.gz" -C "%/T/gta3" --force-local 4 | RUN: %gta3sc "%/T/gta3/main.sc" --config=gta3 -pedantic-errors -Werror 5 | RUN: %checksum "%/T/gta3/main.scm" 694cdeb27de4aee3d20f223604ea5375 6 | -------------------------------------------------------------------------------- /test/main/gtavc.test: -------------------------------------------------------------------------------- 1 | RUN: mkdir "%/T/gtavc" || echo _ 2 | RUN: curl -L https://www.dropbox.com/s/fiyhjlmgoiocpex/gtavc_main.tar.gz?dl=1 -o "%/T/gtavc/gtavc_main.tar.gz" 3 | RUN: tar -xzf "%/T/gtavc/gtavc_main.tar.gz" -C "%/T/gtavc" --force-local 4 | RUN: %gta3sc "%/T/gtavc/main.sc" --config=gtavc -pedantic-errors -Werror -Wno-expect-var -frelax-not 5 | RUN: %checksum "%/T/gtavc/main.scm" 2a7c30f7bdd04a93213c2eaa8103bd72 6 | -------------------------------------------------------------------------------- /test/misc/expect_var_badindex.sc: -------------------------------------------------------------------------------- 1 | // RUN: %dis %gta3sc %s --config=gta3 -fsyntax-only -Wexpect-var 2>&1 | %verify %s 2 | 3 | VAR_INT player scplayer flag_player_on_mission 4 | 5 | // expected-warning-re@gta3sc:0 {{expected variable scplayer to have index \d+ but it has index \d+}} 6 | // expected-warning-re@gta3sc:0 {{expected variable player to have index \d+ but it has index \d+}} 7 | // expected-warning-re@gta3sc:0 {{expected variable flag_player_on_mission to have index \d+ but it has index \d+}} 8 | 9 | TERMINATE_THIS_SCRIPT -------------------------------------------------------------------------------- /test/misc/expect_var_noexist_3vc.sc: -------------------------------------------------------------------------------- 1 | // RUN: %dis %gta3sc %s --config=gta3 -fsyntax-only -Wexpect-var 2>&1 | %verify %s 2 | // RUN: %dis %gta3sc %s --config=gtavc -fsyntax-only -Wexpect-var 2>&1 | %verify %s 3 | 4 | // expected-warning@gta3sc:0 {{expected variable scplayer to exist}} 5 | // expected-warning@gta3sc:0 {{expected variable player to exist}} 6 | // expected-warning@gta3sc:0 {{expected variable flag_player_on_mission to exist}} 7 | 8 | TERMINATE_THIS_SCRIPT -------------------------------------------------------------------------------- /test/misc/expect_var_noexist_sa.sc: -------------------------------------------------------------------------------- 1 | // RUN: %dis %gta3sc %s --config=gtasa --guesser -fsyntax-only -Wexpect-var 2>&1 | %verify %s 2 | 3 | // expected-warning@gta3sc:0 {{expected variable scplayer to exist}} 4 | // expected-warning@gta3sc:0 {{expected variable player to exist}} 5 | // expected-warning@gta3sc:0 {{expected variable flag_player_on_mission to exist}} 6 | // expected-warning@gta3sc:0 {{expected variable player_group to exist}} 7 | 8 | TERMINATE_THIS_SCRIPT -------------------------------------------------------------------------------- /test/parser/TODO: -------------------------------------------------------------------------------- 1 | TODO -------------------------------------------------------------------------------- /test/preprocessor/ifdef.sc: -------------------------------------------------------------------------------- 1 | // RUN: %gta3sc %s --config=gta3 -D TEST_SYMBOL -emit-ir2 -o - | %FileCheck %s 2 | 3 | // CHECK-L: WAIT 1i8 4 | #ifdef TEST_SYMBOL 5 | WAIT 1 6 | #endif 7 | 8 | // CHECK-NOT-L: WAIT 2i8 9 | #ifndef TEST_SYMBOL 10 | WAIT 2 11 | #endif 12 | 13 | // CHECK-NOT-L: WAIT 3i8 14 | #ifdef UNDEFINED_SYMBOL 15 | WAIT 3 16 | #endif 17 | 18 | // CHECK-L: WAIT 4i8 19 | #ifndef UNDEFINED_SYMBOL 20 | WAIT 4 21 | #endif 22 | 23 | // CHECK-NOT-L: WAIT 5i8 24 | #ifndef TEST_SYMBOL 25 | # ifdef TEST_SYMBOL 26 | WAIT 5 27 | # endif 28 | #endif 29 | 30 | // CHECK-L: WAIT 12i8 31 | #ifdef UNDEFINED_SYMBOL 32 | WAIT 11 33 | #else 34 | WAIT 12 35 | #endif 36 | 37 | // CHECK-NOT-L: WAIT 13i8 38 | #ifndef TEST_SYMBOL 39 | #ifdef TEST_SYMBOL 40 | WAIT 13 41 | #else 42 | WAIT 13 43 | #endif 44 | #endif 45 | 46 | // CHECK-L: TERMINATE_THIS_SCRIPT 47 | TERMINATE_THIS_SCRIPT -------------------------------------------------------------------------------- /test/preprocessor/syntax.sc: -------------------------------------------------------------------------------- 1 | // RUN: %dis %gta3sc %s --config=gtasa --guesser -fsyntax-only 2>&1 | %verify %s 2 | 3 | #ifdef // expected-error {{wrong number of tokens}} 4 | #ifndef // expected-error {{wrong number of tokens}} 5 | #endif // expected-error {{#endif without #ifdef}} 6 | 7 | #ifdef ABC DEF // expected-error {{wrong number of tokens}} 8 | #endif 9 | 10 | #ifndef ABC DEF // expected-error {{wrong number of tokens}} 11 | #endif 12 | 13 | #ifdef ABC 14 | #endif ABC // expected-error {{too many tokens}} 15 | 16 | #else ABC // expected-error {{too many tokens}} 17 | // expected-error@-1 {{#else without #ifdef}} 18 | 19 | #something // expected-error {{unknown}} 20 | 21 | // empty is valid 22 | # 23 | # 24 | # 25 | -------------------------------------------------------------------------------- /test/semantics/Inputs/data/default.dat: -------------------------------------------------------------------------------- 1 | IDE data/default.ide -------------------------------------------------------------------------------- /test/semantics/Inputs/data/default.ide: -------------------------------------------------------------------------------- 1 | cars 2 | 400, CHEETAH, .......... 3 | 401, INFERNUS, ......... 4 | 402, BANSHEE, ......... 5 | end -------------------------------------------------------------------------------- /test/semantics/Inputs/data/gta.dat: -------------------------------------------------------------------------------- 1 | IDE data/level.ide -------------------------------------------------------------------------------- /test/semantics/Inputs/data/gta3.dat: -------------------------------------------------------------------------------- 1 | IDE data/level.ide -------------------------------------------------------------------------------- /test/semantics/Inputs/data/gta_vc.dat: -------------------------------------------------------------------------------- 1 | IDE data/level.ide -------------------------------------------------------------------------------- /test/semantics/Inputs/data/level.ide: -------------------------------------------------------------------------------- 1 | objs 2 | 1000, lv_building, .......... 3 | 1001, lv_object, ......... 4 | 1002, lv_stuff, ....... 5 | end -------------------------------------------------------------------------------- /test/semantics/arrays.sc: -------------------------------------------------------------------------------- 1 | // RUN: %dis %gta3sc %s --config=gtasa --guesser -fsyntax-only 2>&1 | %verify %s 2 | 3 | VAR_INT a[10] b[10] i 4 | 5 | WAIT a[1] 6 | WAIT a[1]works // same as WAIT a[1] 7 | WAIT a[b[1]] // expected-error {{nesting of arrays}} 8 | WAIT a[b] // expected-error {{index is of array type}} 9 | WAIT a[i] 10 | 11 | TERMINATE_THIS_SCRIPT -------------------------------------------------------------------------------- /test/semantics/break-continue.sc: -------------------------------------------------------------------------------- 1 | // RUN: %dis %gta3sc %s --config=gtasa --guesser -fbreak-continue -fsyntax-only 2>&1 | %verify %s 2 | VAR_INT x 3 | 4 | CONTINUE // expected-error {{CONTINUE not in a loop}} 5 | BREAK // expected-error {{BREAK not in a loop or SWITCH statement}} 6 | 7 | IF x = 0 8 | CONTINUE // expected-error {{CONTINUE not in a loop}} 9 | BREAK // expected-error {{BREAK not in a loop}} 10 | ELSE 11 | CONTINUE // expected-error {{CONTINUE not in a loop}} 12 | BREAK // expected-error {{BREAK not in a loop}} 13 | ENDIF 14 | 15 | WHILE x = 0 16 | CONTINUE 17 | BREAK 18 | ENDWHILE 19 | 20 | REPEAT 5 x 21 | CONTINUE 22 | BREAK 23 | ENDREPEAT 24 | 25 | SWITCH x 26 | CASE 1 27 | CONTINUE // expected-error {{CONTINUE not in a loop}} 28 | BREAK 29 | ENDSWITCH 30 | 31 | TERMINATE_THIS_SCRIPT -------------------------------------------------------------------------------- /test/semantics/cleo_call_entity.sc: -------------------------------------------------------------------------------- 1 | // RUN: %dis %gta3sc %s --config=gtasa --guesser --cs -fsyntax-only 2>&1 | %verify %s 2 | SCRIPT_START 3 | { 4 | LVAR_INT car char car2 null1 null2 null3 null4 5 | 6 | CREATE_CAR 0 .0 .0 .0 car 7 | CREATE_CHAR 0 0 .0 .0 .0 char 8 | 9 | CLEO_CALL blow_up1 0 car null1 10 | CLEO_CALL blow_up1 0 char null2 // expected-error {{entity type mismatch in target label}} 11 | 12 | CLEO_CALL blow_up2 0 char null3 13 | CLEO_CALL blow_up2 0 car null4 // expected-error {{entity type mismatch in target label}} 14 | 15 | SET_CAR_HEALTH null1 1000 // fine 16 | SET_CAR_HEALTH null2 1000 // fine 17 | SET_CAR_HEALTH null3 1000 // expected-error {{expected variable of type CAR but got CHAR}} 18 | SET_CAR_HEALTH null4 1000 // expected-error {{expected variable of type CAR but got CHAR}} 19 | 20 | TERMINATE_THIS_CUSTOM_SCRIPT 21 | } 22 | 23 | { 24 | blow_up1: 25 | LVAR_INT car 26 | EXPLODE_CAR car 27 | CLEO_RETURN 0 car 28 | 29 | LVAR_INT char 30 | CREATE_CHAR 0 0 .0 .0 .0 char 31 | CLEO_RETURN 0 char // expected-error {{entity type mismatch}} 32 | } 33 | 34 | { 35 | blow_up2: 36 | LVAR_INT car 37 | EXPLODE_CAR car // expected-error {{expected variable of type CAR but got CHAR}} 38 | CLEO_RETURN 0 car 39 | 40 | LVAR_INT char 41 | CREATE_CHAR 0 0 .0 .0 .0 char 42 | CLEO_RETURN 0 char // fine 43 | } 44 | SCRIPT_END -------------------------------------------------------------------------------- /test/semantics/cleo_call_params.sc: -------------------------------------------------------------------------------- 1 | // RUN: %dis %gta3sc %s --config=gtasa --guesser --cs -fsyntax-only 2>&1 | %verify %s 2 | SCRIPT_START 3 | { 4 | LVAR_INT i j k 5 | LVAR_FLOAT x y z 6 | 7 | // Argument Count 8 | CLEO_CALL sum_int 0 5 i j // this defines what the function is like 9 | CLEO_CALL sum_int 0 5 i 0 // expected-error {{expected a variable as output}} 10 | CLEO_CALL sum_int 0 5 i // expected-error {{too few arguments for this function call}} 11 | CLEO_CALL sum_int 0 5 i j k // expected-error {{too many arguments for this function call}} 12 | CLEO_CALL sum_int 0 5 // expected-error {{too few arguments for this function call}} 13 | CLEO_CALL sum_int 0 // expected-error {{too few arguments for this function call}} 14 | CLEO_CALL sum_int 1 // expected-error {{this argument shall be set to 0}} 15 | // expected-error@-1 {{too few arguments for this function call}} 16 | 17 | // Argument Type 18 | CLEO_CALL sum_int 0 5.0 i j // expected-error {{type mismatch in target label}} 19 | CLEO_CALL sum_int 0 x i j // expected-error {{type mismatch in target label}} 20 | CLEO_CALL sum_int 0 i j z // expected-error {{type mismatch}} 21 | 22 | TERMINATE_THIS_CUSTOM_SCRIPT 23 | } 24 | 25 | { 26 | sum_int: 27 | LVAR_INT a b c 28 | LVAR_FLOAT x y z 29 | c = a + b 30 | CLEO_RETURN 0 c // this defines what the return is like 31 | CLEO_RETURN 0 // expected-error {{too few return arguments}} 32 | CLEO_RETURN 0 c c // expected-error {{too many return arguments}} 33 | CLEO_RETURN 1 c // expected-error {{this argument shall be set to 0}} 34 | CLEO_RETURN 0 x // expected-error {{type mismatch}} 35 | } 36 | SCRIPT_END -------------------------------------------------------------------------------- /test/semantics/cleo_call_text1.sc: -------------------------------------------------------------------------------- 1 | // RUN: %dis %gta3sc %s --config=gtasa --guesser --cs -fsyntax-only 2>&1 | %verify %s 2 | SCRIPT_START 3 | { 4 | CLEO_CALL returns_text1 0 5 | CLEO_CALL returns_text2 0 6 | CLEO_CALL returns_text3 0 7 | TERMINATE_THIS_CUSTOM_SCRIPT 8 | } 9 | 10 | { 11 | returns_text1: 12 | CLEO_RETURN 0 "text" // expected-error {{this output type is not supported}} 13 | } 14 | 15 | { 16 | returns_text2: 17 | CLEO_RETURN 0 text // expected-error {{this output type is not supported}} 18 | } 19 | 20 | { 21 | returns_text3: 22 | LVAR_TEXT_LABEL textvar 23 | CLEO_RETURN 0 $textvar // expected-error {{this output type is not supported}} 24 | } 25 | SCRIPT_END -------------------------------------------------------------------------------- /test/semantics/cleo_call_text2.sc: -------------------------------------------------------------------------------- 1 | // RUN: %dis %gta3sc %s --config=gtasa --guesser --cs -fsyntax-only 2>&1 | %verify %s 2 | SCRIPT_START 3 | { 4 | LVAR_TEXT_LABEL textvar 5 | 6 | CLEO_CALL receives_text1 0 "text" // expected-error {{LVAR_TEXT_LABEL is not allowed}} 7 | 8 | CLEO_CALL receives_text2 0 "text" // expected-error {{unspecified}} 9 | CLEO_CALL receives_text2 0 text // expected-error {{unspecified}} 10 | CLEO_CALL receives_text2 0 $textvar // expected-error {{mismatch}} 11 | 12 | TERMINATE_THIS_CUSTOM_SCRIPT 13 | } 14 | 15 | { 16 | receives_text1: 17 | LVAR_TEXT_LABEL textvar 18 | CLEO_RETURN 0 19 | } 20 | 21 | { 22 | receives_text2: 23 | LVAR_INT text_ptr 24 | CLEO_RETURN 0 25 | } 26 | SCRIPT_END -------------------------------------------------------------------------------- /test/semantics/cleo_disallow_global.sc: -------------------------------------------------------------------------------- 1 | // RUN: %dis %gta3sc %s --config=gtasa --guesser --cs -fsyntax-only 2>&1 | %verify %s 2 | SCRIPT_START 3 | { 4 | VAR_INT x // expected-error {{declaring global variables in custom scripts}} 5 | TERMINATE_THIS_CUSTOM_SCRIPT 6 | } 7 | SCRIPT_END -------------------------------------------------------------------------------- /test/semantics/cleo_disallow_model.sc: -------------------------------------------------------------------------------- 1 | // RUN: %dis %gta3sc %s --config=gtasa --guesser --cs -emit-ir2 -o - 2>&1 | %verify %s 2 | SCRIPT_START 3 | { 4 | LVAR_INT x 5 | CREATE_OBJECT RANDOM_MODEL .0 .0 .0 x // expected-error@gta3sc:0 {{use of non-default model RANDOM_MODEL in custom script}} 6 | TERMINATE_THIS_CUSTOM_SCRIPT 7 | } 8 | SCRIPT_END -------------------------------------------------------------------------------- /test/semantics/cleo_disallow_scripts.sc: -------------------------------------------------------------------------------- 1 | // RUN: %dis %gta3sc %s --config=gtasa --guesser --cs -fsyntax-only 2>&1 | %verify %s 2 | SCRIPT_START 3 | { 4 | START_NEW_SCRIPT script_label // stops in a compilation step where this check doesn't happen 5 | LAUNCH_MISSION subscript.sc // expected-error {{this command is not allowed in custom scripts}} 6 | LOAD_AND_LAUNCH_MISSION mission.sc // expected-error {{this command is not allowed in custom scripts}} 7 | REGISTER_STREAMED_SCRIPT stream.sc // expected-error {{this command is not allowed in custom scripts}} 8 | 9 | LOAD_AND_LAUNCH_MISSION_INTERNAL 0 // fine 10 | 11 | TERMINATE_THIS_CUSTOM_SCRIPT 12 | } 13 | 14 | { 15 | script_label: 16 | TERMINATE_THIS_SCRIPT // stops in a compilation step where this check doesn't happen 17 | } 18 | SCRIPT_END -------------------------------------------------------------------------------- /test/semantics/cleo_disallow_terminate.sc: -------------------------------------------------------------------------------- 1 | // RUN: %dis %gta3sc %s --config=gtasa --guesser --cs -fsyntax-only 2>&1 | %verify %s 2 | SCRIPT_START 3 | START_NEW_SCRIPT script_label // expected-error {{not allowed in custom scripts}} 4 | SCRIPT_END 5 | 6 | { 7 | script_label: 8 | TERMINATE_THIS_SCRIPT // expected-error {{not allowed in custom scripts}} 9 | } 10 | -------------------------------------------------------------------------------- /test/semantics/collision/gosub1.sc: -------------------------------------------------------------------------------- 1 | MISSION_START 2 | GOSUB gosub1 3 | MISSION_END 4 | 5 | gosub1: 6 | 7 | VAR_INT dup_var 8 | dup_label: 9 | 10 | VAR_INT dup_global_local 11 | 12 | CONST_INT GOSUB1_INT 1 13 | CONST_FLOAT GOSUB1_FLT 1.0 14 | 15 | CONST_INT DUP_INT 1 16 | CONST_FLOAT DUP_FLT 1.0 17 | 18 | RETURN -------------------------------------------------------------------------------- /test/semantics/control_flow.sc: -------------------------------------------------------------------------------- 1 | // RUN: %dis %gta3sc %s --config=gta3 -fsyntax-only 2>&1 | %verify %s 2 | VAR_INT x 3 | 4 | IF x = 1 // expected-error {{use of more than 8 conditions}} 5 | OR x = 2 6 | OR x = 3 7 | OR x = 4 8 | OR x = 5 9 | OR x = 6 10 | OR x = 7 11 | OR x = 8 12 | OR x = 9 13 | WAIT 0 14 | ENDIF 15 | 16 | WHILE x = 1 // expected-error {{use of more than 8 conditions}} 17 | OR x = 2 18 | OR x = 3 19 | OR x = 4 20 | OR x = 5 21 | OR x = 6 22 | OR x = 7 23 | OR x = 8 24 | OR x = 9 25 | WAIT 0 26 | ENDWHILE 27 | 28 | NOT x < 4 // expected-error {{NOT outside of a conditional statement}} 29 | 30 | TERMINATE_THIS_SCRIPT -------------------------------------------------------------------------------- /test/semantics/directives.sc: -------------------------------------------------------------------------------- 1 | // RUN: %dis %gta3sc %s --config=gtasa --guesser -fsyntax-only 2>&1 | %verify %s 2 | 3 | MISSION_START // expected-error@directives.sc:0 {{cannot use MISION_START in main scripts}} 4 | LAUNCH_MISSION subscript.sc 5 | LOAD_AND_LAUNCH_MISSION miss1.sc 6 | LOAD_AND_LAUNCH_MISSION miss2.sc 7 | LOAD_AND_LAUNCH_MISSION miss3.sc 8 | LOAD_AND_LAUNCH_MISSION miss4.sc 9 | LOAD_AND_LAUNCH_MISSION miss5.sc 10 | REGISTER_STREAMED_SCRIPT stream1 stream1.sc 11 | TERMINATE_THIS_SCRIPT 12 | 13 | // expected-error@subscript.sc:0 {{subscript script does not contain MISSION_START}} 14 | 15 | // expected-error@miss1.sc:0 {{mission script does not contain MISSION_START}} 16 | // expected-error@miss2.sc:0 {{mission script does not contain MISSION_END}} 17 | // expected-error@miss3.sc:1 {{MISSION_END without a MISSION_START}} 18 | // expected-error@miss3.sc:0 {{mission script does not contain MISSION_START}} 19 | // expected-error@miss4.sc:2 {{MISSION_START must be the first statement in script}} 20 | // expected-error@miss5.sc:2 {{more than one MISSION_START in script}} 21 | // expected-error@miss5.sc:4 {{more than one MISSION_END in script}} 22 | 23 | // expected-error@stream1.sc:0 {{streamed script does not contain SCRIPT_START}} 24 | -------------------------------------------------------------------------------- /test/semantics/directives/miss1.sc: -------------------------------------------------------------------------------- 1 | TERMINATE_THIS_SCRIPT -------------------------------------------------------------------------------- /test/semantics/directives/miss2.sc: -------------------------------------------------------------------------------- 1 | MISSION_START -------------------------------------------------------------------------------- /test/semantics/directives/miss3.sc: -------------------------------------------------------------------------------- 1 | MISSION_END -------------------------------------------------------------------------------- /test/semantics/directives/miss4.sc: -------------------------------------------------------------------------------- 1 | { 2 | MISSION_START 3 | MISSION_END 4 | } -------------------------------------------------------------------------------- /test/semantics/directives/miss5.sc: -------------------------------------------------------------------------------- 1 | MISSION_START 2 | MISSION_START 3 | MISSION_END 4 | MISSION_END -------------------------------------------------------------------------------- /test/semantics/directives/stream1.sc: -------------------------------------------------------------------------------- 1 | TERMINATE_THIS_SCRIPT -------------------------------------------------------------------------------- /test/semantics/directives/subscript.sc: -------------------------------------------------------------------------------- 1 | TERMINATE_THIS_SCRIPT -------------------------------------------------------------------------------- /test/semantics/entity1.sc: -------------------------------------------------------------------------------- 1 | // RUN: %dis %gta3sc %s --config=gtavc -fsyntax-only 2>&1 | %verify %s 2 | VAR_INT car char 3 | 4 | car = char 5 | 6 | IS_CHAR_IN_CAR char 0 // expected-error {{expected variable of type CHAR but got NONE}} 7 | 8 | CREATE_CAR 0 .0 .0 .0 car 9 | CREATE_CHAR 0 0 .0 .0 .0 char 10 | 11 | car = char // expected-error {{assignment of variable of type CHAR into one of type CAR}} 12 | car = char // fine now, car is of type CHAR since the assignment above 13 | 14 | IS_CHAR_IN_CAR 0 char // expected-error {{expected variable of type CAR but got CHAR}} 15 | IS_CHAR_IN_CAR 0 0 16 | 17 | CREATE_CAR 0 .0 .0 .0 char // expected-error {{variable has already been used to create a entity of type CHAR}} 18 | 19 | TERMINATE_THIS_SCRIPT -------------------------------------------------------------------------------- /test/semantics/entity2.sc: -------------------------------------------------------------------------------- 1 | // RUN: %dis %gta3sc %s --config=gtavc -fsyntax-only 2>&1 | %verify %s 2 | 3 | VAR_INT car 4 | 5 | CREATE_CAR 0 .0 .0 .0 car 6 | 7 | START_NEW_SCRIPT script1 car car 8 | GOSUB bottom_of_script 9 | 10 | TERMINATE_THIS_SCRIPT 11 | 12 | { 13 | script1: 14 | 15 | LVAR_INT x y z 16 | 17 | CREATE_CAR 0 .0 .0 .0 x 18 | CREATE_CHAR 0 0 .0 .0 .0 y // expected-error {{variable has already been used to create a entity of type CAR}} 19 | 20 | TERMINATE_THIS_SCRIPT 21 | } 22 | 23 | { 24 | script2: 25 | 26 | LVAR_INT x y z 27 | 28 | CREATE_CAR 0 .0 .0 .0 x 29 | CREATE_CHAR 0 0 .0 .0 .0 y 30 | 31 | TERMINATE_THIS_SCRIPT 32 | } 33 | 34 | bottom_of_script: 35 | START_NEW_SCRIPT script2 car car // expected-error {{entity type mismatch in target label}} 36 | RETURN 37 | -------------------------------------------------------------------------------- /test/semantics/expr.sc: -------------------------------------------------------------------------------- 1 | // Tests the semantics of expressions 2 | // RUN: %dis %gta3sc %s --config=gtasa --guesser -fsyntax-only 2>&1 | %verify %s 3 | 4 | VAR_INT i j k a[10] 5 | VAR_FLOAT x y z 6 | 7 | // Test non-commutative operations 8 | i = 2 * i 9 | i = i * 2 10 | i = 2 + i 11 | i = i + 2 12 | i = 2 / i // expected-error {{cannot do VAR1 = THING / VAR1}} 13 | i = i / 2 14 | i = 2 - i // expected-error {{cannot do VAR1 = THING - VAR1}} 15 | i = i - 2 16 | x = 2.0 +@ x // expected-error {{cannot do VAR1 = THING +@ VAR1}} 17 | x = x +@ 2.0 18 | x = 2.0 -@ x // expected-error {{cannot do VAR1 = THING -@ VAR1}} 19 | x = x -@ 2.0 20 | // ...except that those are valid... 21 | x = x - x 22 | x = x / x 23 | x = x +@ x 24 | x = x -@ x 25 | 26 | // Increment/Decrement only works with integers 27 | ++i 28 | ++x // expected-error {{could not match alternative}} 29 | --nope // expected-error {{could not match alternative}} 30 | --a[0] 31 | 32 | // Expressions are disallowed in condition lists 33 | IF i = i + 2 // expected-error {{expression not allowed in this context}} 34 | OR i += 2 // expected-error {{expression not allowed in this context}} 35 | OR i =# x // expected-error {{expression not allowed in this context}} 36 | OR ++i // expected-error {{expression not allowed in this context}} 37 | OR i = 2 // fine 38 | NOP 39 | ENDIF 40 | 41 | TERMINATE_THIS_SCRIPT -------------------------------------------------------------------------------- /test/semantics/identifiers_3vc.sc: -------------------------------------------------------------------------------- 1 | // RUN: %dis %gta3sc %s --config=gta3 -fsyntax-only 2>&1 | %verify %s 2 | // RUN: %dis %gta3sc %s --config=gtavc -fsyntax-only 2>&1 | %verify %s 3 | PRINT_HELP abc 4 | PRINT_HELP _abc // expected-error {{invalid identifier}} 5 | PRINT_HELP semi: // expected-error {{invalid identifier}} 6 | TERMINATE_THIS_SCRIPT -------------------------------------------------------------------------------- /test/semantics/identifiers_sa.sc: -------------------------------------------------------------------------------- 1 | // RUN: %dis %gta3sc %s --config=gtasa --guesser -fsyntax-only 2>&1 | %verify %s 2 | 3 | VAR_TEXT_LABEL text8 4 | VAR_TEXT_LABEL16 text16 5 | 6 | PRINT_HELP abc 7 | PRINT_HELP _abc 8 | PRINT_HELP semi: // expected-error {{invalid identifier}} 9 | 10 | LAUNCH_MISSION _a.sc 11 | LAUNCH_MISSION 4x4.sc // actually a tokenizer test 12 | 13 | CUSTOM_PLATE_FOR_NEXT_CAR 0 __abc___ 14 | 15 | text8 = __abc 16 | text16 = __abc 17 | 18 | TERMINATE_THIS_SCRIPT -------------------------------------------------------------------------------- /test/semantics/identifiers_sa/4x4.sc: -------------------------------------------------------------------------------- 1 | MISSION_START 2 | MISSION_END -------------------------------------------------------------------------------- /test/semantics/identifiers_sa/_a.sc: -------------------------------------------------------------------------------- 1 | MISSION_START 2 | MISSION_END -------------------------------------------------------------------------------- /test/semantics/includers.sc: -------------------------------------------------------------------------------- 1 | // RUN: %dis %gta3sc %s --config=gta3 -fsyntax-only 2>&1 | %verify %s 2 | GOSUB_FILE gosub1 gosub1.sc 3 | LAUNCH_MISSION subscript.sc 4 | LAUNCH_MISSION gosub1.sc // expected-error {{first seen as extension}} 5 | TERMINATE_THIS_SCRIPT 6 | 7 | // expected-error@gta3sc:0 {{subscript.sc was first seen as subscript then as mission}} 8 | 9 | // expected-error@gosub1.sc:3 {{script file extension must be .sc}} 10 | // expected-error@gosub1.sc:4 {{script file extension must be .sc}} 11 | // expected-error@gosub1.sc:5 {{too few arguments}} 12 | 13 | // expected-warning@subscript.sc:2 {{use of this command outside main or extension files is not well-defined}} 14 | // expected-error@subscript.sc:3 {{use of this command outside main or extension files is not well-defined}} 15 | -------------------------------------------------------------------------------- /test/semantics/includers/gosub1.sc: -------------------------------------------------------------------------------- 1 | gosub1: 2 | LOAD_AND_LAUNCH_MISSION subscript.sc 3 | LOAD_AND_LAUNCH_MISSION something.sc2 4 | LOAD_AND_LAUNCH_MISSION something 5 | LOAD_AND_LAUNCH_MISSION 6 | RETURN -------------------------------------------------------------------------------- /test/semantics/includers/something: -------------------------------------------------------------------------------- 1 | MISSION_START 2 | MISSION_END -------------------------------------------------------------------------------- /test/semantics/includers/something.sc2: -------------------------------------------------------------------------------- 1 | MISSION_START 2 | MISSION_END -------------------------------------------------------------------------------- /test/semantics/includers/subscript.sc: -------------------------------------------------------------------------------- 1 | MISSION_START 2 | LAUNCH_MISSION launch_label 3 | LOAD_AND_LAUNCH_MISSION miss_label 4 | MISSION_END 5 | 6 | miss_label: 7 | TERMINATE_THIS_SCRIPT 8 | 9 | launch_label: 10 | TERMINATE_THIS_SCRIPT 11 | -------------------------------------------------------------------------------- /test/semantics/ranges.sc: -------------------------------------------------------------------------------- 1 | // RUN: %dis %gta3sc %s --config=gta3 -fsyntax-only 2>&1 | %verify %s 2 | 3 | WAIT 0 4 | 5 | WAIT -2147483648 6 | WAIT -2147483649 // expected-error {{out of range}} 7 | 8 | WAIT 2147483647 9 | WAIT 2147483648 // expected-error {{out of range}} 10 | 11 | WAIT 0x1 12 | WAIT -0x1 // expected-error {{invalid identifier}} 13 | 14 | WAIT 0x7FFFFFFF 15 | WAIT 0x80000000 16 | 17 | WAIT 0xFFFFFFFF 18 | WAIT 0x100000000 // expected-error {{out of range}} 19 | 20 | 21 | TERMINATE_THIS_SCRIPT 22 | -------------------------------------------------------------------------------- /test/semantics/repeat.sc: -------------------------------------------------------------------------------- 1 | // RUN: %dis %gta3sc %s --config=gta3 -fsyntax-only 2>&1 | %verify %s 2 | { 3 | VAR_INT x v 4 | LVAR_INT y 5 | 6 | REPEAT 5 x // fine 7 | ENDREPEAT 8 | 9 | REPEAT 5.0 x // expected-error {{expected integer}} 10 | ENDREPEAT 11 | 12 | REPEAT 5 y // fine by extension 13 | ENDREPEAT 14 | 15 | 16 | 17 | REPEAT v x // expected-error {{variable not allowed for this argument}} 18 | ENDREPEAT 19 | } 20 | TERMINATE_THIS_SCRIPT -------------------------------------------------------------------------------- /test/semantics/require.sc: -------------------------------------------------------------------------------- 1 | // RUN: %dis %gta3sc %s --config=gta3 -fsyntax-only 2>&1 | %verify %s 2 | REQUIRE req1.sc 3 | TERMINATE_THIS_SCRIPT 4 | 5 | // expected-error@req1.sc:1 {{using REQUIRE inside a required file is forbidden}} 6 | -------------------------------------------------------------------------------- /test/semantics/require/req1.sc: -------------------------------------------------------------------------------- 1 | REQUIRE req2.sc -------------------------------------------------------------------------------- /test/semantics/scopes.sc: -------------------------------------------------------------------------------- 1 | // RUN: %dis %gta3sc %s --config=gta3 -fsyntax-only 2>&1 | %verify %s 2 | 3 | { 4 | LVAR_INT x 5 | { // expected-error {{already inside a scope}} 6 | LVAR_INT x // expected-error {{exists}} 7 | } 8 | } 9 | 10 | LVAR_INT y // expected-error {{local variable definition outside of scope}} 11 | 12 | TERMINATE_THIS_SCRIPT -------------------------------------------------------------------------------- /test/semantics/script_name.sc: -------------------------------------------------------------------------------- 1 | // RUN: %dis %gta3sc %s --config=gta3 -fsyntax-only 2>&1 | %verify %s 2 | SCRIPT_NAME name 3 | LOAD_AND_LAUNCH_MISSION miss1.sc 4 | TERMINATE_THIS_SCRIPT 5 | 6 | // expected-error@miss1.sc:2 {{duplicate script name}} 7 | // expected-note@script_name.sc:2 {{previously used here}} 8 | -------------------------------------------------------------------------------- /test/semantics/script_name/miss1.sc: -------------------------------------------------------------------------------- 1 | MISSION_START 2 | SCRIPT_NAME name 3 | MISSION_END -------------------------------------------------------------------------------- /test/semantics/set_total.sc: -------------------------------------------------------------------------------- 1 | // RUN: %dis %gta3sc %s --config=gta3 -fsyntax-only 2>&1 | %verify %s 2 | 3 | // Set total once 4 | SET_PROGRESS_TOTAL 1 // expected-error {{must be 0}} 5 | SET_TOTAL_NUMBER_OF_MISSIONS 1 // expected-error {{must be 0}} 6 | SET_COLLECTABLE1_TOTAL 1 // expected-error {{must be 0}} 7 | 8 | // Set total again (error) 9 | SET_PROGRESS_TOTAL 0 // expected-error {{multiple times}} 10 | // expected-note@4 {{previously seen here}} 11 | SET_TOTAL_NUMBER_OF_MISSIONS 0 // expected-error {{multiple times}} 12 | // expected-note@5 {{previously seen here}} 13 | SET_COLLECTABLE1_TOTAL 0 // expected-error {{multiple times}} 14 | // expected-note@6 {{previously seen here}} 15 | 16 | TERMINATE_THIS_SCRIPT -------------------------------------------------------------------------------- /test/semantics/skip_cutscene.sc: -------------------------------------------------------------------------------- 1 | // RUN: %dis %gta3sc %s --config=gtasa --guesser -fsyntax-only 2>&1 | %verify %s 2 | 3 | SKIP_CUTSCENE_END // expected-error {{SKIP_CUTSCENE_END without SKIP_CUTSCENE_START}} 4 | 5 | SKIP_CUTSCENE_START 6 | SKIP_CUTSCENE_START // expected-error {{SKIP_CUTSCENE_START inside another SKIP_CUTSCENE_START}} 7 | WAIT 0 8 | SKIP_CUTSCENE_END 9 | 10 | SKIP_CUTSCENE_START_INTERNAL label1 11 | label1: 12 | 13 | SKIP_CUTSCENE_START 14 | // expected-error@skip_cutscene.sc:0 {{missing SKIP_CUTSCENE_END}} 15 | 16 | TERMINATE_THIS_SCRIPT -------------------------------------------------------------------------------- /test/semantics/switch.sc: -------------------------------------------------------------------------------- 1 | // RUN: %dis %gta3sc %s --config=gtasa --guesser -pedantic -fsyntax-only 2>&1 | %verify %s 2 | VAR_INT n j 3 | VAR_FLOAT f 4 | 5 | SWITCH n 6 | CASE 1 7 | CASE 1 // expected-error {{duplicate CASE}} 8 | BREAK 9 | CASE 2 // expected-error {{does not end with a BREAK}} 10 | WAIT 0 11 | CASE 3 12 | BREAK 13 | CASE j // expected-error {{variable not allowed}} 14 | BREAK 15 | CASE 1.0 // expected-error {{expected integer}} 16 | BREAK 17 | DEFAULT 18 | BREAK 19 | DEFAULT // expected-error {{multiple DEFAULT labels in one SWITCH}} 20 | ENDSWITCH 21 | 22 | SWITCH f // expected-error {{variable type does not match argument type}} 23 | ENDSWITCH 24 | 25 | SWITCH n 26 | BREAK // expected-error {{BREAK not within a CASE or DEFAULT label}} 27 | ENDSWITCH 28 | 29 | BREAK // expected-error {{BREAK only allowed at the end of a SWITCH CASE}} 30 | 31 | SWITCH n // expected-error {{SWITCH contains more than 75 cases}} 32 | CASE 0 33 | CASE 1 34 | CASE 2 35 | CASE 3 36 | CASE 4 37 | CASE 5 38 | CASE 6 39 | CASE 7 40 | CASE 8 41 | CASE 9 42 | CASE 10 43 | CASE 11 44 | CASE 12 45 | CASE 13 46 | CASE 14 47 | CASE 15 48 | CASE 16 49 | CASE 17 50 | CASE 18 51 | CASE 19 52 | CASE 20 53 | CASE 21 54 | CASE 22 55 | CASE 23 56 | CASE 24 57 | CASE 25 58 | CASE 26 59 | CASE 27 60 | CASE 28 61 | CASE 29 62 | CASE 30 63 | CASE 31 64 | CASE 32 65 | CASE 33 66 | CASE 34 67 | CASE 35 68 | CASE 36 69 | CASE 37 70 | CASE 38 71 | CASE 39 72 | CASE 40 73 | CASE 41 74 | CASE 42 75 | CASE 43 76 | CASE 44 77 | CASE 45 78 | CASE 46 79 | CASE 47 80 | CASE 48 81 | CASE 49 82 | CASE 50 83 | CASE 51 84 | CASE 52 85 | CASE 53 86 | CASE 54 87 | CASE 55 88 | CASE 56 89 | CASE 57 90 | CASE 58 91 | CASE 59 92 | CASE 60 93 | CASE 61 94 | CASE 62 95 | CASE 63 96 | CASE 64 97 | CASE 65 98 | CASE 66 99 | CASE 67 100 | CASE 68 101 | CASE 69 102 | CASE 70 103 | CASE 71 104 | CASE 72 105 | CASE 73 106 | CASE 74 107 | CASE 75 108 | BREAK 109 | ENDSWITCH 110 | 111 | TERMINATE_THIS_SCRIPT -------------------------------------------------------------------------------- /test/semantics/unsupported.sc: -------------------------------------------------------------------------------- 1 | // RUN: %dis %gta3sc %s --config=gta3 -fsyntax-only 2>&1 | %verify %s 2 | 3 | MAKE_PLAYER_SAFE 0 // expected-error {{unsupported}} 4 | IF WHILE 0 // expected-error {{internal}} 5 | OR IS_PLAYER_PLAYING 0 6 | WAIT 0 7 | ENDIF 8 | 9 | TERMINATE_THIS_SCRIPT -------------------------------------------------------------------------------- /test/semantics/vars_scan_3vc.sc: -------------------------------------------------------------------------------- 1 | // RUN: %dis %gta3sc %s --config=gta3 -fsyntax-only 2>&1 | %verify %s 2 | // RUN: %dis %gta3sc %s --config=gtavc -fsyntax-only 2>&1 | %verify %s 3 | 4 | VAR_TEXT_LABEL var1 // expected-error {{text label variables are not supported}} 5 | VAR_TEXT_LABEL var2 // expected-error {{text label variables are not supported}} 6 | 7 | VAR_INT array[2] // expected-error {{arrays are not supported}} 8 | 9 | TERMINATE_THIS_SCRIPT -------------------------------------------------------------------------------- /test/semantics/vars_scan_sa.sc: -------------------------------------------------------------------------------- 1 | // RUN: %dis %gta3sc %s --config=gtasa --guesser -fsyntax-only 2>&1 | %verify %s 2 | // Also see other tests in vars_scan_3vc.sc 3 | 4 | VAR_INT con[XYZ] // expected-error {{index must be constant}} 5 | VAR_INT zero[0] // expected-error {{declaring a zero-sized array}} 6 | VAR_INT neg[-1] // expected-error {{index cannot be negative}} 7 | VAR_INT maxa[256] // expected-error {{arrays are limited to a maximum of 255 elements}} 8 | VAR_INT maxb[255] 9 | 10 | TERMINATE_THIS_SCRIPT -------------------------------------------------------------------------------- /test/semantics/warn_conflict_text_label_var.sc: -------------------------------------------------------------------------------- 1 | // RUN: %dis %gta3sc %s --config=gtasa --guesser -fsyntax-only 2>&1 | %verify %s 2 | 3 | VAR_INT int 4 | VAR_TEXT_LABEL text8 5 | 6 | PRINT_HELP INT // expected-warning {{text label collides with some variable name}} 7 | PRINT_HELP TEXT8 // expected-warning {{text label collides with some variable name}} 8 | PRINT_HELP $text8 9 | 10 | TERMINATE_THIS_SCRIPT -------------------------------------------------------------------------------- /utils/discover_supported_commands.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | """ 3 | """ 4 | import sys 5 | import gta3sc 6 | from gta3sc.bytecode import Scope 7 | from itertools import chain 8 | from collections import defaultdict 9 | from bisect import * 10 | 11 | def main(ir2file, xmlfile): 12 | config = gta3sc.read_config(xmlfile) 13 | ir2 = gta3sc.read_ir2(ir2file) 14 | 15 | commands = {cmd.name: cmd for cmd in config.commands} 16 | 17 | for off, data in ir2: 18 | if data.is_command(): 19 | if not data.name in commands: 20 | print("Missing command %s" % data.name) 21 | else: 22 | cmd = commands[data.name] 23 | if not cmd.supported: 24 | cmd.supported = True 25 | print("Command %s is actually supported" % data.name) 26 | 27 | config.save_config(xmlfile) 28 | 29 | if __name__ == "__main__": 30 | if len(sys.argv) < 3: 31 | print("Usage: discover_supported_commands.py ") 32 | sys.exit(1) 33 | main(sys.argv[1], sys.argv[2]) 34 | -------------------------------------------------------------------------------- /utils/gta3sc/__init__.py: -------------------------------------------------------------------------------- 1 | # -*- Python -*- 2 | from config import read_commandline, read_config 3 | from bytecode import read_ir2 -------------------------------------------------------------------------------- /utils/license.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | cat_license() { 4 | printf "\n=============================\n" 5 | printf "$1 license\n" 6 | printf "=============================\n" 7 | cat "$2" 8 | } 9 | 10 | main_dir=$1 11 | printf "" 12 | cat_license gta3sc "$main_dir/LICENSE" 13 | cat_license cppformat "$main_dir/deps/cppformat/cppformat/LICENSE.rst" 14 | cat_license expected "$main_dir/deps/expected/LICENSE" 15 | cat_license SmallVector "$main_dir/deps/SmallVector/LICENSE.TXT" 16 | cat_license string_view "$main_dir/deps/string_view/LICENSE.TXT" 17 | printf "\n=============================\n\n" 18 | printf "Additionally any, optional, variant and rapidxml are licensed under the Boost Software License (http://www.boost.org/LICENSE_1_0.txt)\n" 19 | printf "\n=============================\n\n" 20 | -------------------------------------------------------------------------------- /utils/make_hash.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | """ 3 | """ 4 | import gta3sc 5 | from gta3sc.config import one_at_a_time 6 | import sys 7 | 8 | def main(xmlfile): 9 | config = gta3sc.read_config(xmlfile) 10 | 11 | for cmd in config.commands: 12 | cmd.hash = one_at_a_time(cmd.name) 13 | 14 | config.save_config(xmlfile) 15 | 16 | 17 | if __name__ == "__main__": 18 | if len(sys.argv) < 2: 19 | print("Usage: make_hash.py ") 20 | sys.exit(1) 21 | main(sys.argv[1]) 22 | -------------------------------------------------------------------------------- /utils/test.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python2 2 | import gta3sc 3 | import sys 4 | 5 | def main(xmlfile, clear_useless_data): 6 | config = gta3sc.read_config(xmlfile) 7 | commands = config.commands 8 | 9 | myset = set() 10 | for cmd in commands: 11 | for arg in cmd.args: 12 | if arg.desc: 13 | if arg.desc[0] in ['X', 'Y', 'Z'] or arg.desc in ["Radius", "Angle", "Rotation"]: 14 | arg.desc = arg.desc 15 | elif arg.desc.startswith("Script ID"): 16 | arg.desc = "Streamed Script" 17 | elif arg.desc.startswith("Time"): 18 | arg.desc = "Time" 19 | elif arg.desc.startswith("Boolean"): 20 | arg.desc = "Bool" 21 | elif arg.desc.startswith("Width"): 22 | arg.desc = "Width" 23 | elif arg.desc.startswith("Height"): 24 | arg.desc = "Height" 25 | elif arg.desc == "Red (0-255)": 26 | arg.desc = "Red" 27 | elif arg.desc == "Green (0-255)": 28 | arg.desc = "Green" 29 | elif arg.desc == "Blue (0-255)": 30 | arg.desc = "Blue" 31 | elif arg.desc == "Alpha (0-255)": 32 | arg.desc = "Alpha" 33 | elif arg.desc == "2D Pixel X": 34 | arg.desc = "2D Pixel X" 35 | elif arg.desc == "2D Pixel Y": 36 | arg.desc = "2D Pixel Y" 37 | else: 38 | arg.desc = "" 39 | 40 | config.save_config(xmlfile) 41 | 42 | 43 | if __name__ == "__main__": 44 | if len(sys.argv) < 2: 45 | print("Usage: test.py ") 46 | sys.exit(1) 47 | main(sys.argv[1], len(sys.argv) > 2) 48 | --------------------------------------------------------------------------------