├── .editorconfig ├── .github ├── ISSUE_TEMPLATE │ └── highlighting_bug_report.md └── workflows │ ├── .editorconfig │ └── main.yml ├── .gitignore ├── .npmignore ├── .vscode ├── extensions.json ├── launch.json └── tasks.json ├── .vscodeignore ├── Gemfile ├── Gemfile.lock ├── LICENSE ├── README.md ├── autogenerated ├── cpp.embedded.macro.tmLanguage.json ├── cpp.tmLanguage.json ├── cpp_scopes.txt └── package.vsix ├── commands ├── pip ├── project │ ├── build │ ├── build_and_test │ ├── clean │ ├── commands │ ├── publish │ ├── purge │ └── test ├── shell ├── start ├── subrepo └── tools │ ├── file_system │ ├── fornix │ ├── git │ ├── nix │ ├── nodejs │ ├── python │ ├── ruby │ └── string ├── documentation ├── CONTRIBUTING.md ├── SETUP.md ├── fornix_framework.md ├── images │ ├── banner.png │ ├── cd_tutorial.gif │ ├── compare.png │ ├── duckly.svg │ ├── package_from_example.png │ ├── package_name.png │ └── package_versions.png ├── library │ └── textmate_while.md └── setup.md ├── gemset.nix ├── icon.png ├── icon_builder_helper ├── convert_svgs.js └── gradient_effect.html ├── language_examples ├── #587.cpp ├── #587.spec.yaml ├── #002.cpp ├── #002.spec.yaml ├── #003.cpp ├── #003.spec.yaml ├── #004.cpp ├── #004.spec.yaml ├── #005.cpp ├── #005.spec.yaml ├── #006.cpp ├── #006.spec.yaml ├── #010.cpp ├── #010.spec.yaml ├── #011.cpp ├── #011.spec.yaml ├── #012.cpp ├── #012.spec.yaml ├── #014.cpp ├── #014.spec.yaml ├── #015.cpp ├── #015.spec.yaml ├── #016.cpp ├── #016.spec.yaml ├── #017.cpp ├── #017.spec.yaml ├── #018.cpp ├── #018.spec.yaml ├── #020.cpp ├── #020.spec.yaml ├── #022.cpp ├── #022.spec.yaml ├── #024.cpp ├── #024.spec.yaml ├── #025.cpp ├── #025.spec.yaml ├── #026.cpp ├── #026.spec.yaml ├── #027.cpp ├── #027.spec.yaml ├── #030.cpp ├── #030.spec.yaml ├── #032.cpp ├── #032.spec.yaml ├── #033.cpp ├── #033.spec.yaml ├── #034.cpp ├── #034.spec.yaml ├── #035.cpp ├── #035.spec.yaml ├── #036.cpp ├── #036.spec.yaml ├── #037.cpp ├── #037.spec.yaml ├── #043.cpp ├── #043.spec.yaml ├── #047.cpp ├── #047.spec.yaml ├── #050.cpp ├── #050.spec.yaml ├── #051.cpp ├── #051.spec.yaml ├── #053.cpp ├── #053.spec.yaml ├── #055.cpp ├── #055.spec.yaml ├── #058.cpp ├── #058.spec.yaml ├── #059.cpp ├── #059.spec.yaml ├── #060.cpp ├── #060.spec.yaml ├── #062.cpp ├── #062.spec.yaml ├── #064.cpp ├── #064.spec.yaml ├── #071.cpp ├── #071.spec.yaml ├── #072.cpp ├── #072.spec.yaml ├── #076.cpp ├── #076.spec.yaml ├── #079.cpp ├── #079.spec.yaml ├── #080.cpp ├── #080.spec.yaml ├── #082.cpp ├── #082.spec.yaml ├── #083.cpp ├── #083.spec.yaml ├── #085.cpp ├── #085.spec.yaml ├── #087.cpp ├── #087.spec.yaml ├── #088.cpp ├── #088.spec.yaml ├── #099.cpp ├── #099.spec.yaml ├── #100.cpp ├── #100.spec.yaml ├── #101.cpp ├── #101.spec.yaml ├── #106.cpp ├── #106.spec.yaml ├── #110.cpp ├── #110.spec.yaml ├── #113.cpp ├── #113.spec.yaml ├── #120.cpp ├── #120.spec.yaml ├── #121.cpp ├── #121.spec.yaml ├── #123.cpp ├── #123.spec.yaml ├── #128.cpp ├── #128.spec.yaml ├── #129.cpp ├── #129.spec.yaml ├── #130.cpp ├── #130.spec.yaml ├── #132.cpp ├── #132.spec.yaml ├── #133.cpp ├── #133.spec.yaml ├── #134.cpp ├── #134.spec.yaml ├── #136.cpp ├── #136.spec.yaml ├── #141.cpp ├── #141.spec.yaml ├── #150.cpp ├── #150.spec.yaml ├── #158.cpp ├── #158.spec.yaml ├── #166.cpp ├── #166.spec.yaml ├── #186.cpp ├── #186.spec.yaml ├── #188.cpp ├── #188.spec.yaml ├── #198.cpp ├── #198.spec.yaml ├── #203.cpp ├── #203.spec.yaml ├── #204.cpp ├── #204.spec.yaml ├── #207.cpp ├── #207.spec.yaml ├── #210.cpp ├── #210.spec.yaml ├── #218.cpp ├── #218.spec.yaml ├── #222.cpp ├── #222.spec.yaml ├── #224.cpp ├── #224.spec.yaml ├── #230.cpp ├── #230.spec.yaml ├── #235.cpp ├── #235.spec.yaml ├── #238.cpp ├── #238.spec.yaml ├── #247.cpp ├── #247.spec.yaml ├── #249.cpp ├── #249.spec.yaml ├── #256.cpp ├── #256.spec.yaml ├── #259.cpp ├── #259.spec.yaml ├── #260.cpp ├── #260.spec.yaml ├── #261.cpp ├── #261.spec.yaml ├── #264.cpp ├── #264.spec.yaml ├── #268.cpp ├── #268.spec.yaml ├── #278.cpp ├── #278.spec.yaml ├── #279.cpp ├── #279.spec.yaml ├── #282.cpp ├── #282.spec.yaml ├── #283.cpp ├── #283.spec.yaml ├── #287.cpp ├── #287.spec.yaml ├── #299.cpp ├── #299.spec.yaml ├── #301.cpp ├── #301.spec.yaml ├── #305.cpp ├── #305.spec.yaml ├── #307.cpp ├── #307.spec.yaml ├── #324.cpp ├── #324.spec.yaml ├── #341.cpp ├── #341.spec.yaml ├── #350.cpp ├── #350.spec.yaml ├── #353.cpp ├── #353.spec.yaml ├── #370.cpp ├── #370.spec.yaml ├── #372.cpp ├── #372.spec.yaml ├── #375.cpp ├── #375.spec.yaml ├── #378.cpp ├── #378.spec.yaml ├── #386.cpp ├── #386.spec.yaml ├── #395.cpp ├── #395.spec.yaml ├── #396.cpp ├── #396.spec.yaml ├── #398.cpp ├── #398.spec.yaml ├── #407.cpp ├── #407.spec.yaml ├── #410.cpp ├── #410.spec.yaml ├── #412.cpp ├── #412.spec.yaml ├── #414.cpp ├── #414.spec.yaml ├── #426.cpp ├── #426.spec.yaml ├── #427.cpp ├── #427.spec.yaml ├── #432.cpp ├── #432.spec.yaml ├── #433.cpp ├── #433.spec.yaml ├── #438.cpp ├── #438.spec.yaml ├── #442.cpp ├── #442.spec.yaml ├── #443.cpp ├── #443.spec.yaml ├── #460.cpp ├── #460.spec.yaml ├── #462.cpp ├── #462.spec.yaml ├── #489.cpp ├── #489.spec.yaml ├── #492.cpp ├── #492.spec.yaml ├── #501.cpp ├── #501.spec.yaml ├── #511.cpp ├── #511.spec.yaml ├── #513.cpp ├── #513.spec.yaml ├── #530.cpp ├── #530.spec.yaml ├── #569.cpp ├── #569.spec.yaml ├── #590.cpp ├── #590.spec.yaml ├── #604.cpp ├── #604.spec.yaml ├── #610.cpp ├── #610.spec.yaml ├── #611.cpp ├── #611.spec.yaml ├── #613.cpp ├── #613.spec.yaml ├── #616.cpp ├── #616.spec.yaml ├── #617.cpp ├── #617.spec.yaml ├── #621.cpp ├── #621.spec.yaml ├── #636.cpp ├── #636.spec.yaml ├── #641.cpp ├── #641.spec.yaml ├── #647.cpp ├── #647.spec.yaml ├── #651.cpp ├── #651.spec.yaml ├── #652.cpp ├── #652.spec.yaml ├── #654.cpp ├── #654.spec.yaml ├── #656.cpp ├── #656.spec.yaml ├── #vs-73292.cpp ├── #vs-73292.spec.yaml ├── #vs-76430.cpp ├── #vs-76430.spec.yaml ├── #vs-cpp-3703.cpp ├── #vs-cpp-3703.spec.yaml ├── 452.cpp ├── 452.spec.yaml ├── 638.cpp ├── 638.spec.yaml ├── constructor_call.cpp ├── constructor_call.spec.yaml ├── declares.cpp ├── declares.spec.yaml ├── feature_assembly.cpp ├── feature_assembly.spec.yaml ├── feature_basic_string_sso.cpp ├── feature_basic_string_sso.spec.yaml ├── feature_consteval.cpp ├── feature_consteval.spec.yaml ├── feature_constinit.cpp ├── feature_constinit.spec.yaml ├── feature_constructors.cpp ├── feature_constructors.spec.yaml ├── feature_doxygen.cpp ├── feature_doxygen.spec.yaml ├── feature_markup.md ├── feature_markup.spec.yaml ├── feature_namespace_alias.cpp ├── feature_namespace_alias.spec.yaml ├── feature_operator_overload.cpp ├── feature_operator_overload.spec.yaml ├── feature_parameters.cpp ├── feature_parameters.spec.yaml ├── feature_preprocessor.cpp ├── feature_preprocessor.spec.yaml ├── feature_tagged_strings.cpp ├── feature_tagged_strings.spec.yaml ├── feature_thread_local.cpp ├── feature_thread_local.spec.yaml ├── feature_trailing_return_types.cpp ├── feature_trailing_return_types.spec.yaml ├── feature_typedef_alias.cpp ├── feature_typedef_alias.spec.yaml ├── macro_issue.cpp ├── macro_issue.spec.yaml ├── misc_000.cpp ├── misc_000.spec.yaml ├── misc_001.cpp ├── misc_001.spec.yaml ├── misc_005.cpp ├── misc_005.spec.yaml ├── misc_006.cpp ├── misc_006.spec.yaml ├── misc_asteria.cpp ├── misc_asteria.spec.yaml ├── misc_test-23630.cpp ├── misc_test-23630.spec.yaml ├── misc_test-23850.cpp ├── misc_test-23850.spec.yaml ├── misc_test.cpp ├── misc_test.spec.yaml ├── operator_overload_implicit_const.cpp ├── operator_overload_implicit_const.spec.yaml ├── pr_161.cpp ├── pr_161.spec.yaml ├── pr_431.cpp ├── pr_431.spec.yaml ├── pr_435.cpp ├── pr_435.spec.yaml ├── ranged_for.cpp ├── ranged_for.spec.yaml ├── raw_strings.cpp ├── raw_strings.spec.yaml ├── test.cc ├── test.spec.yaml ├── theme_demo.cpp ├── theme_demo.spec.yaml ├── theme_demo1.cpp ├── theme_demo1.spec.yaml ├── theme_demo2.cpp └── theme_demo2.spec.yaml ├── lint ├── index.js └── linters │ ├── duplicate_value.js │ ├── spell_check.js │ └── unresolved.js ├── main ├── generate_macro_bailout.js ├── main.rb ├── patterns │ ├── assembly.rb │ ├── backslash_escapes.rb │ ├── comments.rb │ ├── control_flow.rb │ ├── doxygen.rb │ ├── numeric.rb │ ├── numeric_literal.rb │ ├── predefined_macros.rb │ ├── preprocessor.rb │ ├── raw_strings.rb │ ├── std_space.rb │ ├── string.rb │ ├── trigraph_support.rb │ └── variable.rb ├── textmate_tools.rb └── tokens.rb ├── package-lock.json ├── package.json ├── paths.rb ├── poetry.lock ├── pyproject.toml ├── requirements.txt ├── settings ├── .cache │ └── .keep ├── during_clean │ ├── 450_nix.sh │ ├── 500_git.sh │ ├── 600_cache_folder.sh │ ├── 801_python.sh │ ├── 801_ruby.sh │ └── 804_nodejs.sh ├── during_manual_start │ ├── 022_000_setup_pythonpath.sh │ ├── 024_000_python_ignores.sh │ ├── 026_000_check_node_modules.sh │ ├── 081_000__ensure_all_commands_executable__.sh │ └── 083_000_add_node_bin.sh ├── during_purge │ ├── 580_mac_library_caches.sh │ ├── 801_ruby.sh │ ├── 802_gem_home_cache.sh │ ├── 802_remove_venv.sh │ └── 805_remove_node_modules.sh ├── during_start │ ├── 000_009__add_path_injections__.sh │ ├── 001_000__setup_zsh__.sh │ ├── 001_010__setup_nix_path__.sh │ ├── 001_010_enable_globbing.sh │ ├── 004_000_add_system_bin.sh │ ├── 005_000__setup_ld_path__.sh │ ├── 010_000__ssl_fix__.sh │ ├── 019_000_setup_python_venv.sh │ ├── 021_000_ensure_pip_modules.sh │ ├── 022_000_setup_pythonpath.sh │ ├── 024_000_python_ignores.sh │ ├── 02600_check_node_modules.sh │ ├── 026_000_check_node_modules.sh │ ├── 033_000_ruby.sh │ ├── 081_000__ensure_all_commands_executable__.sh │ ├── 082_000_add_commands_to_path.sh │ ├── 08300_add_node_bin.sh │ ├── 083_000_add_node_bin.sh │ ├── 090_000_run_project_commands.sh │ ├── 091_000_commands_function.sh │ ├── 092_000_doit_function.sh │ ├── 093_000_customize_ll_function.sh │ ├── 094_000_jeffs_git_shortcuts.sh │ ├── 095_000_customize_tree_function.sh │ └── 099_050_finish_spaceship_setup_.sh ├── during_start_prep │ ├── 010_000_setting_up_env_message.sh │ ├── 01300_ruby │ ├── 032_000_link_pnpm_store.sh │ ├── 034_000_ruby.sh │ ├── 049_000_link_keychain.sh │ ├── 051_000_copy_git_config.sh │ ├── 052_000_copy_npmrc.sh │ ├── 053_000_copy_vsce.sh │ ├── 060_010_link_deno_store.sh │ ├── 060_010_link_nix_channel.sh │ ├── 060_010_link_tealdeer.sh │ ├── 089_000__sudo_injection__.sh │ ├── 091_000__logger_injection__.sh │ ├── 095_000_vim_injection.sh │ ├── 096_000_vscode_injection.sh │ └── 097_000_atom_injection.sh ├── extensions │ ├── #standard │ │ ├── #establish_extension.sh │ │ └── commands │ │ │ └── tools │ │ │ ├── file_system │ │ │ ├── add_execute_permission │ │ │ ├── copy │ │ │ ├── relative_link │ │ │ ├── remove │ │ │ └── storage │ │ │ ├── fornix │ │ │ ├── basic_init_example │ │ │ ├── create_wrapped_command │ │ │ ├── ensure_all_commands_executable │ │ │ ├── inject_into_path │ │ │ ├── merge_all_templates │ │ │ └── trigger │ │ │ └── string │ │ │ ├── escape_grep_regex │ │ │ ├── escape_shell_argument │ │ │ ├── indent │ │ │ ├── remove_doublequotes │ │ │ ├── remove_spaces_from_names │ │ │ └── unindent │ ├── git │ │ ├── #establish_extension.sh │ │ ├── commands │ │ │ ├── ignore │ │ │ └── mixin │ │ ├── config │ │ ├── during_cleaning.sh │ │ ├── during_start_prep.sh │ │ └── hooks │ │ │ ├── fsmonitor-watchman │ │ │ └── .keep │ │ │ ├── post-merge │ │ │ ├── .keep │ │ │ ├── 901_check_pip_modules │ │ │ └── 905_check_gem_modules │ │ │ ├── post-update │ │ │ ├── .keep │ │ │ ├── 901_check_pip_modules │ │ │ └── 905_check_gem_modules │ │ │ ├── pre-applypatch │ │ │ └── .keep │ │ │ ├── pre-commit │ │ │ ├── .keep │ │ │ └── 002_prevent_large_files.sh │ │ │ ├── pre-merge-commit │ │ │ └── .keep │ │ │ ├── pre-push │ │ │ └── .keep │ │ │ ├── pre-receive │ │ │ └── .keep │ │ │ ├── prepare-commit-msg │ │ │ └── .keep │ │ │ └── update │ │ │ └── .keep │ ├── nix │ │ ├── #establish_extension.sh │ │ ├── cacert.pem │ │ ├── commands │ │ │ ├── fix_ssl │ │ │ ├── force_patch_so_files │ │ │ ├── lib_path_for │ │ │ ├── long_eval │ │ │ ├── package_path_for │ │ │ └── raw_find │ │ ├── during_clean.sh │ │ ├── during_start.sh │ │ ├── installer_helper │ │ ├── nix.toml │ │ ├── parse_dependencies.nix │ │ ├── settings.toml │ │ ├── shell.nix │ │ └── uninstaller_helper │ ├── nodejs │ │ ├── #establish_extension.sh │ │ ├── commands │ │ │ └── check_node_modules │ │ ├── during_clean.sh │ │ ├── during_purge.sh │ │ └── during_start_prep.sh │ ├── os_mac │ │ ├── #establish_extension.sh │ │ ├── during_purge.sh │ │ └── during_start_prep.sh │ ├── python │ │ ├── #establish_extension.sh │ │ ├── commands │ │ │ ├── add_project_to_pythonpath │ │ │ ├── ensure_pip_modules │ │ │ ├── refresh_ignores │ │ │ └── setup_venv │ │ ├── during_clean.sh │ │ └── during_purge.sh │ └── ruby │ │ ├── #establish_extension.sh │ │ ├── commands │ │ └── check_gem_modules │ │ ├── during_clean.sh │ │ ├── during_purge.sh │ │ ├── during_start.sh │ │ └── during_start_prep.sh ├── fornix_core ├── home │ ├── .zshenv │ └── .zshrc └── requirements │ ├── advanced_system_tools.nix │ └── system_tools.toml └── syntaxes ├── c.tmLanguage.json ├── cpp.embedded.macro.tmLanguage.json ├── cpp.tmLanguage.json ├── objc.tmLanguage.json └── objcpp.tmLanguage.json /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | indent_style = space 5 | indent_size = 4 6 | charset = utf-8 7 | trim_trailing_whitespace = true 8 | insert_final_newline = false 9 | 10 | [package.json] 11 | indent_style = space 12 | indent_size = 2 -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/highlighting_bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Report an issue with syntax highlighting 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | Checklist 11 | 12 | - [ ] This problem exists even with the setting `"C_Cpp.enhancedColorization": "Disabled"` 13 | 14 | If Disabling that^ makes the problem go away, then follow this to make an issue on the C++ extension: 15 | https://github.com/microsoft/vscode-cpptools/issues/new/choose 16 | 17 | ## The code with a problem is: 18 | ``` 19 | // code or link to code 20 | ``` 21 | 22 | ## It looks like: 23 | ** screenshot + theme name preferable ** 24 | 25 | ## It should look like: 26 | ** description of ideal ** 27 | -------------------------------------------------------------------------------- /.github/workflows/.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*.yml] 4 | indent_style = space 5 | indent_size = 2 6 | charset = utf-8 7 | trim_trailing_whitespace = false 8 | insert_final_newline = false -------------------------------------------------------------------------------- /.github/workflows/main.yml: -------------------------------------------------------------------------------- 1 | name: Run Tests 2 | 3 | on: 4 | push: 5 | paths: 6 | - '**.rb' 7 | - '**.js' 8 | - package.json 9 | - 'source/*/examples/*.*' 10 | pull_request: 11 | paths: 12 | - '**.rb' 13 | - '**.js' 14 | - package.json 15 | - 'source/*/examples/*.*' 16 | 17 | jobs: 18 | build: 19 | runs-on: ubuntu-latest 20 | 21 | steps: 22 | - uses: actions/checkout@v2 23 | - name: Setup Node.js for use with actions 24 | uses: actions/setup-node@v1 25 | with: 26 | node-version: 10.x 27 | - name: Setup Ruby for use with actions 28 | uses: eregon/use-ruby-action@v1 29 | with: 30 | ruby-version: 2.6 31 | - name: test 32 | run: | 33 | gem install bundler 34 | bundler install 35 | npm ci 36 | export FORNIX_FOLDER="$PWD" 37 | commands/project/build 38 | commands/project/test 39 | env: 40 | CI: true 41 | -------------------------------------------------------------------------------- /.npmignore: -------------------------------------------------------------------------------- 1 | **/* 2 | !main/** 3 | !dist/** 4 | !src/** 5 | !source/** 6 | !*.js -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://go.microsoft.com/fwlink/?LinkId=827846 3 | // for the documentation about the extensions.json format 4 | "recommendations": [ 5 | "EditorConfig.EditorConfig", 6 | ] 7 | } -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "0.2.0", 3 | "configurations": [ 4 | { 5 | "name": "Launch Extension", 6 | "type": "extensionHost", 7 | "request": "launch", 8 | "args": ["--extensionDevelopmentPath=${workspaceRoot}"], 9 | } 10 | ] 11 | } 12 | -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | // See https://go.microsoft.com/fwlink/?LinkId=733558 3 | // for the documentation about the tasks.json format 4 | "version": "2.0.0", 5 | "tasks": [ 6 | { 7 | "label": "build", 8 | "type": "shell", 9 | "command": "./commands/project/build" 10 | } 11 | ] 12 | } -------------------------------------------------------------------------------- /.vscodeignore: -------------------------------------------------------------------------------- 1 | **/* 2 | !autogenerated/ 3 | autogenerated/package.vsix 4 | !icon.* 5 | !package.json 6 | !README.md 7 | !LICENSE.md 8 | !LICENSE -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | source 'http://rubygems.org' 2 | gem 'bundler' 3 | gem 'deep_clone' 4 | gem 'walk_up', ">=1.0.1" 5 | 6 | gem 'ruby_grammar_builder', '1.1.10' 7 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: http://rubygems.org/ 3 | specs: 4 | deep_clone (0.0.1) 5 | ruby_grammar_builder (1.1.10) 6 | deep_clone (~> 0.0.1, >= 0.0.1) 7 | walk_up (1.0.1) 8 | 9 | PLATFORMS 10 | ruby 11 | 12 | DEPENDENCIES 13 | bundler 14 | deep_clone 15 | ruby_grammar_builder (= 1.1.10) 16 | walk_up (>= 1.0.1) 17 | 18 | BUNDLED WITH 19 | 2.3.9 20 | -------------------------------------------------------------------------------- /autogenerated/package.vsix: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeff-hykin/better-cpp-syntax/071dd6ecc9eda347bd84c8aa0e0b557396cb6a40/autogenerated/package.vsix -------------------------------------------------------------------------------- /commands/pip: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # summary 4 | # this only exists so that pip for-sure corrisponds to the python command 5 | 6 | python -m pip --disable-pip-version-check "$@" -------------------------------------------------------------------------------- /commands/project/build: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | ruby "$FORNIX_FOLDER/main/main.rb" && echo " 4 | (Dont worry about the 'this is not supported') messages" -------------------------------------------------------------------------------- /commands/project/build_and_test: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | commands/project/build && commands/project/test 4 | -------------------------------------------------------------------------------- /commands/project/clean: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # summary 4 | # this just removes all of the can-be deleted files 5 | # can be useful for fixing corrupted setups 6 | 7 | # if you want to add something 8 | # edit the settings/during_clean/ 9 | # (add your own file to that folder like 001_clean_mything.sh) 10 | 11 | # source all the file in settings/during_clean/ in alphabetical order 12 | . "$FORNIX_FOLDER/settings/extensions/#standard/commands/tools/fornix/trigger" "$FORNIX_FOLDER/settings/during_clean" -------------------------------------------------------------------------------- /commands/project/commands: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | echo "commands:" 3 | # this loop is so stupidly complicated because of many inherent-to-shell reasons, for example: https://stackoverflow.com/questions/13726764/while-loop-subshell-dilemma-in-bash 4 | for_each_item_in="$FORNIX_COMMANDS_FOLDER"; [ -z "$__NESTED_WHILE_COUNTER" ] && __NESTED_WHILE_COUNTER=0;__NESTED_WHILE_COUNTER="$((__NESTED_WHILE_COUNTER + 1))"; trap 'rm -rf "$__temp_var__temp_folder"' EXIT; __temp_var__temp_folder="$(mktemp -d)"; mkfifo "$__temp_var__temp_folder/pipe_for_while_$__NESTED_WHILE_COUNTER"; (find "$for_each_item_in" -maxdepth 1 ! -path "$for_each_item_in" -print0 2>/dev/null | sort -z > "$__temp_var__temp_folder/pipe_for_while_$__NESTED_WHILE_COUNTER" &); while read -d $'\0' each 5 | do 6 | # only skip the tools directory because it has wayyyy too much stuff in it 7 | if [ -d "$each" ] && [ "$(basename "$each")" != "tools" ] 8 | then 9 | echo " $(basename "$each")" 10 | tree "$each" -C --dirsfirst -A -F --noreport | sed 's/^/ /' | sed -E 's/(\*|@)$/ /' | sed -E 's/->.+/ /' | sed "1d" 11 | fi 12 | done < "$__temp_var__temp_folder/pipe_for_while_$__NESTED_WHILE_COUNTER";__NESTED_WHILE_COUNTER="$((__NESTED_WHILE_COUNTER - 1))" 13 | echo 14 | echo "examples:" 15 | echo " project build" 16 | echo " project test" 17 | echo " project purge" 18 | -------------------------------------------------------------------------------- /commands/project/publish: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | vsce publish --pat "$1" && echo "published on VSCE" 4 | ovsx publish -p "$2" && echo "published on OVSX" 5 | 6 | tag_name="$(jq '.version' ./package.json)" 7 | git tag "$tag_name" && git push origin "$tag_name" -------------------------------------------------------------------------------- /commands/project/purge: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | # summary 4 | # this is a nuclear cleaning option 5 | # - if its not part of the git repo 6 | # - and it will take a long time (>1min) to get the data back 7 | # => this command should get rid of it 8 | # useful when you're trying to reset a project back to 0 when debugging 9 | 10 | # if you want to add something 11 | # edit the settings/during_purge/ 12 | # (add your own file to that folder like 001_clean_mything.sh) 13 | 14 | # get user confirmation 15 | read -p "Are you sure? (y/n)" -n 1 -r 16 | echo # (optional) move to a new line 17 | if [[ ! $REPLY =~ ^[Yy]$ ]] 18 | then 19 | echo "canceling" 20 | exit 0 21 | fi 22 | 23 | # clean all the small things first 24 | "$FORNIX_COMMANDS_FOLDER/project/clean" 25 | 26 | # source all the file in settings/during_purge/ in alphabetical order 27 | . "$FORNIX_FOLDER/settings/extensions/#standard/commands/tools/fornix/trigger" "$FORNIX_FOLDER/settings/during_purge" -------------------------------------------------------------------------------- /commands/project/test: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | if [ -z "$FORNIX_FOLDER" ] 4 | then 5 | FORNIX_FOLDER="." 6 | fi 7 | 8 | npx textmate-tester \ 9 | --textmateExtension cpp \ 10 | --syntax "$FORNIX_FOLDER/autogenerated/cpp.tmLanguage.json" \ 11 | --examples "$FORNIX_FOLDER/language_examples/" \ 12 | --supportSyntaxes '{ "source.cpp.embedded.macro": "'"$FORNIX_FOLDER"'/autogenerated/cpp.embedded.macro.tmLanguage.json" }' \ 13 | generate-specs --all 14 | -------------------------------------------------------------------------------- /commands/subrepo: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env -S deno run --allow-all 2 | import { FileSystem } from "https://deno.land/x/quickr@0.3.20/main/file_system.js" 3 | import { run, Stderr, Stdout } from "https://deno.land/x/quickr@0.3.20/main/run.js" 4 | 5 | // go to project root 6 | FileSystem.cwd = await FileSystem.walkUpUntil(".git/") 7 | 8 | await run`git add -A` 9 | await run`git commit -m -` 10 | const { exitCode } = await run("git", "subrepo", ...Deno.args) 11 | Deno.exit(exitCode) -------------------------------------------------------------------------------- /commands/tools/file_system: -------------------------------------------------------------------------------- 1 | ../../settings/extensions/#standard/commands/tools/file_system/ -------------------------------------------------------------------------------- /commands/tools/fornix: -------------------------------------------------------------------------------- 1 | ../../settings/extensions/#standard/commands/tools/fornix/ -------------------------------------------------------------------------------- /commands/tools/git: -------------------------------------------------------------------------------- 1 | ../../settings/extensions/git/commands/ -------------------------------------------------------------------------------- /commands/tools/nix: -------------------------------------------------------------------------------- 1 | ../../settings/extensions/nix/commands/ -------------------------------------------------------------------------------- /commands/tools/nodejs: -------------------------------------------------------------------------------- 1 | ../../settings/extensions/nodejs/commands/ -------------------------------------------------------------------------------- /commands/tools/python: -------------------------------------------------------------------------------- 1 | ../../settings/extensions/python/commands/ -------------------------------------------------------------------------------- /commands/tools/ruby: -------------------------------------------------------------------------------- 1 | ../../settings/extensions/ruby/commands/ -------------------------------------------------------------------------------- /commands/tools/string: -------------------------------------------------------------------------------- 1 | ../../settings/extensions/#standard/commands/tools/string/ -------------------------------------------------------------------------------- /documentation/images/banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeff-hykin/better-cpp-syntax/071dd6ecc9eda347bd84c8aa0e0b557396cb6a40/documentation/images/banner.png -------------------------------------------------------------------------------- /documentation/images/cd_tutorial.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeff-hykin/better-cpp-syntax/071dd6ecc9eda347bd84c8aa0e0b557396cb6a40/documentation/images/cd_tutorial.gif -------------------------------------------------------------------------------- /documentation/images/compare.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeff-hykin/better-cpp-syntax/071dd6ecc9eda347bd84c8aa0e0b557396cb6a40/documentation/images/compare.png -------------------------------------------------------------------------------- /documentation/images/package_from_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeff-hykin/better-cpp-syntax/071dd6ecc9eda347bd84c8aa0e0b557396cb6a40/documentation/images/package_from_example.png -------------------------------------------------------------------------------- /documentation/images/package_name.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeff-hykin/better-cpp-syntax/071dd6ecc9eda347bd84c8aa0e0b557396cb6a40/documentation/images/package_name.png -------------------------------------------------------------------------------- /documentation/images/package_versions.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeff-hykin/better-cpp-syntax/071dd6ecc9eda347bd84c8aa0e0b557396cb6a40/documentation/images/package_versions.png -------------------------------------------------------------------------------- /documentation/library/textmate_while.md: -------------------------------------------------------------------------------- 1 | The textmate "while" key has almost no documentation. I'm writing this to explain what little I know about it. 2 | 3 | ### Where it is allowed 4 | The "while" key can be used inside of a pattern range (something that normally would have a begin and end). It can be used instead of an "end" pattern. You can keep the end pattern, but I don't think it will be used for anything. 5 | 6 | ### The good part 7 | The "while" key is stronger than the "end" pattern, as soon as the while is over, it stops and most importantly, it cuts off any ranges that are still open. This is incredibly important because almost nothing else in textmate does this, and it is useful for stopping broken syntax. 8 | 9 | I believe it was designed to match things like the python intentation-based block. 10 | 11 | ### The bad part(s) 12 | However, there are some caveats. 13 | 1. The "while" pattern is line-based, not character-based. If you match a single character on a line, then the whole line is considered to be inside the pattern-range 14 | 2. On each line, nothing will start being matched until the while pattern has been fully matched 15 | 3. Once the while pattern matches, everything after the while pattern will be tagged using the patterns inside of the pattern-range 16 | -------------------------------------------------------------------------------- /gemset.nix: -------------------------------------------------------------------------------- 1 | { 2 | deep_clone = { 3 | groups = ["default"]; 4 | platforms = []; 5 | source = { 6 | remotes = ["http://rubygems.org"]; 7 | sha256 = "003iqvmxxcm7p6qr2aafi1p5djm6ycvwzrjk6shc9wvybkvbckmz"; 8 | type = "gem"; 9 | }; 10 | version = "0.0.1"; 11 | }; 12 | ruby_grammar_builder = { 13 | dependencies = ["deep_clone"]; 14 | groups = ["default"]; 15 | platforms = []; 16 | source = { 17 | remotes = ["http://rubygems.org"]; 18 | sha256 = "1c6s6qnd5g46agbb7mk1nf2w4zzh29lm9wl2cy0c9ynp0y27kyjq"; 19 | type = "gem"; 20 | }; 21 | version = "1.1.10"; 22 | }; 23 | walk_up = { 24 | groups = ["default"]; 25 | platforms = []; 26 | source = { 27 | remotes = ["http://rubygems.org"]; 28 | sha256 = "1g5xh4nk2dd5zrq2lfs4g5r7krfp4s4ppwy02ckqd5i2wbw16lf1"; 29 | type = "gem"; 30 | }; 31 | version = "1.0.1"; 32 | }; 33 | } 34 | -------------------------------------------------------------------------------- /icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jeff-hykin/better-cpp-syntax/071dd6ecc9eda347bd84c8aa0e0b557396cb6a40/icon.png -------------------------------------------------------------------------------- /icon_builder_helper/convert_svgs.js: -------------------------------------------------------------------------------- 1 | // just converts the svg to a png 2 | require("convert-svg-to-png").convertFile(process.argv[2].replace(/\.png/, ".svg"), {height: "300"}, process.argv[2]) -------------------------------------------------------------------------------- /language_examples/ #587.cpp: -------------------------------------------------------------------------------- 1 | class Base { 2 | virtual ~Base() = default; 3 | } 4 | 5 | class Derived:Base { 6 | ~Derived() override = default; 7 | } -------------------------------------------------------------------------------- /language_examples/#002.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | class Example { 4 | Example &operator++(); 5 | operator int(); 6 | operator std::string &(); 7 | }; 8 | 9 | int main() { 10 | return 0; 11 | } -------------------------------------------------------------------------------- /language_examples/#003.cpp: -------------------------------------------------------------------------------- 1 | namespace { 2 | bool foo(bar a, int b) { 3 | return true; 4 | } 5 | } 6 | 7 | namespace foo { 8 | bool foo(bar a, int b) { 9 | return true; 10 | } 11 | } -------------------------------------------------------------------------------- /language_examples/#004.cpp: -------------------------------------------------------------------------------- 1 | 10102'0232'2323 2 | L"abcdef" 3 | 0b10010110 4 | 100'000ms 5 | 1'234'567 6 | 0.12'34'56f 7 | 0b1001'1101 8 | 0x0.5p10L 9 | 0xAB'CD 10 | 1'2'3'4'5 -------------------------------------------------------------------------------- /language_examples/#005.cpp: -------------------------------------------------------------------------------- 1 | int foo = 1 + 11 + 111; -------------------------------------------------------------------------------- /language_examples/#005.spec.yaml: -------------------------------------------------------------------------------- 1 | - source: int 2 | scopes: 3 | - storage.type.primitive 4 | - storage.type.built-in.primitive 5 | - source: foo 6 | scopes: 7 | - variable.lower-case 8 | - variable.other.unknown.foo 9 | - source: '=' 10 | scopes: 11 | - keyword.operator.assignment 12 | - source: '1' 13 | scopes: 14 | - constant.numeric.decimal 15 | - source: + 16 | scopes: 17 | - keyword.operator.arithmetic 18 | - source: '11' 19 | scopes: 20 | - constant.numeric.decimal 21 | - source: + 22 | scopes: 23 | - keyword.operator.arithmetic 24 | - source: '111' 25 | scopes: 26 | - constant.numeric.decimal 27 | - source: ; 28 | scopes: 29 | - punctuation.terminator.statement 30 | -------------------------------------------------------------------------------- /language_examples/#006.cpp: -------------------------------------------------------------------------------- 1 | auto bar = {0x28, 0xd4, 0x96, 0x75, 0x4c}; -------------------------------------------------------------------------------- /language_examples/#006.spec.yaml: -------------------------------------------------------------------------------- 1 | - source: auto 2 | scopes: 3 | - storage.type.primitive 4 | - storage.type.built-in.primitive 5 | - source: bar 6 | scopes: 7 | - variable.lower-case 8 | - variable.other.unknown.bar 9 | - source: '=' 10 | scopes: 11 | - keyword.operator.assignment 12 | - source: '{' 13 | scopesBegin: 14 | - meta.block 15 | scopes: 16 | - punctuation.section.block.begin.bracket.curly 17 | - source: 0x 18 | scopes: 19 | - keyword.other.unit.hexadecimal 20 | - source: '28' 21 | scopes: 22 | - constant.numeric.hexadecimal 23 | - source: ',' 24 | scopes: 25 | - punctuation.separator.delimiter.comma 26 | - source: 0x 27 | scopes: 28 | - keyword.other.unit.hexadecimal 29 | - source: d4 30 | scopes: 31 | - constant.numeric.hexadecimal 32 | - source: ',' 33 | scopes: 34 | - punctuation.separator.delimiter.comma 35 | - source: 0x 36 | scopes: 37 | - keyword.other.unit.hexadecimal 38 | - source: '96' 39 | scopes: 40 | - constant.numeric.hexadecimal 41 | - source: ',' 42 | scopes: 43 | - punctuation.separator.delimiter.comma 44 | - source: 0x 45 | scopes: 46 | - keyword.other.unit.hexadecimal 47 | - source: '75' 48 | scopes: 49 | - constant.numeric.hexadecimal 50 | - source: ',' 51 | scopes: 52 | - punctuation.separator.delimiter.comma 53 | - source: 0x 54 | scopes: 55 | - keyword.other.unit.hexadecimal 56 | - source: 4c 57 | scopes: 58 | - constant.numeric.hexadecimal 59 | - source: '}' 60 | scopes: 61 | - punctuation.section.block.end.bracket.curly 62 | scopesEnd: 63 | - meta.block 64 | - source: ; 65 | scopes: 66 | - punctuation.terminator.statement 67 | -------------------------------------------------------------------------------- /language_examples/#010.cpp: -------------------------------------------------------------------------------- 1 | 498729f 2 | 498729l -------------------------------------------------------------------------------- /language_examples/#010.spec.yaml: -------------------------------------------------------------------------------- 1 | - source: '498729' 2 | scopes: 3 | - constant.numeric.decimal 4 | - source: f 5 | scopes: 6 | - keyword.other.suffix.literal.built-in.integer 7 | - keyword.other.unit.suffix.integer 8 | - source: '498729' 9 | scopes: 10 | - constant.numeric.decimal 11 | - source: l 12 | scopes: 13 | - keyword.other.suffix.literal.built-in.integer 14 | - keyword.other.unit.suffix.integer 15 | -------------------------------------------------------------------------------- /language_examples/#011.cpp: -------------------------------------------------------------------------------- 1 | bool aaaa(const char */* comment */ some_var) { return true; } -------------------------------------------------------------------------------- /language_examples/#011.spec.yaml: -------------------------------------------------------------------------------- 1 | - source: bool 2 | scopesBegin: 3 | - meta.function.definition 4 | scopes: 5 | - meta.qualified-type 6 | - storage.type.primitive 7 | - storage.type.built-in.primitive 8 | - source: aaaa 9 | scopesBegin: 10 | - meta.head.function.definition 11 | scopes: 12 | - entity.name.function.definition 13 | - source: ( 14 | scopes: 15 | - punctuation.section.parameters.begin.bracket.round 16 | - source: const 17 | scopesBegin: 18 | - meta.function.definition.parameters 19 | - meta.parameter 20 | scopes: 21 | - storage.modifier.specifier.const 22 | - source: char 23 | scopes: 24 | - storage.type.primitive 25 | - storage.type.built-in.primitive 26 | - source: '*' 27 | scopes: 28 | - storage.modifier.pointer 29 | - source: /* 30 | scopesBegin: 31 | - comment.block 32 | scopes: 33 | - punctuation.definition.comment.begin 34 | - source: ' comment ' 35 | - source: '*/' 36 | scopes: 37 | - punctuation.definition.comment.end 38 | scopesEnd: 39 | - comment.block 40 | - source: some_var 41 | scopes: 42 | - variable.parameter 43 | scopesEnd: 44 | - meta.function.definition.parameters 45 | - meta.parameter 46 | - source: ) 47 | scopes: 48 | - punctuation.section.parameters.end.bracket.round 49 | - source: '{' 50 | scopes: 51 | - punctuation.section.block.begin.bracket.curly.function.definition 52 | scopesEnd: 53 | - meta.head.function.definition 54 | - source: return 55 | scopesBegin: 56 | - meta.body.function.definition 57 | scopes: 58 | - keyword.control.return 59 | - source: 'true' 60 | scopes: 61 | - constant.language.true 62 | - source: ; 63 | scopes: 64 | - punctuation.terminator.statement 65 | - source: '}' 66 | scopes: 67 | - punctuation.section.block.end.bracket.curly.function.definition 68 | -------------------------------------------------------------------------------- /language_examples/#012.cpp: -------------------------------------------------------------------------------- 1 | void deleteFoo(); 2 | void namespaceFoo(); 3 | void override(); 4 | void final(); 5 | void audit(); 6 | void axiom(); 7 | void transaction_safe(); 8 | void transaction_safe_dynamic(); -------------------------------------------------------------------------------- /language_examples/#014.cpp: -------------------------------------------------------------------------------- 1 | class B 2 | {}; 3 | 4 | class A : 5 | public B 6 | {}; -------------------------------------------------------------------------------- /language_examples/#014.spec.yaml: -------------------------------------------------------------------------------- 1 | - source: class 2 | scopesBegin: 3 | - meta.block.class 4 | scopes: 5 | - meta.head.class 6 | - storage.type.class 7 | - source: B 8 | scopes: 9 | - entity.name.type.class 10 | - source: '{' 11 | scopes: 12 | - meta.head.class 13 | - punctuation.section.block.begin.bracket.curly.class 14 | - source: '}' 15 | scopes: 16 | - meta.body.class 17 | - punctuation.section.block.end.bracket.curly.class 18 | - source: ; 19 | scopes: 20 | - punctuation.terminator.statement 21 | - source: class 22 | scopes: 23 | - meta.head.class 24 | - storage.type.class 25 | - source: A 26 | scopes: 27 | - entity.name.type.class 28 | - source: ':' 29 | scopesBegin: 30 | - meta.head.class 31 | scopes: 32 | - punctuation.separator.colon.inheritance 33 | - source: public 34 | scopes: 35 | - storage.type.modifier.access.public 36 | - source: B 37 | scopes: 38 | - meta.qualified-type 39 | - entity.name.type 40 | - source: '{' 41 | scopes: 42 | - punctuation.section.block.begin.bracket.curly.class 43 | scopesEnd: 44 | - meta.head.class 45 | - source: '}' 46 | scopes: 47 | - meta.body.class 48 | - punctuation.section.block.end.bracket.curly.class 49 | - source: ; 50 | scopes: 51 | - punctuation.terminator.statement 52 | -------------------------------------------------------------------------------- /language_examples/#015.cpp: -------------------------------------------------------------------------------- 1 | class C 2 | { 3 | public : 4 | }; 5 | -------------------------------------------------------------------------------- /language_examples/#015.spec.yaml: -------------------------------------------------------------------------------- 1 | - source: class 2 | scopesBegin: 3 | - meta.block.class 4 | scopes: 5 | - meta.head.class 6 | - storage.type.class 7 | - source: C 8 | scopes: 9 | - entity.name.type.class 10 | - source: '{' 11 | scopes: 12 | - meta.head.class 13 | - punctuation.section.block.begin.bracket.curly.class 14 | - source: 'public ' 15 | scopesBegin: 16 | - meta.body.class 17 | - storage.type.modifier.access.control.public 18 | - source: ':' 19 | scopes: 20 | - punctuation.separator.colon.access.control 21 | scopesEnd: 22 | - storage.type.modifier.access.control.public 23 | - source: '}' 24 | scopes: 25 | - punctuation.section.block.end.bracket.curly.class 26 | scopesEnd: 27 | - meta.body.class 28 | - source: ; 29 | scopes: 30 | - punctuation.terminator.statement 31 | -------------------------------------------------------------------------------- /language_examples/#016.cpp: -------------------------------------------------------------------------------- 1 | void operator "" _km(long double); -------------------------------------------------------------------------------- /language_examples/#016.spec.yaml: -------------------------------------------------------------------------------- 1 | - source: void 2 | scopesBegin: 3 | - meta.function.definition.special.operator-overload 4 | scopes: 5 | - meta.qualified-type 6 | - storage.type.primitive 7 | - storage.type.built-in.primitive 8 | - source: operator 9 | scopesBegin: 10 | - meta.head.function.definition.special.operator-overload 11 | scopes: 12 | - keyword.other.operator.overload 13 | - source: '""' 14 | scopesBegin: 15 | - entity.name.operator.custom-literal 16 | - source: _km 17 | scopesEnd: 18 | - entity.name.operator.custom-literal 19 | - source: ( 20 | scopes: 21 | - >- 22 | punctuation.section.parameters.begin.bracket.round.special.operator-overload 23 | - source: long 24 | scopesBegin: 25 | - meta.function.definition.parameters.special.operator-overload 26 | - meta.parameter 27 | - storage.type.primitive 28 | - storage.type.built-in.primitive 29 | - source: double 30 | scopesEnd: 31 | - meta.function.definition.parameters.special.operator-overload 32 | - meta.parameter 33 | - storage.type.primitive 34 | - storage.type.built-in.primitive 35 | - source: ) 36 | scopes: 37 | - punctuation.section.parameters.end.bracket.round.special.operator-overload 38 | scopesEnd: 39 | - meta.function.definition.special.operator-overload 40 | - meta.head.function.definition.special.operator-overload 41 | - source: ; 42 | scopes: 43 | - punctuation.terminator.statement 44 | -------------------------------------------------------------------------------- /language_examples/#017.cpp: -------------------------------------------------------------------------------- 1 | class LineReader{}; 2 | class Line_Reader{}; 3 | class Line\u00b7Reader{}; 4 | class Line\U0002070EReader{}; 5 | void LineReader(); 6 | void Line_Reader(); 7 | void Line\u00b7Reader(); 8 | void Line\U0002070EReader(); 9 | namespace LineReader{}; 10 | namespace Line_Reader{}; 11 | namespace Line\u00b7Reader{}; 12 | namespace Line\U0002070EReader{}; 13 | struct LineReader{}; 14 | struct Line_Reader{}; 15 | struct Line\u00b7Reader{}; 16 | struct Line\U0002070EReader{}; 17 | enum LineReader{}; 18 | enum Line_Reader{}; 19 | enum Line\u00b7Reader{}; 20 | enum Line\U0002070EReader{}; -------------------------------------------------------------------------------- /language_examples/#018.cpp: -------------------------------------------------------------------------------- 1 | void function() { 2 | typeid(int); 3 | typeid(long); 4 | sizeof(1000); 5 | sizeof(int); 6 | decltype(int); 7 | using type = decltype(a_storage_of_callable.callable); 8 | } -------------------------------------------------------------------------------- /language_examples/#020.cpp: -------------------------------------------------------------------------------- 1 | dynamic_cast(expression + 1 + thing) 2 | reinterpret_cast(expression + 1 + thing) 3 | static_cast(expression + 1 + thing) 4 | const_cast(expression + 1 + thing) 5 | void foo() { 6 | dynamic_cast(expression + 1 + thing) 7 | reinterpret_cast(expression + 1 + thing) 8 | static_cast(expression + 1 + thing) 9 | const_cast(expression + 1 + thing) 10 | } -------------------------------------------------------------------------------- /language_examples/#022.cpp: -------------------------------------------------------------------------------- 1 | sscanf(user_input, "%c %[^\n]", &arg0, arg_str); // reads char into arg0, the remainder until \n to arg_str 2 | void test() 3 | { 4 | t = time(NULL); 5 | tmp = localtime(&t); 6 | strftime(timestr, sizeof(timestr), "%Y-%m-%d %H:%M:%s", tmp); 7 | } -------------------------------------------------------------------------------- /language_examples/#024.cpp: -------------------------------------------------------------------------------- 1 | class ClassA { 2 | }; 3 | 4 | class ClassE final : public ClassA { 5 | }; 6 | 7 | namespace foo { 8 | class ClassF { 9 | }; 10 | 11 | class ClassG { 12 | }; 13 | } 14 | 15 | class ClassH : public foo::ClassF, public foo::ClassG { 16 | }; -------------------------------------------------------------------------------- /language_examples/#025.cpp: -------------------------------------------------------------------------------- 1 | bool 2 | FillStats(Stats aStats); 3 | 4 | bool 5 | FillStats( 6 | Stats aStats 7 | ); 8 | 9 | bool 10 | FillStats ( 11 | Stats aStats 12 | ); 13 | 14 | bool 15 | FillStats(); 16 | 17 | bool 18 | FillStats 19 | ( 20 | Stats aStats 21 | ); -------------------------------------------------------------------------------- /language_examples/#026.cpp: -------------------------------------------------------------------------------- 1 | struct foo { 2 | int (*bar)(); 3 | int *(*bar)(); 4 | int &(*bar[])(); 5 | int **&(*fcnPtr)(int a); 6 | }; 7 | 8 | union baz { 9 | int (*quz)(); 10 | }; 11 | -------------------------------------------------------------------------------- /language_examples/#027.cpp: -------------------------------------------------------------------------------- 1 | /**/ #define a cout << "this works :/\n"; 2 | -------------------------------------------------------------------------------- /language_examples/#027.spec.yaml: -------------------------------------------------------------------------------- 1 | - source: /* 2 | scopesBegin: 3 | - meta.preprocessor.macro 4 | - comment.block 5 | scopes: 6 | - punctuation.definition.comment.begin 7 | - source: '*/' 8 | scopes: 9 | - comment.block 10 | - punctuation.definition.comment.end 11 | scopesEnd: 12 | - comment.block 13 | - source: '#' 14 | scopesBegin: 15 | - keyword.control.directive.define 16 | scopes: 17 | - punctuation.definition.directive 18 | - source: define 19 | scopesEnd: 20 | - keyword.control.directive.define 21 | - source: a 22 | scopes: 23 | - entity.name.function.preprocessor 24 | - source: cout 25 | scopes: 26 | - variable.lower-case 27 | - variable.other.unknown.cout 28 | - source: '<<' 29 | scopes: 30 | - keyword.operator.bitwise.shift 31 | - source: '"' 32 | scopesBegin: 33 | - string.quoted.double 34 | scopes: 35 | - punctuation.definition.string.begin 36 | - source: 'this works :/' 37 | - source: \n 38 | scopes: 39 | - constant.character.escape 40 | - source: '"' 41 | scopes: 42 | - punctuation.definition.string.end 43 | scopesEnd: 44 | - string.quoted.double 45 | - source: ; 46 | scopes: 47 | - punctuation.terminator.statement 48 | -------------------------------------------------------------------------------- /language_examples/#030.cpp: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | 5 | #define IsPointDef(...) \ 6 | template<> \ 7 | struct IsPoint<__VA_ARGS__> \ 8 | {\ 9 | static const bool isPoint = true;\ 10 | } 11 | 12 | #define ArrayBasedPointDef(T) \ 13 | IsPointDef(T); \ 14 | template<> \ 15 | struct IsArrayBasedPoint:public std::true_type \ 16 | {}; 17 | 18 | 19 | 20 | #define XYBasedPointDef(T) \ 21 | IsPointDef(T); \ 22 | template<> \ 23 | struct IsXYBasedPoint:public std::true_type \ 24 | {}; 25 | 26 | #define TypeTAndUIsPoint \ 27 | template::isPoint>::type, class = typename std::enable_if::isPoint>::type> 28 | 29 | namespace Navigation 30 | { 31 | namespace Utils 32 | { 33 | template 34 | struct IsPoint 35 | { 36 | static const bool isPoint = false; 37 | }; 38 | 39 | template 40 | struct IsArrayBasedPoint 41 | { 42 | static const bool value = false; 43 | }; 44 | 45 | template 46 | struct IsXYBasedPoint 47 | { 48 | static const bool value = false; 49 | }; 50 | 51 | } 52 | } -------------------------------------------------------------------------------- /language_examples/#032.cpp: -------------------------------------------------------------------------------- 1 | const char *a = "foo ??/" ? ? / ? ? / "; 2 | 3 | class A < 4 | % A(); // test 5 | % > ; -------------------------------------------------------------------------------- /language_examples/#032.spec.yaml: -------------------------------------------------------------------------------- 1 | - source: const 2 | scopes: 3 | - storage.modifier.specifier.const 4 | - source: char 5 | scopes: 6 | - storage.type.primitive 7 | - storage.type.built-in.primitive 8 | - source: '*' 9 | scopes: 10 | - keyword.operator.arithmetic 11 | - source: a 12 | scopes: 13 | - variable.lower-case 14 | - variable.other.unknown.a 15 | - source: '=' 16 | scopes: 17 | - keyword.operator.assignment 18 | - source: '"' 19 | scopesBegin: 20 | - string.quoted.double 21 | scopes: 22 | - punctuation.definition.string.begin 23 | - source: foo ??/ 24 | - source: '"' 25 | scopes: 26 | - punctuation.definition.string.end 27 | scopesEnd: 28 | - string.quoted.double 29 | - source: '?' 30 | scopesBegin: 31 | - keyword.operator.ternary 32 | - source: '?' 33 | scopesEnd: 34 | - keyword.operator.ternary 35 | - source: / 36 | scopes: 37 | - keyword.operator.arithmetic 38 | - source: '?' 39 | scopesBegin: 40 | - keyword.operator.ternary 41 | - source: '?' 42 | scopesEnd: 43 | - keyword.operator.ternary 44 | - source: / 45 | scopes: 46 | - keyword.operator.arithmetic 47 | - source: '"' 48 | scopesBegin: 49 | - string.quoted.double 50 | scopes: 51 | - punctuation.definition.string.begin 52 | - source: ; 53 | - source: ' class A <' 54 | - source: '% A' 55 | scopes: 56 | - constant.other.placeholder 57 | - source: (); // test 58 | - source: '% > ;' 59 | -------------------------------------------------------------------------------- /language_examples/#033.cpp: -------------------------------------------------------------------------------- 1 | vector> -------------------------------------------------------------------------------- /language_examples/#033.spec.yaml: -------------------------------------------------------------------------------- 1 | - source: vector 2 | scopes: 3 | - variable.lower-case 4 | - variable.other.unknown.vector 5 | - source: < 6 | scopes: 7 | - keyword.operator.comparison 8 | - source: vector 9 | scopes: 10 | - variable.lower-case 11 | - variable.other.unknown.vector 12 | - source: < 13 | scopes: 14 | - keyword.operator.comparison 15 | - source: string 16 | scopes: 17 | - variable.lower-case 18 | - variable.other.unknown.string 19 | - source: '>>' 20 | scopes: 21 | - keyword.operator.bitwise.shift 22 | -------------------------------------------------------------------------------- /language_examples/#034.cpp: -------------------------------------------------------------------------------- 1 | #define IS_UPGRADE_ADDR(addr) (/*((addr) >= UPGRADE_BASE_ADDR) && */(addr) < UPGRADE_BASE_ADDR + UPGRADE_SPACE_SIZE) -------------------------------------------------------------------------------- /language_examples/#034.spec.yaml: -------------------------------------------------------------------------------- 1 | - source: '#' 2 | scopesBegin: 3 | - meta.preprocessor.macro 4 | - keyword.control.directive.define 5 | scopes: 6 | - punctuation.definition.directive 7 | - source: define 8 | scopesEnd: 9 | - keyword.control.directive.define 10 | - source: IS_UPGRADE_ADDR 11 | scopes: 12 | - entity.name.function.preprocessor 13 | - source: ( 14 | scopes: 15 | - punctuation.definition.parameters.begin.preprocessor 16 | - source: addr 17 | scopes: 18 | - meta.function.preprocessor.parameters 19 | - variable.parameter.preprocessor 20 | - source: ) 21 | scopes: 22 | - punctuation.definition.parameters.end.preprocessor 23 | - source: ( 24 | scopesBegin: 25 | - meta.parens 26 | scopes: 27 | - punctuation.section.parens.begin.bracket.round 28 | - source: /* 29 | scopesBegin: 30 | - comment.block 31 | scopes: 32 | - punctuation.definition.comment.begin 33 | - source: '((addr) >= UPGRADE_BASE_ADDR) && ' 34 | - source: '*/' 35 | scopes: 36 | - punctuation.definition.comment.end 37 | scopesEnd: 38 | - comment.block 39 | - source: ( 40 | scopesBegin: 41 | - meta.parens 42 | scopes: 43 | - punctuation.section.parens.begin.bracket.round 44 | - source: addr 45 | scopes: 46 | - variable.lower-case 47 | - variable.other.unknown.addr 48 | - source: ) 49 | scopes: 50 | - punctuation.section.parens.end.bracket.round 51 | scopesEnd: 52 | - meta.parens 53 | - source: < 54 | scopes: 55 | - keyword.operator.comparison 56 | - source: UPGRADE_BASE_ADDR 57 | scopes: 58 | - variable.upper-case 59 | - variable.other.unknown.UPGRADE_BASE_ADDR 60 | - source: + 61 | scopes: 62 | - keyword.operator.arithmetic 63 | - source: UPGRADE_SPACE_SIZE 64 | scopes: 65 | - variable.upper-case 66 | - variable.other.unknown.UPGRADE_SPACE_SIZE 67 | - source: ) 68 | scopes: 69 | - punctuation.section.parens.end.bracket.round 70 | -------------------------------------------------------------------------------- /language_examples/#035.cpp: -------------------------------------------------------------------------------- 1 | namespace test { 2 | template 3 | struct test { 4 | template > 5 | bool operator()(U k) {} 6 | }; 7 | struct test2 { 8 | bool operator()() = delete; 9 | }; 10 | } // namespace test 11 | 12 | // no syntax highlighting 13 | class test2 {}; -------------------------------------------------------------------------------- /language_examples/#036.cpp: -------------------------------------------------------------------------------- 1 | vector v_name (3); -------------------------------------------------------------------------------- /language_examples/#036.spec.yaml: -------------------------------------------------------------------------------- 1 | - source: vector 2 | scopes: 3 | - variable.lower-case 4 | - variable.other.unknown.vector 5 | - source: < 6 | scopes: 7 | - keyword.operator.comparison 8 | - source: int 9 | scopes: 10 | - storage.type.primitive 11 | - storage.type.built-in.primitive 12 | - source: '>' 13 | scopes: 14 | - keyword.operator.comparison 15 | - source: v_name 16 | scopes: 17 | - entity.name.function.call 18 | - source: ( 19 | scopes: 20 | - punctuation.section.arguments.begin.bracket.round.function.call 21 | - source: '3' 22 | scopes: 23 | - constant.numeric.decimal 24 | - source: ) 25 | scopes: 26 | - punctuation.section.arguments.end.bracket.round.function.call 27 | - source: ; 28 | scopes: 29 | - punctuation.terminator.statement 30 | -------------------------------------------------------------------------------- /language_examples/#037.cpp: -------------------------------------------------------------------------------- 1 | test()[0] = 5; // no syntax highlighting; 2 | test[5][5] = 5; -------------------------------------------------------------------------------- /language_examples/#037.spec.yaml: -------------------------------------------------------------------------------- 1 | - source: test 2 | scopes: 3 | - entity.name.function.call 4 | - source: ( 5 | scopes: 6 | - punctuation.section.arguments.begin.bracket.round.function.call 7 | - source: ) 8 | scopes: 9 | - punctuation.section.arguments.end.bracket.round.function.call 10 | - source: '[' 11 | scopesBegin: 12 | - meta.bracket.square.access 13 | scopes: 14 | - punctuation.definition.begin.bracket.square 15 | - source: '0' 16 | scopes: 17 | - constant.numeric.decimal 18 | - source: ']' 19 | scopes: 20 | - punctuation.definition.end.bracket.square 21 | scopesEnd: 22 | - meta.bracket.square.access 23 | - source: '=' 24 | scopes: 25 | - keyword.operator.assignment 26 | - source: '5' 27 | scopes: 28 | - constant.numeric.decimal 29 | - source: ; 30 | scopes: 31 | - punctuation.terminator.statement 32 | - source: // 33 | scopesBegin: 34 | - comment.line.double-slash 35 | scopes: 36 | - punctuation.definition.comment 37 | - source: ' no syntax highlighting;' 38 | scopesEnd: 39 | - comment.line.double-slash 40 | - source: test 41 | scopesBegin: 42 | - meta.bracket.square.access 43 | scopes: 44 | - variable.other.object 45 | - source: '[' 46 | scopes: 47 | - punctuation.definition.begin.bracket.square 48 | - source: '5' 49 | scopes: 50 | - constant.numeric.decimal 51 | - source: ']' 52 | scopes: 53 | - punctuation.definition.end.bracket.square 54 | - source: '[' 55 | scopes: 56 | - punctuation.definition.begin.bracket.square 57 | - source: '5' 58 | scopes: 59 | - constant.numeric.decimal 60 | - source: ']' 61 | scopes: 62 | - punctuation.definition.end.bracket.square 63 | scopesEnd: 64 | - meta.bracket.square.access 65 | - source: '=' 66 | scopes: 67 | - keyword.operator.assignment 68 | - source: '5' 69 | scopes: 70 | - constant.numeric.decimal 71 | - source: ; 72 | scopes: 73 | - punctuation.terminator.statement 74 | -------------------------------------------------------------------------------- /language_examples/#043.cpp: -------------------------------------------------------------------------------- 1 | int main() { 2 | if constexpr(std::is_signed_v) { // no syntax highlighting 3 | } 4 | } 5 | -------------------------------------------------------------------------------- /language_examples/#047.cpp: -------------------------------------------------------------------------------- 1 | enum bar b; 2 | int foo() { 3 | enum bar b; 4 | } -------------------------------------------------------------------------------- /language_examples/#047.spec.yaml: -------------------------------------------------------------------------------- 1 | - source: enum 2 | scopes: 3 | - storage.type.enum.declare 4 | - source: bar 5 | scopes: 6 | - entity.name.type.enum 7 | - source: b 8 | scopes: 9 | - variable.other.object.declare 10 | - source: ; 11 | scopes: 12 | - punctuation.terminator.statement 13 | - source: int 14 | scopesBegin: 15 | - meta.function.definition 16 | scopes: 17 | - meta.qualified-type 18 | - storage.type.primitive 19 | - storage.type.built-in.primitive 20 | - source: foo 21 | scopesBegin: 22 | - meta.head.function.definition 23 | scopes: 24 | - entity.name.function.definition 25 | - source: ( 26 | scopes: 27 | - punctuation.section.parameters.begin.bracket.round 28 | - source: ) 29 | scopes: 30 | - punctuation.section.parameters.end.bracket.round 31 | - source: '{' 32 | scopes: 33 | - punctuation.section.block.begin.bracket.curly.function.definition 34 | scopesEnd: 35 | - meta.head.function.definition 36 | - source: enum 37 | scopesBegin: 38 | - meta.body.function.definition 39 | - meta.declaration 40 | - meta.qualified-type 41 | scopes: 42 | - storage.type.enum 43 | - source: bar 44 | scopes: 45 | - entity.name.type 46 | scopesEnd: 47 | - meta.qualified-type 48 | - source: b 49 | scopes: 50 | - meta.declaration 51 | - variable.lower-case 52 | - variable.other.declare 53 | scopesEnd: 54 | - meta.declaration 55 | - source: ; 56 | scopes: 57 | - punctuation.terminator.statement 58 | - source: '}' 59 | scopes: 60 | - punctuation.section.block.end.bracket.curly.function.definition 61 | -------------------------------------------------------------------------------- /language_examples/#050.cpp: -------------------------------------------------------------------------------- 1 | int main() { 2 | switch(test) { 3 | case 1: 4 | break; 5 | case 2: [[fallthrough]]; 6 | case 3: break; // no syntax highlighting 7 | } 8 | void func1(); 9 | [[noreturn]] void func2(/*syntax highlighting*/); // no syntax highlighting 10 | struct st { // syntax highlighting works now 11 | }; 12 | void func3(); 13 | } 14 | -------------------------------------------------------------------------------- /language_examples/#051.cpp: -------------------------------------------------------------------------------- 1 | namespace { 2 | using A = decltype(5); 3 | decltype(5) B = A(); 4 | } -------------------------------------------------------------------------------- /language_examples/#053.cpp: -------------------------------------------------------------------------------- 1 | class foo : bar {}; 2 | class foo : public bar {}; -------------------------------------------------------------------------------- /language_examples/#053.spec.yaml: -------------------------------------------------------------------------------- 1 | - source: class 2 | scopesBegin: 3 | - meta.block.class 4 | scopes: 5 | - meta.head.class 6 | - storage.type.class 7 | - source: foo 8 | scopes: 9 | - entity.name.type.class 10 | - source: ':' 11 | scopesBegin: 12 | - meta.head.class 13 | scopes: 14 | - punctuation.separator.colon.inheritance 15 | - source: 'bar ' 16 | - source: '{' 17 | scopes: 18 | - punctuation.section.block.begin.bracket.curly.class 19 | scopesEnd: 20 | - meta.head.class 21 | - source: '}' 22 | scopes: 23 | - meta.body.class 24 | - punctuation.section.block.end.bracket.curly.class 25 | - source: ; 26 | scopes: 27 | - punctuation.terminator.statement 28 | - source: class 29 | scopes: 30 | - meta.head.class 31 | - storage.type.class 32 | - source: foo 33 | scopes: 34 | - entity.name.type.class 35 | - source: ':' 36 | scopesBegin: 37 | - meta.head.class 38 | scopes: 39 | - punctuation.separator.colon.inheritance 40 | - source: public 41 | scopes: 42 | - storage.type.modifier.access.public 43 | - source: bar 44 | scopes: 45 | - meta.qualified-type 46 | - entity.name.type 47 | - source: '{' 48 | scopes: 49 | - punctuation.section.block.begin.bracket.curly.class 50 | scopesEnd: 51 | - meta.head.class 52 | - source: '}' 53 | scopes: 54 | - meta.body.class 55 | - punctuation.section.block.end.bracket.curly.class 56 | - source: ; 57 | scopes: 58 | - punctuation.terminator.statement 59 | -------------------------------------------------------------------------------- /language_examples/#055.cpp: -------------------------------------------------------------------------------- 1 | enum foo : std::int8_t { 2 | 3 | }; 4 | void foo(enum foo::bar::baz quix); -------------------------------------------------------------------------------- /language_examples/#058.cpp: -------------------------------------------------------------------------------- 1 | COMM_Bool GetThing(); -------------------------------------------------------------------------------- /language_examples/#058.spec.yaml: -------------------------------------------------------------------------------- 1 | - source: COMM_Bool 2 | scopesBegin: 3 | - meta.function.definition 4 | scopes: 5 | - meta.qualified-type 6 | - entity.name.type 7 | - source: GetThing 8 | scopesBegin: 9 | - meta.head.function.definition 10 | scopes: 11 | - entity.name.function.definition 12 | - source: ( 13 | scopes: 14 | - punctuation.section.parameters.begin.bracket.round 15 | - source: ) 16 | scopes: 17 | - punctuation.section.parameters.end.bracket.round 18 | scopesEnd: 19 | - meta.function.definition 20 | - meta.head.function.definition 21 | - source: ; 22 | scopes: 23 | - punctuation.terminator.statement 24 | -------------------------------------------------------------------------------- /language_examples/#059.cpp: -------------------------------------------------------------------------------- 1 | void function() { 2 | auto postWakeup = wpi::uv::Async<>::Create(loop); 3 | m_postMessageWakeup= postWakeup; 4 | postWakeup->wakeup.connect([this] { 5 | auto pipe = m_pipe.lock(); 6 | }) 7 | } -------------------------------------------------------------------------------- /language_examples/#060.cpp: -------------------------------------------------------------------------------- 1 | void func() { 2 | stream << static_cast(val >> 56) << static_cast(val >> 48) 3 | << static_cast(val >> 40) << static_cast(val >> 32) 4 | << static_cast(val >> 24) << static_cast(val >> 16) 5 | << static_cast(val >> 8) << static_cast(val); 6 | } -------------------------------------------------------------------------------- /language_examples/#062.cpp: -------------------------------------------------------------------------------- 1 | typedef foo int; -------------------------------------------------------------------------------- /language_examples/#062.spec.yaml: -------------------------------------------------------------------------------- 1 | - source: typedef 2 | scopes: 3 | - keyword.other.typedef 4 | - source: foo 5 | scopes: 6 | - variable.lower-case 7 | - variable.other.unknown.foo 8 | - source: int 9 | scopes: 10 | - storage.type.primitive 11 | - storage.type.built-in.primitive 12 | - source: ; 13 | scopes: 14 | - punctuation.terminator.statement 15 | -------------------------------------------------------------------------------- /language_examples/#064.cpp: -------------------------------------------------------------------------------- 1 | void function() { 2 | int *a = ::new int; 3 | int *a = new int; 4 | int *a = ::new[] int; 5 | int *a = new[] int; 6 | int *a = ::new (int); 7 | int *a = new (int); 8 | int *a = ::new[] (int); 9 | int *a = new[] (int); 10 | int *a = ::new(2, f) int; 11 | int *a = new(2, f) int; 12 | int *a = ::new(2, f)[] int; 13 | int *a = new(2, f)[] int; 14 | int *a = ::new(2, f) (int); 15 | int *a = new(2, f) (int); 16 | int *a = ::new(2, f)[] (int); 17 | int *a = new(2, f)[] (int); 18 | ::delete a; 19 | delete a; 20 | ::delete[] a; 21 | delete[] a; 22 | ::delete (a); 23 | delete (a); 24 | ::delete[] (a); 25 | delete[] (a); 26 | ::delete (a, b); 27 | delete (a, b); 28 | ::delete[] (a, b); 29 | delete[] (a, b); 30 | } -------------------------------------------------------------------------------- /language_examples/#071.cpp: -------------------------------------------------------------------------------- 1 | struct A { 2 | int a; 3 | int b; 4 | usertype user_value; 5 | usertype user_value{'A'}; 6 | int a[] = {1,2,3}; 7 | scoped::templated value; 8 | compound::type value; 9 | }; 10 | 11 | int a; 12 | int b; 13 | usertype user_value; 14 | usertype user_value{'A'}; 15 | scoped::templated value; 16 | compound::type value; 17 | int a[] = {1,2,3}; 18 | function_declaration(int *, usertype user_value); 19 | 20 | int main() { 21 | int* a; 22 | int b; 23 | usertype user_value[] = {1,2,3}; 24 | usertype* user_value[] = {1,2,3}; 25 | usertype* user_value[1]; 26 | usertype user_value{'A'}; 27 | scoped::templated value; 28 | compound::type value; 29 | int a[] = {1,2,3}; 30 | function_declaration(int *, usertype user_value); 31 | } -------------------------------------------------------------------------------- /language_examples/#072.cpp: -------------------------------------------------------------------------------- 1 | class A{ 2 | void abc(); 3 | }; 4 | class A 5 | { 6 | void abc(); 7 | }; 8 | class A { 9 | void abc(); 10 | }; 11 | class A 12 | 13 | { 14 | void abc(); 15 | }; 16 | struct { 17 | 18 | }; 19 | class { 20 | 21 | }; 22 | enum { 23 | 24 | }; 25 | union { 26 | 27 | }; 28 | struct{ 29 | 30 | }; 31 | class{ 32 | 33 | }; 34 | enum{ 35 | 36 | }; 37 | union{ 38 | 39 | }; -------------------------------------------------------------------------------- /language_examples/#076.cpp: -------------------------------------------------------------------------------- 1 | void __cdecl __debugbreak(void); -------------------------------------------------------------------------------- /language_examples/#076.spec.yaml: -------------------------------------------------------------------------------- 1 | - source: void 2 | scopesBegin: 3 | - meta.function.definition 4 | scopes: 5 | - meta.qualified-type 6 | - storage.type.primitive 7 | - storage.type.built-in.primitive 8 | - source: __cdecl 9 | scopesBegin: 10 | - meta.head.function.definition 11 | scopes: 12 | - storage.type.modifier.calling-convention 13 | - source: __debugbreak 14 | scopes: 15 | - entity.name.function.definition 16 | - source: ( 17 | scopes: 18 | - punctuation.section.parameters.begin.bracket.round 19 | - source: void 20 | scopes: 21 | - meta.function.definition.parameters 22 | - meta.parameter 23 | - storage.type.primitive 24 | - storage.type.built-in.primitive 25 | - source: ) 26 | scopes: 27 | - punctuation.section.parameters.end.bracket.round 28 | scopesEnd: 29 | - meta.function.definition 30 | - meta.head.function.definition 31 | - source: ; 32 | scopes: 33 | - punctuation.terminator.statement 34 | -------------------------------------------------------------------------------- /language_examples/#079.cpp: -------------------------------------------------------------------------------- 1 | template class MyStack; 2 | template MyStack::MyStack( void ); 3 | extern template class MyStack; 4 | extern template MyStack::MyStack( void ); -------------------------------------------------------------------------------- /language_examples/#080.cpp: -------------------------------------------------------------------------------- 1 | class foo { 2 | ~foo(); 3 | }; 4 | foo::~foo() {} 5 | foo::~bar() {} -------------------------------------------------------------------------------- /language_examples/#082.cpp: -------------------------------------------------------------------------------- 1 | struct copy_storage_helper // copyableT 2 | { 3 | [[noreturn]] void operator()(pointerT /*ptr*/, const hashT& /*hf*/, pointerT /*ptr_old*/, size_t /*off*/, size_t /*cnt*/) const 4 | { 5 | // `allocatorT::value_type` is not copy-constructible. 6 | // Throw an exception unconditionally, even when there is nothing to copy. 7 | noadl::sprintf_and_throw("cow_hashmap: `%s` is not copy-constructible.", 8 | typeid(typename allocatorT::value_type).name()); 9 | } 10 | }; 11 | template struct copy_storage_helper // copyableT 13 | { 14 | [[noreturn]] void operator()(pointerT /*ptr*/, const hashT& /*hf*/, pointerT /*ptr_old*/, size_t /*off*/, size_t /*cnt*/) const 15 | { 16 | // `allocatorT::value_type` is not copy-constructible. 17 | // Throw an exception unconditionally, even when there is nothing to copy. 18 | noadl::sprintf_and_throw("cow_hashmap: `%s` is not copy-constructible.", 19 | typeid(typename allocatorT::value_type).name()); 20 | } 21 | }; -------------------------------------------------------------------------------- /language_examples/#083.cpp: -------------------------------------------------------------------------------- 1 | void ABC::Method() 2 | { 3 | this->a = 5; 4 | } -------------------------------------------------------------------------------- /language_examples/#083.spec.yaml: -------------------------------------------------------------------------------- 1 | - source: void 2 | scopesBegin: 3 | - meta.function.definition 4 | scopes: 5 | - meta.qualified-type 6 | - storage.type.primitive 7 | - storage.type.built-in.primitive 8 | - source: ABC 9 | scopes: 10 | - entity.name.scope-resolution.function.definition 11 | - source: '::' 12 | scopes: 13 | - punctuation.separator.namespace.access 14 | - punctuation.separator.scope-resolution.function.definition 15 | - source: Method 16 | scopesBegin: 17 | - meta.head.function.definition 18 | scopes: 19 | - entity.name.function.definition 20 | - source: ( 21 | scopes: 22 | - punctuation.section.parameters.begin.bracket.round 23 | - source: ) 24 | scopes: 25 | - punctuation.section.parameters.end.bracket.round 26 | - source: '{' 27 | scopes: 28 | - punctuation.section.block.begin.bracket.curly.function.definition 29 | scopesEnd: 30 | - meta.head.function.definition 31 | - source: this 32 | scopesBegin: 33 | - meta.body.function.definition 34 | scopes: 35 | - variable.language.this 36 | - source: '->' 37 | scopes: 38 | - punctuation.separator.pointer-access 39 | - source: a 40 | scopes: 41 | - variable.other.property 42 | - source: '=' 43 | scopes: 44 | - keyword.operator.assignment 45 | - source: '5' 46 | scopes: 47 | - constant.numeric.decimal 48 | - source: ; 49 | scopes: 50 | - punctuation.terminator.statement 51 | - source: '}' 52 | scopes: 53 | - punctuation.section.block.end.bracket.curly.function.definition 54 | -------------------------------------------------------------------------------- /language_examples/#085.cpp: -------------------------------------------------------------------------------- 1 | extern "C" { // this one is okay 2 | void inBlock() 3 | {} 4 | } 5 | 6 | extern "C" void inBlock() // this one is not 7 | { 8 | 9 | } -------------------------------------------------------------------------------- /language_examples/#087.cpp: -------------------------------------------------------------------------------- 1 | void function() { 2 | putIfExists(cn.second, common, "type"); 3 | putIfExists(cn.second, common, "type"); 4 | } -------------------------------------------------------------------------------- /language_examples/#088.cpp: -------------------------------------------------------------------------------- 1 | // .h file with C++ syntax highlighting 2 | #ifdef USE_IN_HLSL 3 | cbuffer testCB 4 | #else 5 | struct testCB 6 | #endif // <= this #endif is highlighted white although its valid 7 | { 8 | float Brightness; 9 | // ... 10 | }; 11 | // the .h file with this struct definition can be used in HLSL and in C++ code 12 | // this way -------------------------------------------------------------------------------- /language_examples/#099.cpp: -------------------------------------------------------------------------------- 1 | pthread_rwlockattr_t thing; -------------------------------------------------------------------------------- /language_examples/#099.spec.yaml: -------------------------------------------------------------------------------- 1 | - source: pthread_rwlockattr_t 2 | scopes: 3 | - support.type.posix-reserved.pthread 4 | - support.type.built-in.posix-reserved.pthread 5 | - source: thing 6 | scopes: 7 | - variable.lower-case 8 | - variable.other.unknown.thing 9 | - source: ; 10 | scopes: 11 | - punctuation.terminator.statement 12 | -------------------------------------------------------------------------------- /language_examples/#100.cpp: -------------------------------------------------------------------------------- 1 | void function() { 2 | decltype(int); 3 | } -------------------------------------------------------------------------------- /language_examples/#100.spec.yaml: -------------------------------------------------------------------------------- 1 | - source: void 2 | scopesBegin: 3 | - meta.function.definition 4 | scopes: 5 | - meta.qualified-type 6 | - storage.type.primitive 7 | - storage.type.built-in.primitive 8 | - source: function 9 | scopesBegin: 10 | - meta.head.function.definition 11 | scopes: 12 | - entity.name.function.definition 13 | - source: ( 14 | scopes: 15 | - punctuation.section.parameters.begin.bracket.round 16 | - source: ) 17 | scopes: 18 | - punctuation.section.parameters.end.bracket.round 19 | - source: '{' 20 | scopes: 21 | - punctuation.section.block.begin.bracket.curly.function.definition 22 | scopesEnd: 23 | - meta.head.function.definition 24 | - source: decltype 25 | scopesBegin: 26 | - meta.body.function.definition 27 | scopes: 28 | - keyword.operator.functionlike 29 | - keyword.other.decltype 30 | - storage.type.decltype 31 | - source: ( 32 | scopes: 33 | - punctuation.section.arguments.begin.bracket.round.decltype 34 | - source: int 35 | scopes: 36 | - meta.arguments.decltype 37 | - storage.type.primitive 38 | - storage.type.built-in.primitive 39 | - source: ) 40 | scopes: 41 | - punctuation.section.arguments.end.bracket.round.decltype 42 | - source: ; 43 | scopes: 44 | - punctuation.terminator.statement 45 | - source: '}' 46 | scopes: 47 | - punctuation.section.block.end.bracket.curly.function.definition 48 | -------------------------------------------------------------------------------- /language_examples/#101.cpp: -------------------------------------------------------------------------------- 1 | using namespace std; -------------------------------------------------------------------------------- /language_examples/#101.spec.yaml: -------------------------------------------------------------------------------- 1 | - source: using 2 | scopesBegin: 3 | - meta.using-namespace 4 | scopes: 5 | - keyword.other.using.directive 6 | - source: namespace 7 | scopes: 8 | - keyword.other.namespace.directive 9 | - storage.type.namespace.directive 10 | - source: std 11 | scopes: 12 | - entity.name.namespace 13 | - source: ; 14 | scopes: 15 | - punctuation.terminator.statement 16 | -------------------------------------------------------------------------------- /language_examples/#106.cpp: -------------------------------------------------------------------------------- 1 | template > 2 | result_type operator()(argument_type k) { 3 | } 4 | template -------------------------------------------------------------------------------- /language_examples/#110.cpp: -------------------------------------------------------------------------------- 1 | void function() { 2 | switch(1) { 3 | case 1: break; 4 | default: 5 | } 6 | } -------------------------------------------------------------------------------- /language_examples/#113.cpp: -------------------------------------------------------------------------------- 1 | void function() { 2 | if(files.size() > 1) 3 | throwError("Conflicting index files ...") 4 | } -------------------------------------------------------------------------------- /language_examples/#120.cpp: -------------------------------------------------------------------------------- 1 | // invalid literals 2 | 1Ex 3 | 0xe+foo 4 | 0x1Px 5 | 0xAB.cdpfl 6 | 0x12345'luyards 7 | 0.'123 8 | 0'.123 9 | 1E'1 10 | 1'E1 11 | // odd valid literals 12 | 0x12345luyards 13 | 0'12345 14 | 0x1Ex 15 | 1Px -------------------------------------------------------------------------------- /language_examples/#120.spec.yaml: -------------------------------------------------------------------------------- 1 | - source: // 2 | scopesBegin: 3 | - comment.line.double-slash 4 | scopes: 5 | - punctuation.definition.comment 6 | - source: ' invalid literals' 7 | scopesEnd: 8 | - comment.line.double-slash 9 | - source: 1Ex 10 | scopesBegin: 11 | - invalid.illegal.constant.numeric 12 | - source: 0xe+foo 13 | - source: 0x1Px 14 | - source: 0xAB.cdpfl 15 | - source: 0x12345'luyards 16 | - source: 0.'123 17 | - source: 0'.123 18 | - source: 1E'1 19 | - source: 1'E1 20 | scopesEnd: 21 | - invalid.illegal.constant.numeric 22 | - source: // 23 | scopesBegin: 24 | - comment.line.double-slash 25 | scopes: 26 | - punctuation.definition.comment 27 | - source: ' odd valid literals' 28 | scopesEnd: 29 | - comment.line.double-slash 30 | - source: 0x 31 | scopes: 32 | - keyword.other.unit.hexadecimal 33 | - source: '12345' 34 | scopes: 35 | - constant.numeric.hexadecimal 36 | - source: luyards 37 | scopes: 38 | - keyword.other.suffix.literal.user-defined.integer 39 | - keyword.other.unit.user-defined 40 | - source: '0' 41 | scopes: 42 | - keyword.other.unit.octal 43 | - source: '''' 44 | scopesBegin: 45 | - constant.numeric.octal 46 | scopes: 47 | - punctuation.separator.constant.numeric 48 | - source: '12345' 49 | scopesEnd: 50 | - constant.numeric.octal 51 | - source: 0x 52 | scopes: 53 | - keyword.other.unit.hexadecimal 54 | - source: 1E 55 | scopes: 56 | - constant.numeric.hexadecimal 57 | - source: x 58 | scopes: 59 | - keyword.other.suffix.literal.user-defined.integer 60 | - keyword.other.unit.user-defined 61 | - source: '1' 62 | scopes: 63 | - constant.numeric.decimal 64 | - source: Px 65 | scopes: 66 | - keyword.other.suffix.literal.user-defined.integer 67 | - keyword.other.unit.user-defined 68 | -------------------------------------------------------------------------------- /language_examples/#121.cpp: -------------------------------------------------------------------------------- 1 | /* Works */ 2 | class ChildClass : public ParentClass {}; 3 | 4 | /* Highlighting lost */ 5 | class DLLEXPORT ChildClass : public ParentClass {}; 6 | class ChildClass : /* comment */ public ParentClass {}; 7 | class alignas(32) ChildClass : public ParentClass {}; -------------------------------------------------------------------------------- /language_examples/#123.cpp: -------------------------------------------------------------------------------- 1 | bool a = true, false; 2 | void * b = nullptr; -------------------------------------------------------------------------------- /language_examples/#123.spec.yaml: -------------------------------------------------------------------------------- 1 | - source: bool 2 | scopes: 3 | - storage.type.primitive 4 | - storage.type.built-in.primitive 5 | - source: a 6 | scopes: 7 | - variable.lower-case 8 | - variable.other.unknown.a 9 | - source: '=' 10 | scopes: 11 | - keyword.operator.assignment 12 | - source: 'true' 13 | scopes: 14 | - constant.language.true 15 | - source: ',' 16 | scopes: 17 | - punctuation.separator.delimiter.comma 18 | - source: 'false' 19 | scopes: 20 | - constant.language.false 21 | - source: ; 22 | scopes: 23 | - punctuation.terminator.statement 24 | - source: void 25 | scopes: 26 | - storage.type.primitive 27 | - storage.type.built-in.primitive 28 | - source: '*' 29 | scopes: 30 | - keyword.operator.arithmetic 31 | - source: b 32 | scopes: 33 | - variable.lower-case 34 | - variable.other.unknown.b 35 | - source: '=' 36 | scopes: 37 | - keyword.operator.assignment 38 | - source: nullptr 39 | scopes: 40 | - constant.language.nullptr 41 | - source: ; 42 | scopes: 43 | - punctuation.terminator.statement 44 | -------------------------------------------------------------------------------- /language_examples/#128.cpp: -------------------------------------------------------------------------------- 1 | void bar(); 2 | entries = new symbolTableEntry *[entriesCount]; 3 | void bar(); -------------------------------------------------------------------------------- /language_examples/#129.cpp: -------------------------------------------------------------------------------- 1 | void function() { 2 | new Foo; 3 | new (Foo); 4 | new (fooptr) Foo; 5 | new (fooptr) (Foo); 6 | 7 | } -------------------------------------------------------------------------------- /language_examples/#130.cpp: -------------------------------------------------------------------------------- 1 | void function() { 2 | a->b->c = 1; 3 | a.b.c = 1; 4 | } -------------------------------------------------------------------------------- /language_examples/#130.spec.yaml: -------------------------------------------------------------------------------- 1 | - source: void 2 | scopesBegin: 3 | - meta.function.definition 4 | scopes: 5 | - meta.qualified-type 6 | - storage.type.primitive 7 | - storage.type.built-in.primitive 8 | - source: function 9 | scopesBegin: 10 | - meta.head.function.definition 11 | scopes: 12 | - entity.name.function.definition 13 | - source: ( 14 | scopes: 15 | - punctuation.section.parameters.begin.bracket.round 16 | - source: ) 17 | scopes: 18 | - punctuation.section.parameters.end.bracket.round 19 | - source: '{' 20 | scopes: 21 | - punctuation.section.block.begin.bracket.curly.function.definition 22 | scopesEnd: 23 | - meta.head.function.definition 24 | - source: a 25 | scopesBegin: 26 | - meta.body.function.definition 27 | scopes: 28 | - variable.lower-case 29 | - variable.other.object.access.a 30 | - source: '->' 31 | scopes: 32 | - punctuation.separator.pointer-access 33 | - source: b 34 | scopes: 35 | - variable.lower-case 36 | - variable.other.object.property 37 | - source: '->' 38 | scopes: 39 | - punctuation.separator.pointer-access 40 | - source: c 41 | scopes: 42 | - variable.other.property 43 | - source: '=' 44 | scopes: 45 | - keyword.operator.assignment 46 | - source: '1' 47 | scopes: 48 | - constant.numeric.decimal 49 | - source: ; 50 | scopes: 51 | - punctuation.terminator.statement 52 | - source: a 53 | scopes: 54 | - variable.lower-case 55 | - variable.other.object.access.a 56 | - source: . 57 | scopes: 58 | - punctuation.separator.dot-access 59 | - source: b 60 | scopes: 61 | - variable.lower-case 62 | - variable.other.object.property 63 | - source: . 64 | scopes: 65 | - punctuation.separator.dot-access 66 | - source: c 67 | scopes: 68 | - variable.other.property 69 | - source: '=' 70 | scopes: 71 | - keyword.operator.assignment 72 | - source: '1' 73 | scopes: 74 | - constant.numeric.decimal 75 | - source: ; 76 | scopes: 77 | - punctuation.terminator.statement 78 | - source: '}' 79 | scopes: 80 | - punctuation.section.block.end.bracket.curly.function.definition 81 | -------------------------------------------------------------------------------- /language_examples/#132.cpp: -------------------------------------------------------------------------------- 1 | namespace foo { namespace bar { 2 | // foo 3 | }} // namespace foo::bar 4 | namespace scoped::console { } -------------------------------------------------------------------------------- /language_examples/#133.cpp: -------------------------------------------------------------------------------- 1 | std::size_t size; -------------------------------------------------------------------------------- /language_examples/#133.spec.yaml: -------------------------------------------------------------------------------- 1 | - source: std 2 | scopes: 3 | - entity.name.scope-resolution 4 | - source: '::' 5 | scopes: 6 | - punctuation.separator.namespace.access 7 | - punctuation.separator.scope-resolution 8 | - source: size_t 9 | scopes: 10 | - storage.type 11 | - storage.type.built-in 12 | - source: size 13 | scopes: 14 | - variable.lower-case 15 | - variable.other.unknown.size 16 | - source: ; 17 | scopes: 18 | - punctuation.terminator.statement 19 | -------------------------------------------------------------------------------- /language_examples/#134.cpp: -------------------------------------------------------------------------------- 1 | void bar(); 2 | void bar(Type); 3 | void bar(Type foo); 4 | void bar(Type (*)(Type)); 5 | void bar(Type (*foo)(Type)); 6 | void bar(Type = value); 7 | void bar(Type foo = value); 8 | void bar(Type (*)(Type) = value); 9 | void bar(Type (*foo)(Type) = value); -------------------------------------------------------------------------------- /language_examples/#136.cpp: -------------------------------------------------------------------------------- 1 | #define TEST(name) _ts->test(name) = [&]() -> bool 2 | 3 | #define ASSERT(expected, actual) -------------------------------------------------------------------------------- /language_examples/#141.cpp: -------------------------------------------------------------------------------- 1 | void func() { 2 | std::cout << max(a, b) << std::endl; 3 | std::cout << max(a, b) << std::endl; 4 | } -------------------------------------------------------------------------------- /language_examples/#150.cpp: -------------------------------------------------------------------------------- 1 | enum enum1 2 | { 3 | //comment 4 | definition /* block comment */, definition3 5 | definition, definition2 //comment 6 | } -------------------------------------------------------------------------------- /language_examples/#150.spec.yaml: -------------------------------------------------------------------------------- 1 | - source: enum 2 | scopesBegin: 3 | - meta.block.enum 4 | - meta.head.enum 5 | scopes: 6 | - storage.type.enum 7 | - source: enum1 8 | scopes: 9 | - entity.name.type.enum 10 | - source: '{' 11 | scopes: 12 | - punctuation.section.block.begin.bracket.curly.enum 13 | scopesEnd: 14 | - meta.head.enum 15 | - source: // 16 | scopesBegin: 17 | - meta.body.enum 18 | - comment.line.double-slash 19 | scopes: 20 | - punctuation.definition.comment 21 | - source: comment 22 | scopesEnd: 23 | - comment.line.double-slash 24 | - source: definition 25 | scopes: 26 | - meta.enum.definition 27 | - variable.other.enummember 28 | - source: /* 29 | scopesBegin: 30 | - comment.block 31 | scopes: 32 | - punctuation.definition.comment.begin 33 | - source: ' block comment ' 34 | - source: '*/' 35 | scopes: 36 | - punctuation.definition.comment.end 37 | scopesEnd: 38 | - comment.block 39 | - source: ',' 40 | scopes: 41 | - punctuation.separator.delimiter.comma 42 | - source: definition3 43 | scopesBegin: 44 | - meta.enum.definition 45 | - variable.other.enummember 46 | - source: definition 47 | scopesEnd: 48 | - variable.other.enummember 49 | - source: ',' 50 | scopes: 51 | - punctuation.separator.delimiter.comma 52 | - source: definition2 53 | scopes: 54 | - variable.other.enummember 55 | scopesEnd: 56 | - meta.enum.definition 57 | - source: // 58 | scopesBegin: 59 | - comment.line.double-slash 60 | scopes: 61 | - punctuation.definition.comment 62 | - source: comment 63 | scopesEnd: 64 | - comment.line.double-slash 65 | - source: '}' 66 | scopes: 67 | - punctuation.section.block.end.bracket.curly.enum 68 | -------------------------------------------------------------------------------- /language_examples/#158.cpp: -------------------------------------------------------------------------------- 1 | #include "sample.h" 2 | namespace 3 | { 4 | void failedToLoadCriticalData(const string& what, bool throwExcp = false) 5 | { 6 | } 7 | } -------------------------------------------------------------------------------- /language_examples/#166.cpp: -------------------------------------------------------------------------------- 1 | class Runtime_Error : public virtual std::exception 2 | { 3 | /* 4 | snip 5 | */ 6 | }; 7 | class Runtime_Error : virtual public std::exception 8 | { 9 | /* 10 | snip 11 | */ 12 | }; -------------------------------------------------------------------------------- /language_examples/#186.cpp: -------------------------------------------------------------------------------- 1 | std::vector> *g = new std::vector>[n]; 2 | for int -------------------------------------------------------------------------------- /language_examples/#188.cpp: -------------------------------------------------------------------------------- 1 | int main() { 2 | ceil(static_cast(audio_spec.freq) / static_cast(tgt_fps)) 3 | } -------------------------------------------------------------------------------- /language_examples/#198.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | std::string s = "correct"; 4 | std::string s("incorrect"); 5 | std::string s("?"); // incorrect -------------------------------------------------------------------------------- /language_examples/#203.cpp: -------------------------------------------------------------------------------- 1 | // another comment 2 | int fun() /* a comment */ // test 3 | { 4 | return 1; /* a comment */ // test 5 | } -------------------------------------------------------------------------------- /language_examples/#204.cpp: -------------------------------------------------------------------------------- 1 | int fun() 2 | { 3 | return 1; 4 | } 5 | 6 | int main() 7 | { 8 | int a, b; 9 | a = b * fun(); 10 | return 0; 11 | } -------------------------------------------------------------------------------- /language_examples/#207.cpp: -------------------------------------------------------------------------------- 1 | // This file is part of Asteria. 2 | // Copyleft 2018 - 2019, LH_Mouse. All wrongs reserved. 3 | 4 | #include "cow_string.hpp" 5 | 6 | namespace rocket { 7 | 8 | template class basic_cow_string; 9 | template class basic_cow_string; 10 | template class basic_cow_string; 11 | template class basic_cow_string; 12 | 13 | template ::std::istream& operator>>(::std::istream& is, cow_string& str); 14 | template ::std::wistream& operator>>(::std::wistream& is, cow_wstring& str); 15 | 16 | template ::std::ostream& operator<<(::std::ostream& os, const cow_string& str); 17 | template ::std::wostream& operator<<(::std::wostream& os, const cow_wstring& str); 18 | 19 | template ::std::istream& getline(::std::istream& is, cow_string& str, char delim); 20 | template ::std::wistream& getline(::std::wistream& is, cow_wstring& str, wchar_t delim); 21 | template ::std::istream& getline(::std::istream& is, cow_string& str); 22 | template ::std::wistream& getline(::std::wistream& is, cow_wstring& str); 23 | 24 | } // namespace rocket -------------------------------------------------------------------------------- /language_examples/#210.cpp: -------------------------------------------------------------------------------- 1 | __FILE__, __LINE__ 2 | 3 | bool std_debug_dump(const Value& value, const Opt indent) { 4 | bool succ = write_log(__FILE__, __LINE__); 5 | } -------------------------------------------------------------------------------- /language_examples/#218.cpp: -------------------------------------------------------------------------------- 1 | static void a( 2 | a a, 3 | a a, 4 | a a, 5 | a a, 6 | a a, 7 | bool a, 8 | bool a, 9 | bool a, 10 | bool a) 11 | 12 | { 13 | a a; 14 | 15 | 16 | a(a, a, 17 | a, 18 | a, 19 | a, 20 | a, 21 | a, 22 | a, 23 | a); 24 | a->a(&a); 25 | for (auto a : a) { 26 | auto &a = a.a; 27 | auto a = a.a; 28 | 29 | if (a && a) { 30 | switch (a) { 31 | case a: 32 | a->a(a->a()); 33 | break; 34 | case a: 35 | a->a(a->a()); 36 | break; 37 | case a: 38 | a->a(a->a()); 39 | break; 40 | case a: 41 | a->a(a->a()); 42 | break; 43 | } 44 | } 45 | a(a, a, 46 | a, 47 | a, 48 | a, 49 | a, 50 | a, 51 | a, 52 | a); 53 | } 54 | } 55 | 56 | static void a( 57 | a a, 58 | a a, 59 | a a, 60 | a a) 61 | 62 | { 63 | a a; 64 | a a =0; 65 | a->a()->a(); 66 | 67 | a(a->a()); 68 | a->a(a); 69 | a->a(a); 70 | a(a, a, a, 71 | a, 72 | a); 73 | a->a(&a); 74 | for (auto a: a) { 75 | a(a->a(), a, a, 76 | a); 77 | } 78 | } -------------------------------------------------------------------------------- /language_examples/#222.cpp: -------------------------------------------------------------------------------- 1 | #define hello 2 | #define hello -------------------------------------------------------------------------------- /language_examples/#222.spec.yaml: -------------------------------------------------------------------------------- 1 | - source: '#' 2 | scopesBegin: 3 | - meta.preprocessor.macro 4 | - keyword.control.directive.define 5 | scopes: 6 | - punctuation.definition.directive 7 | - source: define 8 | scopesEnd: 9 | - keyword.control.directive.define 10 | - source: hello 11 | scopes: 12 | - entity.name.function.preprocessor 13 | - source: '#' 14 | scopesBegin: 15 | - keyword.control.directive.define 16 | scopes: 17 | - punctuation.definition.directive 18 | - source: define 19 | scopesEnd: 20 | - keyword.control.directive.define 21 | - source: hello 22 | scopes: 23 | - entity.name.function.preprocessor 24 | -------------------------------------------------------------------------------- /language_examples/#224.cpp: -------------------------------------------------------------------------------- 1 | int main() { 2 | for (const auto &[a, b] : c) 3 | a->bug(bug); // bug 4 | for (const auto [a, b] : c) 5 | a->bug(bug); // bug 6 | } 7 | -------------------------------------------------------------------------------- /language_examples/#230.cpp: -------------------------------------------------------------------------------- 1 | void func() 2 | { 3 | class var** thing = (class var**)func(); //comment 4 | struct var** thing = (struct var**)func(); //comment 5 | enum var** thing = (enum var**)func(); //comment 6 | union var** thing = (union var**)func(); //comment 7 | } -------------------------------------------------------------------------------- /language_examples/#235.cpp: -------------------------------------------------------------------------------- 1 | #define a a \ 2 | -------------------------------------------------------------------------------- /language_examples/#235.spec.yaml: -------------------------------------------------------------------------------- 1 | - source: '#' 2 | scopesBegin: 3 | - meta.preprocessor.macro 4 | - keyword.control.directive.define 5 | scopes: 6 | - punctuation.definition.directive 7 | - source: define 8 | scopesEnd: 9 | - keyword.control.directive.define 10 | - source: a 11 | scopes: 12 | - entity.name.function.preprocessor 13 | - source: a 14 | scopes: 15 | - variable.lower-case 16 | - variable.other.unknown.a 17 | - source: \ 18 | scopes: 19 | - constant.character.escape.line-continuation 20 | -------------------------------------------------------------------------------- /language_examples/#238.cpp: -------------------------------------------------------------------------------- 1 | #define G_STATIC_ASSERT_EXPR(expr) ((void) sizeof (char[(expr) ? 1 : -1])) -------------------------------------------------------------------------------- /language_examples/#247.cpp: -------------------------------------------------------------------------------- 1 | struct foo { 2 | static_assert(true, "foo"); 3 | static_assert(bar, "bar"); 4 | foo(){} 5 | int bar(foo bar); 6 | }; 7 | -------------------------------------------------------------------------------- /language_examples/#249.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | using namespace std; 5 | 6 | class GameState { 7 | public: 8 | int a; 9 | }; 10 | 11 | class Node { 12 | public: 13 | int a; 14 | }; 15 | 16 | class Node *exploreTree(class GameState &game, vector &searchList) { 17 | } 18 | 19 | class Node *expandNode(class Node *nodePtr, class GameState &game, vector &searchList) { 20 | } 21 | 22 | int main() { 23 | return 0; 24 | } -------------------------------------------------------------------------------- /language_examples/#256.cpp: -------------------------------------------------------------------------------- 1 | class basic_string { 2 | basic_string() noexcept(noexcept(Allocator())) : basic_string(Allocator()) {} 3 | explicit basic_string(const Allocator &alloc) noexcept 4 | : __string({._s = {{}, _SSO_Cap}}, alloc){}; 5 | // see LWG 3076 for defect report, disabling comes from libc++ 6 | template < 7 | class = std::enable_if_t::value, nullptr_t>> 8 | basic_string(size_type count, CharT ch, const Allocator &alloc = Allocator()) 9 | : __string({}, alloc) { 10 | CharT *buf = _New_allocate(count); 11 | for(size_t s = 0; s < count; s++) { traits_type::assign(buf[s], ch); } 12 | traits_type::assign(buf[count], CharT()); 13 | } 14 | }; -------------------------------------------------------------------------------- /language_examples/#259.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | class cc; 6 | int func() 7 | { 8 | auto a = [](std::vector> c) 9 | { 10 | }; 11 | using namespace std::literals; 12 | } -------------------------------------------------------------------------------- /language_examples/#260.cpp: -------------------------------------------------------------------------------- 1 | // OK: 2 | /********************* DATA *************************/ 3 | // Crash: 4 | /********************* DATA *************************/ -------------------------------------------------------------------------------- /language_examples/#260.spec.yaml: -------------------------------------------------------------------------------- 1 | - source: // 2 | scopesBegin: 3 | - comment.line.double-slash 4 | scopes: 5 | - punctuation.definition.comment 6 | - source: ' OK:' 7 | scopesEnd: 8 | - comment.line.double-slash 9 | - source: /********************* 10 | scopesBegin: 11 | - comment.block.documentation 12 | scopes: 13 | - punctuation.definition.comment.begin.documentation 14 | - source: ' DATA ************************' 15 | - source: '*/' 16 | scopes: 17 | - punctuation.definition.comment.end.documentation 18 | scopesEnd: 19 | - comment.block.documentation 20 | - source: // 21 | scopesBegin: 22 | - comment.line.double-slash 23 | scopes: 24 | - punctuation.definition.comment 25 | - source: ' Crash:' 26 | scopesEnd: 27 | - comment.line.double-slash 28 | - source: ' /*********************' 29 | scopesBegin: 30 | - comment.block.documentation 31 | scopes: 32 | - punctuation.definition.comment.begin.documentation 33 | - source: ' DATA ' 34 | - source: '*************************/' 35 | scopes: 36 | - punctuation.definition.comment.end.documentation 37 | -------------------------------------------------------------------------------- /language_examples/#261.cpp: -------------------------------------------------------------------------------- 1 | constexpr A *__A() { 2 | return A() ? A::get<0>(A)._l.A 3 | : A::A(A::get<0>(A)._s.A[0]); 4 | } 5 | constexpr void func() { 6 | } -------------------------------------------------------------------------------- /language_examples/#264.cpp: -------------------------------------------------------------------------------- 1 | void func() { 2 | printf("%d\n", N); 3 | for(int i = 1; i <= N; ++i) 4 | printf("%d%c",randint(1,1000000006), " \n"[i==N]); 5 | 6 | static int perm[N + 1]; 7 | for(int i = 1; i <= N; ++i) 8 | perm[i] = i; 9 | std::shuffle(perm + 1, perm + 1 + N, gen) 10 | // std::shuffle(perm + 1, prem + N, perm + 1 + N) 11 | } -------------------------------------------------------------------------------- /language_examples/#268.cpp: -------------------------------------------------------------------------------- 1 | struct foo { 2 | explicit constexpr foo(); 3 | }; -------------------------------------------------------------------------------- /language_examples/#268.spec.yaml: -------------------------------------------------------------------------------- 1 | - source: struct 2 | scopesBegin: 3 | - meta.block.struct 4 | scopes: 5 | - meta.head.struct 6 | - storage.type.struct 7 | - source: foo 8 | scopes: 9 | - entity.name.type.struct 10 | - source: '{' 11 | scopes: 12 | - meta.head.struct 13 | - punctuation.section.block.begin.bracket.curly.struct 14 | - source: explicit 15 | scopesBegin: 16 | - meta.body.struct 17 | - meta.function.definition.special.constructor 18 | scopes: 19 | - storage.modifier.specifier.functional.pre-parameters.explicit 20 | - source: constexpr 21 | scopes: 22 | - storage.modifier.specifier.functional.pre-parameters.constexpr 23 | - source: foo 24 | scopesBegin: 25 | - meta.head.function.definition.special.constructor 26 | scopes: 27 | - entity.name.function.constructor 28 | - entity.name.function.definition.special.constructor 29 | - source: ( 30 | scopes: 31 | - punctuation.section.parameters.begin.bracket.round.special.constructor 32 | - source: ) 33 | scopes: 34 | - punctuation.section.parameters.end.bracket.round.special.constructor 35 | scopesEnd: 36 | - meta.function.definition.special.constructor 37 | - meta.head.function.definition.special.constructor 38 | - source: ; 39 | scopes: 40 | - punctuation.terminator.statement 41 | - source: '}' 42 | scopes: 43 | - punctuation.section.block.end.bracket.curly.struct 44 | scopesEnd: 45 | - meta.body.struct 46 | - source: ; 47 | scopes: 48 | - punctuation.terminator.statement 49 | -------------------------------------------------------------------------------- /language_examples/#278.cpp: -------------------------------------------------------------------------------- 1 | enum 2 | { 3 | a = '}' 4 | }; 5 | -------------------------------------------------------------------------------- /language_examples/#278.spec.yaml: -------------------------------------------------------------------------------- 1 | - source: enum 2 | scopesBegin: 3 | - meta.block.enum 4 | - meta.head.enum 5 | scopes: 6 | - storage.type.enum 7 | - source: '{' 8 | scopes: 9 | - punctuation.section.block.begin.bracket.curly.enum 10 | scopesEnd: 11 | - meta.head.enum 12 | - source: a 13 | scopesBegin: 14 | - meta.body.enum 15 | - meta.enum.definition 16 | scopes: 17 | - variable.other.enummember 18 | - source: '=' 19 | scopes: 20 | - keyword.operator.assignment 21 | - source: '''' 22 | scopesBegin: 23 | - string.quoted.single 24 | scopes: 25 | - punctuation.definition.string.begin 26 | - source: '}' 27 | - source: '''' 28 | scopes: 29 | - punctuation.definition.string.end 30 | scopesEnd: 31 | - meta.enum.definition 32 | - string.quoted.single 33 | - source: '}' 34 | scopes: 35 | - punctuation.section.block.end.bracket.curly.enum 36 | scopesEnd: 37 | - meta.body.enum 38 | - source: ; 39 | scopes: 40 | - punctuation.terminator.statement 41 | -------------------------------------------------------------------------------- /language_examples/#279.cpp: -------------------------------------------------------------------------------- 1 | void foo() { 2 | a["b"] 3 | ["c"]["d"] = 1; 4 | a["b"] 5 | ["c"]["d"]; 6 | } -------------------------------------------------------------------------------- /language_examples/#282.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | 6 | Atype aVar(Atype{1,2,3}); 7 | Atype aVar(new Atype{1,2,3}); 8 | Atype aVar(new int(10)); 9 | Atype aVar(int(10)); 10 | mt19937 gen(time(nullptr) ^ (size_t) new char); 11 | 12 | 13 | std::mt19937 eng1(std::time(nullptr)); 14 | // std::mt19937 eng2(1234); 15 | // int n(1234); 16 | // 3 lines above can all cause the problem 17 | 18 | int main() 19 | { 20 | printf("Hello World!\n"); 21 | 22 | return 0; 23 | } -------------------------------------------------------------------------------- /language_examples/#283.cpp: -------------------------------------------------------------------------------- 1 | using type = another_type; 2 | -------------------------------------------------------------------------------- /language_examples/#283.spec.yaml: -------------------------------------------------------------------------------- 1 | - source: using 2 | scopesBegin: 3 | - meta.declaration.type.alias 4 | scopes: 5 | - keyword.other.using.directive 6 | - source: type 7 | scopes: 8 | - entity.name.type 9 | - source: '=' 10 | scopes: 11 | - keyword.operator.assignment 12 | - source: another_type 13 | scopesBegin: 14 | - meta.qualified-type 15 | scopes: 16 | - entity.name.type 17 | - source: < 18 | scopesBegin: 19 | - meta.template.call 20 | scopes: 21 | - punctuation.section.angle-brackets.begin.template.call 22 | - source: /* 23 | scopesBegin: 24 | - comment.block 25 | scopes: 26 | - punctuation.definition.comment.begin 27 | - source: '*/' 28 | scopes: 29 | - punctuation.definition.comment.end 30 | scopesEnd: 31 | - comment.block 32 | - source: '>' 33 | scopes: 34 | - punctuation.section.angle-brackets.end.template.call 35 | scopesEnd: 36 | - meta.qualified-type 37 | - meta.template.call 38 | - source: ; 39 | scopes: 40 | - punctuation.terminator.statement 41 | -------------------------------------------------------------------------------- /language_examples/#287.cpp: -------------------------------------------------------------------------------- 1 | a ******** 2 | a &&&&&&&&&& 3 | "***** Program Info ********" 4 | char * string = "a string; buggy ***************"; 5 | DEBUG_UART_PORT.print( F( "\r******************* Program Info *******************\r\n" ) ); 6 | /**/ -------------------------------------------------------------------------------- /language_examples/#299.cpp: -------------------------------------------------------------------------------- 1 | enum FOO { 2 | ONE, 3 | TWO, 4 | #if COND 5 | TWO_AND_HALF, 6 | #endif 7 | THREE 8 | } 9 | 10 | #if COND 11 | #define TWO_AND_HALF 1 12 | #endif -------------------------------------------------------------------------------- /language_examples/#301.cpp: -------------------------------------------------------------------------------- 1 | class Base 2 | { 3 | public: 4 | virtual void method() const = 0; 5 | } 6 | class Derived : public Base 7 | { 8 | public: 9 | virtual void method() const override = 0; 10 | } 11 | -------------------------------------------------------------------------------- /language_examples/#305.cpp: -------------------------------------------------------------------------------- 1 | class ThisTest { 2 | ThisTest() 3 | : someMember(true), // here is a comment that is formatted incorrectly 4 | anotherOne(false), 5 | quiteALotOfMembers(false), // here's another one 6 | soManyThatTheConstructorIsLong(true), 7 | iMeanReallyLong(false) { 8 | } 9 | 10 | bool someMember; 11 | bool anotherOne; 12 | bool quiteALotOfMembers; 13 | bool soManyThatTheConstructorIsLong; 14 | bool iMeanReallyLong; 15 | }; -------------------------------------------------------------------------------- /language_examples/#307.cpp: -------------------------------------------------------------------------------- 1 | template 2 | class BaseClass { 3 | protected: 4 | // no instantiation of this base class 5 | BaseClass(bool argOne, bool argOther) : m_one(argOne), m_other(argOther) {} 6 | 7 | bool m_one, m_other; 8 | }; 9 | 10 | class ThisTest : public BaseClass { 11 | ThisTest() 12 | : someMember(true), // here is a comment that is colored nicely! 13 | anotherOne(false), quiteALotOfMembers(false), // here's another one! 14 | soManyThatTheConstructorIsLong(true), iMeanReallyLong(false), 15 | BaseClass(true, false) { // this constructor call doesn't look good 16 | } 17 | 18 | bool someMember; 19 | bool anotherOne; 20 | bool quiteALotOfMembers; 21 | bool soManyThatTheConstructorIsLong; 22 | bool iMeanReallyLong; 23 | }; 24 | -------------------------------------------------------------------------------- /language_examples/#324.cpp: -------------------------------------------------------------------------------- 1 | #define HARVEST_REQUEST_PARAM_APPEND(string, key, value, edited, ampersand) \ 2 | do { \ 3 | if(edited) { \ 4 | if(ampersand) { \ 5 | g_string_append_printf(string, "&%s=%s", #key, #value); \ 6 | } else { \ 7 | ampersand = TRUE; \ 8 | g_string_append_printf(string, "%s=%s", #key, #value); \ 9 | } \ 10 | } \ 11 | } while(0) 12 | -------------------------------------------------------------------------------- /language_examples/#341.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void doThings(std::string line, 4 | std::string entryMap, // a comment 5 | std::string entriesOne, // another one 6 | std::string entriesTwo // strange coloring here 7 | ); 8 | -------------------------------------------------------------------------------- /language_examples/#353.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * @brief performs a "foo" action 3 | * @param a the action to preform 4 | * @retval ERROR_SUCCESS action performed successfully 5 | * @retval EPERM permission error 6 | * @note if \c a is zero, something \b bad happens 7 | */ 8 | int foo(int a); 9 | 10 | /** 11 | * SECTION:meepapp 12 | * @short_description: the application class 13 | * @title: Meep application 14 | * @section_id: 15 | * @see_also: #MeepSettings 16 | * @stability: Stable 17 | * @include: meep/app.h 18 | * @image: application.png 19 | * 20 | * The application class handles ... 21 | */ -------------------------------------------------------------------------------- /language_examples/#370.cpp: -------------------------------------------------------------------------------- 1 | struct A { 2 | template 3 | struct Nested {}; 4 | }; 5 | 6 | template 7 | struct B : T::template Nested {}; // <-- 8 | 9 | B b; -------------------------------------------------------------------------------- /language_examples/#372.cpp: -------------------------------------------------------------------------------- 1 | template 2 | class C { 3 | static const int count = sizeof...(Args); // <-- 4 | }; -------------------------------------------------------------------------------- /language_examples/#375.cpp: -------------------------------------------------------------------------------- 1 | /************************************ 2 | * Comment here 3 | ************************************/ 4 | void bar(); -------------------------------------------------------------------------------- /language_examples/#375.spec.yaml: -------------------------------------------------------------------------------- 1 | - source: /************************************ 2 | scopesBegin: 3 | - comment.block.documentation 4 | scopes: 5 | - punctuation.definition.comment.begin.documentation 6 | - source: ' * Comment here' 7 | - source: '************************************/' 8 | scopes: 9 | - punctuation.definition.comment.end.documentation 10 | scopesEnd: 11 | - comment.block.documentation 12 | - source: void 13 | scopesBegin: 14 | - meta.function.definition 15 | scopes: 16 | - meta.qualified-type 17 | - storage.type.primitive 18 | - storage.type.built-in.primitive 19 | - source: bar 20 | scopesBegin: 21 | - meta.head.function.definition 22 | scopes: 23 | - entity.name.function.definition 24 | - source: ( 25 | scopes: 26 | - punctuation.section.parameters.begin.bracket.round 27 | - source: ) 28 | scopes: 29 | - punctuation.section.parameters.end.bracket.round 30 | scopesEnd: 31 | - meta.function.definition 32 | - meta.head.function.definition 33 | - source: ; 34 | scopes: 35 | - punctuation.terminator.statement 36 | -------------------------------------------------------------------------------- /language_examples/#378.cpp: -------------------------------------------------------------------------------- 1 | /** 2 | * doc comment 3 | */ 4 | enum foo {bar}; 5 | 6 | /** single line doc comment */ 7 | enum foo {bar}; 8 | 9 | ///{ 10 | enum foo {bar}; -------------------------------------------------------------------------------- /language_examples/#386.cpp: -------------------------------------------------------------------------------- 1 | class Vector { 2 | private: 3 | double* elem; // elem points to an array of sz doubles 4 | int sz; 5 | public: 6 | Vector(int s) :elem{new double[s]}, sz{s} // constructor: acquires resources 7 | { 8 | for (int i = 0; i != s; ++i) elem[i] = 0; // initialize elements 9 | } 10 | 11 | ~Vector() { delete[] elem; } // destructor: release resources 12 | 13 | double& operator[](int i); 14 | int size() const; 15 | }; -------------------------------------------------------------------------------- /language_examples/#395.cpp: -------------------------------------------------------------------------------- 1 | void f(); 2 | namespace A { 3 | void g(); 4 | } 5 | namespace X { 6 | using a::f; 7 | using A::g; 8 | } // namespace X 9 | -------------------------------------------------------------------------------- /language_examples/#396.cpp: -------------------------------------------------------------------------------- 1 | module example; 2 | import 3 | import some.other.module; 4 | 5 | export template 6 | concept convertible_to = 7 | std::is_convertible_v and 8 | requires(From (&f)()) { 9 | static_cast(f()); 10 | }; -------------------------------------------------------------------------------- /language_examples/#398.cpp: -------------------------------------------------------------------------------- 1 | static inline const std::string &foo() 2 | { } 3 | 4 | static const std::string &foo() 5 | { } 6 | 7 | constexpr const std::string &foo() 8 | { } 9 | 10 | static constexpr const std::string &foo() 11 | { } 12 | 13 | constexpr static const std::string &foo() 14 | { } 15 | 16 | constexpr static void foo() 17 | { } 18 | 19 | static constexpr void foo() 20 | { } 21 | 22 | constexpr void foo() 23 | { } 24 | 25 | static void foo() 26 | { } -------------------------------------------------------------------------------- /language_examples/#407.cpp: -------------------------------------------------------------------------------- 1 | struct unique_dynarray { 2 | unique_dynarray(const unique_dynarray&) = delete; 3 | unique_dynarray& operator=(const unique_dynarray&) = delete; 4 | unique_dynarray(unique_dynarray&&) = default; 5 | unique_dynarray& operator=(unique_dynarray&&) = default; 6 | }; 7 | -------------------------------------------------------------------------------- /language_examples/#410.cpp: -------------------------------------------------------------------------------- 1 | template 2 | class DummyContainer 3 | { 4 | public: 5 | DummyContainer(unsigned int size) : size(size) 6 | { 7 | container=new T[size]; 8 | } 9 | 10 | ~DummyContainer() 11 | { 12 | delete [] container; 13 | } 14 | 15 | DummyContainer operator>>=(unsigned int n) 16 | { 17 | for (int itr=0;itr+nmLastError.exchange(AL_NO_ERROR); 22 | } 23 | END_API_FUNC -------------------------------------------------------------------------------- /language_examples/#426.cpp: -------------------------------------------------------------------------------- 1 | json_safe_sprintf(msg3, "\":[", atol(row[8]) /*current car id*/, atoi(row[10]) /*ta driver version*/, atol(row[13]) /*exchange_member_id*/, tmp_line2, atol(row[16]) /*group_id*/, row[1] /*login*/, atof(row[17])); 2 | -------------------------------------------------------------------------------- /language_examples/#427.cpp: -------------------------------------------------------------------------------- 1 | void fun1() { 2 | goto foo; 3 | goto /* with inline comment */ foo; 4 | foo: 5 | } 6 | -------------------------------------------------------------------------------- /language_examples/#427.spec.yaml: -------------------------------------------------------------------------------- 1 | - source: void 2 | scopesBegin: 3 | - meta.function.definition 4 | scopes: 5 | - meta.qualified-type 6 | - storage.type.primitive 7 | - storage.type.built-in.primitive 8 | - source: fun1 9 | scopesBegin: 10 | - meta.head.function.definition 11 | scopes: 12 | - entity.name.function.definition 13 | - source: ( 14 | scopes: 15 | - punctuation.section.parameters.begin.bracket.round 16 | - source: ) 17 | scopes: 18 | - punctuation.section.parameters.end.bracket.round 19 | - source: '{' 20 | scopes: 21 | - punctuation.section.block.begin.bracket.curly.function.definition 22 | scopesEnd: 23 | - meta.head.function.definition 24 | - source: goto 25 | scopesBegin: 26 | - meta.body.function.definition 27 | scopes: 28 | - keyword.control.goto 29 | - source: foo 30 | scopes: 31 | - entity.name.label.call 32 | - source: ; 33 | scopes: 34 | - punctuation.terminator.statement 35 | - source: goto 36 | scopes: 37 | - keyword.control.goto 38 | - source: /* 39 | scopesBegin: 40 | - comment.block 41 | scopes: 42 | - punctuation.definition.comment.begin 43 | - source: ' with inline comment ' 44 | - source: '*/' 45 | scopes: 46 | - comment.block 47 | - punctuation.definition.comment.end 48 | scopesEnd: 49 | - comment.block 50 | - source: foo 51 | scopes: 52 | - entity.name.label.call 53 | - source: ; 54 | scopes: 55 | - punctuation.terminator.statement 56 | - source: foo 57 | scopes: 58 | - entity.name.label 59 | - source: ':' 60 | scopes: 61 | - punctuation.separator.label 62 | - source: '}' 63 | scopes: 64 | - punctuation.section.block.end.bracket.curly.function.definition 65 | -------------------------------------------------------------------------------- /language_examples/#432.cpp: -------------------------------------------------------------------------------- 1 | template struct Explicit { 2 | T t; 3 | }; 4 | 5 | template<> struct Explicit {}; 6 | 7 | extern template struct Explicit; 8 | 9 | extern 10 | template 11 | struct Explicit; 12 | 13 | template struct Explicit; 14 | 15 | template 16 | struct Explicit; 17 | -------------------------------------------------------------------------------- /language_examples/#433.cpp: -------------------------------------------------------------------------------- 1 | void test() 2 | { 3 | asm 4 | ( 5 | : : : 6 | ); 7 | } 8 | 9 | void test() 10 | { 11 | __asm__ 12 | ( 13 | // load palettes 14 | "ld2 {v4.16b, v5.16b}, [%[curpal0]]\n" 15 | "ld2 {v6.16b, v7.16b}, [%[curpal1]]\n" 16 | : 17 | [prevTileLo] "+w" (prevTile.val[0]), [prevTileHi] "+w" (prevTile.val[1]) 18 | : 19 | [curpal0] "r" (curpal0), [curpal1] "r" (curpal1) 20 | : 21 | "memory", "q0", "q1", "q2", "q3", "q4", "q5", "q6", "q7" 22 | ); 23 | 24 | int test = 0; 25 | printf("test %d\n", 0); 26 | } 27 | 28 | int main(int argc, char* argv[]) 29 | { 30 | 31 | } -------------------------------------------------------------------------------- /language_examples/#438.cpp: -------------------------------------------------------------------------------- 1 | template 2 | struct Example {}; 3 | struct Alpha : public Example<'{'> {}; 4 | struct Beta {}; 5 | int main () { 6 | int x = 52; 7 | } 8 | 9 | template 10 | struct Example {}; 11 | struct Alpha : public Example<'>'> {}; 12 | struct Beta {}; 13 | int main () { 14 | int x = 52; 15 | } -------------------------------------------------------------------------------- /language_examples/#443.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | int a; 3 | int b; 4 | auto str = "abdce"; 5 | '%' + foo() 6 | float c; 7 | int d; 8 | auto ch = 'a'; 9 | float e; 10 | int f; -------------------------------------------------------------------------------- /language_examples/#460.cpp: -------------------------------------------------------------------------------- 1 | std::tuple_element<0, std::pair, pugi::xml_node, std::less>, std::allocator,pugi::xml_node>>>>>::type dnode -------------------------------------------------------------------------------- /language_examples/#462.spec.yaml: -------------------------------------------------------------------------------- 1 | - source: DEFINE_SOMETHING 2 | scopes: 3 | - entity.name.function.call.upper-case 4 | - entity.name.function.call 5 | - source: ( 6 | scopes: 7 | - punctuation.section.arguments.begin.bracket.round.function.call 8 | - punctuation.section.arguments.begin.bracket.round.function.call.upper-case 9 | - source: ( 10 | scopesBegin: 11 | - meta.parens 12 | scopes: 13 | - punctuation.section.parens.begin.bracket.round 14 | - source: ) 15 | scopes: 16 | - punctuation.section.parens.end.bracket.round 17 | scopesEnd: 18 | - meta.parens 19 | - source: ) 20 | scopes: 21 | - punctuation.section.arguments.end.bracket.round.function.call 22 | - punctuation.section.arguments.begin.bracket.round.function.call.upper-case 23 | - source: ; 24 | scopes: 25 | - punctuation.terminator.statement 26 | -------------------------------------------------------------------------------- /language_examples/#489.cpp: -------------------------------------------------------------------------------- 1 | struct Base { 2 | virtual ~Base() noexcept = default; 3 | }; 4 | 5 | struct Derived1 : public Base { 6 | // Both override and noexcept are highlighted (correct) 7 | ~Derived1() noexcept override {} 8 | }; 9 | 10 | struct Derived2 : public Base { 11 | // Only noexcept is highlighted (wrong) 12 | ~Derived2() noexcept override = default; 13 | }; 14 | 15 | struct Derived3 : public Base { 16 | // Only noexcept is highlighted (wrong) 17 | ~Derived3() noexcept final = default; 18 | }; 19 | 20 | struct Derived4 : public Base { 21 | // override is not highlighted (wrong) 22 | ~Derived4() override = default; 23 | }; 24 | 25 | struct Derived5 : public Base { 26 | // final is not highlighted (wrong) 27 | ~Derived5() final = default; 28 | }; 29 | -------------------------------------------------------------------------------- /language_examples/#492.cpp: -------------------------------------------------------------------------------- 1 | template